From ulf.moehring at mac.com Fri Dec 7 03:54:29 2007 From: ulf.moehring at mac.com (Ulf Moehring) Date: Fri, 7 Dec 2007 00:54:29 -0800 Subject: mrblog rake task fails Message-ID: <764603CD-2AD1-4720-BFE8-38471D11A403@mac.com> Hi all, I'm trying to run the mrblog sample application but somehow the rake task fails: -- Los-Angeles:~/Projects/mrblog Ulf$ rake db:schema:load --trace (in /Users/Ulf/Projects/mrblog) rake aborted! Don't know how to build task 'db:schema:load' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in `[]' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /opt/local/bin/rake:16:in `load' /opt/local/bin/rake:16 -- I'm using merb 0.42. I'm trying merb for the first time so I'm not sure where to look... Thank you, Ulf EMAIL: ULF.MOEHRING at MAC.COM | SKYPE: ULF.MOEHRING | AIM: ULF.MOEHRING at MAC.COM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20071207/b00e07ca/attachment.html From ivey at gweezlebur.com Fri Dec 7 09:08:01 2007 From: ivey at gweezlebur.com (Michael D. Ivey) Date: Fri, 7 Dec 2007 08:08:01 -0600 Subject: mrblog rake task fails In-Reply-To: <764603CD-2AD1-4720-BFE8-38471D11A403@mac.com> References: <764603CD-2AD1-4720-BFE8-38471D11A403@mac.com> Message-ID: <8E6B203C-1D95-4C00-96E0-42CE14464CED@gweezlebur.com> On Dec 7, 2007, at 2:54 AM, Ulf Moehring wrote: > I'm trying to run the mrblog sample application but somehow the > rake task fails: I don't think mrblog works with 0.4.x From dudley at misnomer.us Fri Dec 7 09:13:00 2007 From: dudley at misnomer.us (Dudley Flanders) Date: Fri, 7 Dec 2007 08:13:00 -0600 Subject: mrblog rake task fails In-Reply-To: <8E6B203C-1D95-4C00-96E0-42CE14464CED@gweezlebur.com> References: <764603CD-2AD1-4720-BFE8-38471D11A403@mac.com> <8E6B203C-1D95-4C00-96E0-42CE14464CED@gweezlebur.com> Message-ID: On Dec 7, 2007, at 8:08 AM, Michael D. Ivey wrote: > On Dec 7, 2007, at 2:54 AM, Ulf Moehring wrote: >> I'm trying to run the mrblog sample application but somehow the >> rake task fails: > > I don't think mrblog works with 0.4.x If no one wants to step up and claim ownership of mrblog, I think it should probably get deleted. It's been bitrotting for a while, and an out of date example is worse than none at all. :dudley From ez at engineyard.com Fri Dec 7 14:20:29 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Fri, 7 Dec 2007 11:20:29 -0800 Subject: mrblog rake task fails In-Reply-To: <764603CD-2AD1-4720-BFE8-38471D11A403@mac.com> References: <764603CD-2AD1-4720-BFE8-38471D11A403@mac.com> Message-ID: <97D1881A-B2A1-4343-B827-66BDAD4869D0@engineyard.com> Don't use mrblog. It is not up to date and won't run on merb 0.4.x. It's pretty much an abandoned project. Cheers- -Ezra On Dec 7, 2007, at 12:54 AM, Ulf Moehring wrote: > Hi all, > > I'm trying to run the mrblog sample application but somehow the rake > task fails: > > -- > Los-Angeles:~/Projects/mrblog Ulf$ rake db:schema:load --trace > (in /Users/Ulf/Projects/mrblog) > rake aborted! > Don't know how to build task 'db:schema:load' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in `[]' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in > `top_level' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in > `each' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in > `top_level' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > `standard_exception_handling' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in > `top_level' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > `standard_exception_handling' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' > /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 > /opt/local/bin/rake:16:in `load' > /opt/local/bin/rake:16 > -- > > I'm using merb 0.42. > > I'm trying merb for the first time so I'm not sure where to look... > > Thank you, > Ulf > > > EMAIL: ULF.MOEHRING at MAC.COM | SKYPE: ULF.MOEHRING | AIM: ULF.MOEHRING at MAC.COM > > > > _______________________________________________ > Merb-devel mailing list > Merb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/merb-devel - Ezra Zygmuntowicz -- Founder & Software Architect -- ezra at engineyard.com -- EngineYard.com From ulf.moehring at mac.com Fri Dec 7 18:38:29 2007 From: ulf.moehring at mac.com (Ulf Moehring) Date: Fri, 7 Dec 2007 15:38:29 -0800 Subject: mrblog rake task fails In-Reply-To: <97D1881A-B2A1-4343-B827-66BDAD4869D0@engineyard.com> References: <764603CD-2AD1-4720-BFE8-38471D11A403@mac.com> <97D1881A-B2A1-4343-B827-66BDAD4869D0@engineyard.com> Message-ID: Sorry, couldn't let go ;-) It almost runs smoothly now on merb 0.41 / merb_activerecord 0.4.3 / activerecord 2.0.1 / will_paginate... On Dec 7, 2007, at 11:20 AM, Ezra Zygmuntowicz wrote: > Don't use mrblog. It is not up to date and won't run on merb > 0.4.x. It's pretty much an abandoned project. > > Cheers- > -Ezra EMAIL: ULF.MOEHRING at MAC.COM | SKYPE: ULF.MOEHRING | AIM: ULF.MOEHRING at MAC.COM -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20071207/355d24df/attachment-0001.html From has.sox at gmail.com Wed Dec 12 07:30:45 2007 From: has.sox at gmail.com (Daniel N) Date: Wed, 12 Dec 2007 23:30:45 +1100 Subject: merbful_authentication Message-ID: <2fff50390712120430r529075a7h71366337dcd95e95@mail.gmail.com> Since there are so many efforts at the moment to port restful_authentication I figured I'd put a repo up so that it can be a collaborative effort. You can pick up a copy of the repo at git clone http://snatcht.com/git/merbful_authentication.git at the moment the app is in a branch. Not in the master. get the branch by git checkout -b remote/initial origin/inital_repo At the moment I'm aiming for a straight port of restful_authentication with datamapper in the intial app. This will get it available to the community at least. Then it can be pulled out and gemified as a datamapper generator, and the activerecord stuff ported out and included as a generator there too. The ultimate aim is to extract as much of the functionality into mixins as possible so that any updates are avilable with an update of the gem. If you wanted to customise the methods, just define them in your model/controller to overwrite the mixed in ones. The generator should only make the inital stubs with relevant includes, and a mixin to map used functions of the ORM to what's being used in the plugin. That way I hope specs can also be maintained as a single set of specs rather than one set per ORM. I'm aiming for minimal generator usage, with active_record, datamapper and sequel ports to become available. I'm not set in stone about the best way to reorganise it yet, and I'm more than happy to discuss where people think it should go. Let me know what you guys/girls think Cheers Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20071212/50a566ee/attachment.html From francois at teksol.info Wed Dec 12 22:25:12 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Wed, 12 Dec 2007 22:25:12 -0500 Subject: Trying to use ActiveRecord STI but fails Message-ID: <4760A618.7000805@teksol.info> Hi all, I'm wondering about my sanity here. There's probably something simple I overlooked. First off, I have close to zero experience with Merb. 1. I configured use_orm :activerecord in config/dependencies.rb; 2. I have a file named app/models/measurement.rb which looks like this: class Measurement < Observation end 3. I have another file named app/models/observation.rb which looks like this: class Observation < ActiveRecord::Base belongs_to :feature belongs_to :node belongs_to :observation_type end 4. I ran rake freeze_from_svn 5. I start merb using script/merb and stdout/stderr look like this: $ script/merb Merb started with these options: --- :exception_details: true :reloader: true :session_secret_key: .6393 :mongrel_x_sendfile: true :reloader_time: 0.5 :cache_templates: false :merb_root: /home/francois/src/florian-opsdb/trunk/amara :use_mutex: true :host: 127.0.0.1 :session_id_cookie_only: true :environment: development :port: "4000" :query_string_whitelist: [] Started merb_init.rb ... Connecting to database... Thu, 13 Dec 2007 03:22:38 GMT: loading gem 'merb_activerecord' from config/dependencies.rb:16 ... Loading Application... --- - /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib - /home/francois/src/florian-opsdb/trunk/amara/lib - projects/mongrel_experimental/lib/ - /home/francois/src/florian-opsdb/trunk/amara/lib - /home/francois/src/florian-opsdb/trunk/amara/app/controllers - /home/francois/src/florian-opsdb/trunk/amara/app/models - /home/francois/src/florian-opsdb/trunk/amara/framework - /usr/lib/ruby/gems/1.8/gems/abstract-1.0.0/bin - /usr/lib/ruby/gems/1.8/gems/abstract-1.0.0/lib - /usr/lib/ruby/gems/1.8/gems/erubis-2.4.1/bin - /usr/lib/ruby/gems/1.8/gems/erubis-2.4.1/lib - /usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/bin - /usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib - /usr/lib/ruby/gems/1.8/gems/cgi_multipart_eof_fix-2.5.0/bin - /usr/lib/ruby/gems/1.8/gems/cgi_multipart_eof_fix-2.5.0/lib - /usr/lib/ruby/gems/1.8/gems/daemons-1.0.9/bin - /usr/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib - /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.1/bin - /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.1/lib - /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.1/ext - /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin - /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/lib - /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/ext - /usr/lib/ruby/gems/1.8/gems/json-1.1.2/bin - /usr/lib/ruby/gems/1.8/gems/json-1.1.2/ext/json/ext - /usr/lib/ruby/gems/1.8/gems/json-1.1.2/ext - /usr/lib/ruby/gems/1.8/gems/json-1.1.2/lib - /usr/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/bin - /usr/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib - /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin - /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib - /usr/lib/ruby/gems/1.8/gems/hoe-1.3.0/bin - /usr/lib/ruby/gems/1.8/gems/hoe-1.3.0/lib - /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.5/bin - /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.5/lib - /usr/lib/ruby/gems/1.8/gems/ParseTree-2.0.2/bin - /usr/lib/ruby/gems/1.8/gems/ParseTree-2.0.2/lib - /usr/lib/ruby/gems/1.8/gems/ParseTree-2.0.2/test - /usr/lib/ruby/gems/1.8/gems/ruby2ruby-1.1.7/bin - /usr/lib/ruby/gems/1.8/gems/ruby2ruby-1.1.7/lib - /usr/lib/ruby/gems/1.8/gems/mime-types-1.15/bin - /usr/lib/ruby/gems/1.8/gems/mime-types-1.15/lib - /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/bin - /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib - /usr/lib/ruby/gems/1.8/gems/rubigen-1.1.1/bin - /usr/lib/ruby/gems/1.8/gems/rubigen-1.1.1/lib - /usr/lib/ruby/gems/1.8/gems/merb-0.4.1/bin - /usr/lib/ruby/gems/1.8/gems/merb-0.4.1/lib - /usr/lib/ruby/gems/1.8/gems/merb_activerecord-0.4.3/bin - /usr/lib/ruby/gems/1.8/gems/merb_activerecord-0.4.3/lib - /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/bin - /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib - /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/bin - /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib - /usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.11/bin - /usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.11/lib - /usr/local/lib/site_ruby/1.8 - /usr/local/lib/site_ruby/1.8/i486-linux - /usr/local/lib/site_ruby/1.8/i386-linux - /usr/local/lib/site_ruby - /usr/lib/ruby/1.8 - /usr/lib/ruby/1.8/i486-linux - /usr/lib/ruby/1.8/i386-linux - . /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/dependencies.rb:266:in `load_missing_constant': uninitialized constant Observation (NameError) from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/dependencies.rb:453:in `const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/dependencies.rb:465:in `const_missing' from /home/francois/src/florian-opsdb/trunk/amara/app/models/measurement.rb:1 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/dependencies.rb:496:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/dependencies.rb:342:in `new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/dependencies.rb:496:in `require' ... 8 levels... from /home/francois/src/florian-opsdb/trunk/amara/framework/merb/server.rb:262:in `initialize_merb' from /home/francois/src/florian-opsdb/trunk/amara/framework/merb/server.rb:606:in `mongrel_start' from /home/francois/src/florian-opsdb/trunk/amara/framework/merb/server.rb:542:in `run' from script/merb:3 The YAML document there is the result of $stderr.puts $:.to_yaml, which I put in right before the call to Merb::Server.load_application in config/merb_init.rb. Anybody can see what I did wrong ? Thanks ! Fran?ois From ez at engineyard.com Wed Dec 12 23:41:28 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Wed, 12 Dec 2007 20:41:28 -0800 Subject: Trying to use ActiveRecord STI but fails In-Reply-To: <4760A618.7000805@teksol.info> References: <4760A618.7000805@teksol.info> Message-ID: Hi Francois- Merb does not do automagick loading of classes via const_missing like rails does. So if you have STI models, you need to add specific require statements so thingsa load in the proper order. You can either explicitely require the modesl in order in your merb_init.rb or you can require the parent STI class fro the sibling STI classes to make sure it is loaded first. Cheers- -Ezra On Dec 12, 2007, at 7:25 PM, Fran?ois Beausoleil wrote: > Hi all, > > I'm wondering about my sanity here. There's probably something > simple I > overlooked. First off, I have close to zero experience with Merb. > > 1. I configured use_orm :activerecord in config/dependencies.rb; > 2. I have a file named app/models/measurement.rb which looks like > this: > > class Measurement < Observation > end > > 3. I have another file named app/models/observation.rb which looks > like > this: > > class Observation < ActiveRecord::Base > belongs_to :feature > belongs_to :node > belongs_to :observation_type > end > > 4. I ran rake freeze_from_svn > 5. I start merb using script/merb and stdout/stderr look like this: > > $ script/merb > Merb started with these options: > --- > :exception_details: true > :reloader: true > :session_secret_key: .6393 > :mongrel_x_sendfile: true > :reloader_time: 0.5 > :cache_templates: false > :merb_root: /home/francois/src/florian-opsdb/trunk/amara > :use_mutex: true > :host: 127.0.0.1 > :session_id_cookie_only: true > :environment: development > :port: "4000" > :query_string_whitelist: [] > > > Started merb_init.rb ... > Connecting to database... > Thu, 13 Dec 2007 03:22:38 GMT: loading gem 'merb_activerecord' from > config/dependencies.rb:16 ... > Loading Application... > --- > - /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib > - /home/francois/src/florian-opsdb/trunk/amara/lib > - projects/mongrel_experimental/lib/ > - /home/francois/src/florian-opsdb/trunk/amara/lib > - /home/francois/src/florian-opsdb/trunk/amara/app/controllers > - /home/francois/src/florian-opsdb/trunk/amara/app/models > - /home/francois/src/florian-opsdb/trunk/amara/framework > - /usr/lib/ruby/gems/1.8/gems/abstract-1.0.0/bin > - /usr/lib/ruby/gems/1.8/gems/abstract-1.0.0/lib > - /usr/lib/ruby/gems/1.8/gems/erubis-2.4.1/bin > - /usr/lib/ruby/gems/1.8/gems/erubis-2.4.1/lib > - /usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/bin > - /usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib > - /usr/lib/ruby/gems/1.8/gems/cgi_multipart_eof_fix-2.5.0/bin > - /usr/lib/ruby/gems/1.8/gems/cgi_multipart_eof_fix-2.5.0/lib > - /usr/lib/ruby/gems/1.8/gems/daemons-1.0.9/bin > - /usr/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib > - /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.1/bin > - /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.1/lib > - /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.1/ext > - /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin > - /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/lib > - /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.1/ext > - /usr/lib/ruby/gems/1.8/gems/json-1.1.2/bin > - /usr/lib/ruby/gems/1.8/gems/json-1.1.2/ext/json/ext > - /usr/lib/ruby/gems/1.8/gems/json-1.1.2/ext > - /usr/lib/ruby/gems/1.8/gems/json-1.1.2/lib > - /usr/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/bin > - /usr/lib/ruby/gems/1.8/gems/rubyforge-0.4.4/lib > - /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin > - /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib > - /usr/lib/ruby/gems/1.8/gems/hoe-1.3.0/bin > - /usr/lib/ruby/gems/1.8/gems/hoe-1.3.0/lib > - /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.5/bin > - /usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.5/lib > - /usr/lib/ruby/gems/1.8/gems/ParseTree-2.0.2/bin > - /usr/lib/ruby/gems/1.8/gems/ParseTree-2.0.2/lib > - /usr/lib/ruby/gems/1.8/gems/ParseTree-2.0.2/test > - /usr/lib/ruby/gems/1.8/gems/ruby2ruby-1.1.7/bin > - /usr/lib/ruby/gems/1.8/gems/ruby2ruby-1.1.7/lib > - /usr/lib/ruby/gems/1.8/gems/mime-types-1.15/bin > - /usr/lib/ruby/gems/1.8/gems/mime-types-1.15/lib > - /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/bin > - /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib > - /usr/lib/ruby/gems/1.8/gems/rubigen-1.1.1/bin > - /usr/lib/ruby/gems/1.8/gems/rubigen-1.1.1/lib > - /usr/lib/ruby/gems/1.8/gems/merb-0.4.1/bin > - /usr/lib/ruby/gems/1.8/gems/merb-0.4.1/lib > - /usr/lib/ruby/gems/1.8/gems/merb_activerecord-0.4.3/bin > - /usr/lib/ruby/gems/1.8/gems/merb_activerecord-0.4.3/lib > - /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/bin > - /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.1/lib > - /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/bin > - /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib > - /usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.11/bin > - /usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.11/lib > - /usr/local/lib/site_ruby/1.8 > - /usr/local/lib/site_ruby/1.8/i486-linux > - /usr/local/lib/site_ruby/1.8/i386-linux > - /usr/local/lib/site_ruby > - /usr/lib/ruby/1.8 > - /usr/lib/ruby/1.8/i486-linux > - /usr/lib/ruby/1.8/i386-linux > - . > /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/ > dependencies.rb:266:in > `load_missing_constant': uninitialized constant Observation > (NameError) > from > /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/ > dependencies.rb:453:in > `const_missing' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/ > dependencies.rb:465:in > `const_missing' > from > /home/francois/src/florian-opsdb/trunk/amara/app/models/ > measurement.rb:1 > from > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require' > from > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/ > dependencies.rb:496:in > `require' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/ > dependencies.rb:342:in > `new_constants_in' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.1/lib/active_support/ > dependencies.rb:496:in > `require' > ... 8 levels... > from > /home/francois/src/florian-opsdb/trunk/amara/framework/merb/ > server.rb:262:in > `initialize_merb' > from > /home/francois/src/florian-opsdb/trunk/amara/framework/merb/ > server.rb:606:in > `mongrel_start' > from > /home/francois/src/florian-opsdb/trunk/amara/framework/merb/ > server.rb:542:in > `run' > from script/merb:3 > > The YAML document there is the result of $stderr.puts $:.to_yaml, > which > I put in right before the call to Merb::Server.load_application in > config/merb_init.rb. > > Anybody can see what I did wrong ? > > Thanks ! > Fran?ois > _______________________________________________ > Merb-devel mailing list > Merb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/merb-devel - Ezra Zygmuntowicz -- Founder & Software Architect -- ezra at engineyard.com -- EngineYard.com From has.sox at gmail.com Thu Dec 13 03:42:10 2007 From: has.sox at gmail.com (Daniel N) Date: Thu, 13 Dec 2007 19:42:10 +1100 Subject: merbful_authentication In-Reply-To: <2fff50390712120430r529075a7h71366337dcd95e95@mail.gmail.com> References: <2fff50390712120430r529075a7h71366337dcd95e95@mail.gmail.com> Message-ID: <2fff50390712130042l7124b887i6f5c1a36a35e5435@mail.gmail.com> This is now available via a git server. git://snatcht.com/git/merbful_authentication.git Cheers Daniel On Dec 12, 2007 11:30 PM, Daniel N wrote: > Since there are so many efforts at the moment to port > restful_authentication I figured I'd put a repo up so that it can be a > collaborative effort. > > You can pick up a copy of the repo at > > git clone http://snatcht.com/git/merbful_authentication.git > > at the moment the app is in a branch. Not in the master. > > get the branch by > > git checkout -b remote/initial origin/inital_repo > > > At the moment I'm aiming for a straight port of restful_authentication > with datamapper in the intial app. This will get it available to the > community at least. > > Then it can be pulled out and gemified as a datamapper generator, and the > activerecord stuff ported out and included as a generator there too. > > The ultimate aim is to extract as much of the functionality into mixins as > possible so that any updates are avilable with an update of the gem. If you > wanted to customise the methods, just define them in your model/controller > to overwrite the mixed in ones. > > The generator should only make the inital stubs with relevant includes, > and a mixin to map used functions of the ORM to what's being used in the > plugin. > > That way I hope specs can also be maintained as a single set of specs > rather than one set per ORM. > > I'm aiming for minimal generator usage, with active_record, datamapper and > sequel ports to become available. > > I'm not set in stone about the best way to reorganise it yet, and I'm more > than happy to discuss where people think it should go. > > Let me know what you guys/girls think > > Cheers > Daniel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20071213/d017f6d4/attachment.html From luislavena at gmail.com Thu Dec 13 05:13:32 2007 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 13 Dec 2007 07:13:32 -0300 Subject: merbful_authentication In-Reply-To: <2fff50390712130042l7124b887i6f5c1a36a35e5435@mail.gmail.com> References: <2fff50390712120430r529075a7h71366337dcd95e95@mail.gmail.com> <2fff50390712130042l7124b887i6f5c1a36a35e5435@mail.gmail.com> Message-ID: <71166b3b0712130213g6674d2b5h760b6b4cac20a4ed@mail.gmail.com> On Dec 13, 2007 5:42 AM, Daniel N wrote: > This is now available via a git server. > > git://snatcht.com/git/merbful_authentication.git > Daniel, could you mirror / push it also to a svn server? Without starting a long git/non-git discussion, lot of users will benefit from that. Thanks in advance, -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From damien at new-bamboo.co.uk Thu Dec 13 05:19:18 2007 From: damien at new-bamboo.co.uk (Damien Tanner) Date: Thu, 13 Dec 2007 10:19:18 +0000 Subject: merbful_authentication In-Reply-To: <71166b3b0712130213g6674d2b5h760b6b4cac20a4ed@mail.gmail.com> References: <2fff50390712120430r529075a7h71366337dcd95e95@mail.gmail.com> <2fff50390712130042l7124b887i6f5c1a36a35e5435@mail.gmail.com> <71166b3b0712130213g6674d2b5h760b6b4cac20a4ed@mail.gmail.com> Message-ID: Indeed. On 12/13/07, Luis Lavena wrote: > On Dec 13, 2007 5:42 AM, Daniel N wrote: > > This is now available via a git server. > > > > git://snatcht.com/git/merbful_authentication.git > > > > Daniel, could you mirror / push it also to a svn server? > > Without starting a long git/non-git discussion, lot of users will > benefit from that. > > Thanks in advance, > > -- > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > Merb-devel mailing list > Merb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/merb-devel > -- Damien Tanner New Bamboo Web Development Ltd. Creating fresh, flexible and fast-growing web applications is our passion. +44 (0)78 6312 7999 +44 (0)20 7099 7486 http://www.new-bamboo.co.uk From francois at teksol.info Thu Dec 13 08:33:36 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Thu, 13 Dec 2007 08:33:36 -0500 Subject: Trying to use ActiveRecord STI but fails In-Reply-To: References: <4760A618.7000805@teksol.info> Message-ID: <476134B0.7090502@teksol.info> Hello Ez, Ezra Zygmuntowicz a ?crit : > You can either explicitely require the modesl in order in your > merb_init.rb or you can require the parent STI class fro the sibling STI > classes to make sure it is loaded first. Ah, thanks for the clarification. I actually require the parent class from the subclass' file. Bye ! Fran?ois From francois at teksol.info Thu Dec 13 09:53:54 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Thu, 13 Dec 2007 09:53:54 -0500 Subject: How to set response code Message-ID: <47614782.1070202@teksol.info> Hi ! I'm trying to return a simple 201 Created status to the caller, but I can't seem to do it. I use curl from the command line with the --verbose option, and the response is really 200 OK. My controller code: class Observations < Application def create(feature, node, observation_type) # Do some work... response.status = "201 Created" "" end end And the curl output: $ curl -v http://localhost:4000/observations -d feature=www -d node=andromede -d observation_type=mem:used -d value=632243 * About to connect() to localhost port 4000 (#0) * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 4000 (#0) > POST /observations HTTP/1.1 > User-Agent: curl/7.16.4 (i486-pc-linux-gnu) libcurl/7.16.4 OpenSSL/0.9.8e zlib/1.2.3.3 libidn/1.0 > Host: localhost:4000 > Accept: */* > Content-Length: 65 > Content-Type: application/x-www-form-urlencoded > < HTTP/1.1 200 OK < Connection: close < Date: Thu, 13 Dec 2007 14:51:30 GMT < Content-Type: text/html; charset=utf-8 < Content-Length: 0 < * Closing connection #0 The controller code is executed no problem, but I'm just wondering about that status code. Thanks ! -- Fran?ois Beausoleil http://blog.teksol.info/ From francois at teksol.info Thu Dec 13 10:24:47 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Thu, 13 Dec 2007 10:24:47 -0500 Subject: How to set response code In-Reply-To: <26f68ef60712130656q2ea0cca9w85cffaccf0cb7a71@mail.gmail.com> References: <47614782.1070202@teksol.info> <26f68ef60712130656q2ea0cca9w85cffaccf0cb7a71@mail.gmail.com> Message-ID: <47614EBF.1050001@teksol.info> Chris Farmiloe a ?crit : > set_status(201) Excellent ! That works just fine. Now that you mention it, I obviously found http://merb.rubyforge.org/classes/Merb/RenderMixin.html#M000175, but the documentation is, shall we say, absent. I'll submit a patch to the Trac. Thanks ! Fran?ois From francois at teksol.info Thu Dec 13 10:49:34 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Thu, 13 Dec 2007 10:49:34 -0500 Subject: Merb::RenderMixin#set_status refers to non-existent RESPONSE_CODES constant Message-ID: <4761548E.1020808@teksol.info> #set_status http://merb.devjavu.com/browser/trunk/lib/merb/mixins/render.rb#L270 refers to a non-existent constant. I tried, while creating #359, to make things OK, but I failed. I started by using STATUS_CODES instead, then used #[] instead of calling a method named STATUS_CODES, then I found out that during the call to #inherited http://merb.devjavu.com/browser/trunk/lib/merb/exceptions.rb#L111, the STATUS constant isn't defined (yet). I tried to add a #status method to Base, but even that failed because the class didn't have the constant during the call to #inherited. So, I'm rather stuck. It's probably a good idea to make the exception subclasses have a method, rather than a constant, to return the correct status code value. What's the consensus ? Should I start work on this ? What effect would this have on the rest of the code ? Bye ! Fran?ois Beausoleil http://blog.teksol.info/ From francois at teksol.info Thu Dec 13 11:55:54 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Thu, 13 Dec 2007 11:55:54 -0500 Subject: Distributing a Merb application as a Gem Message-ID: <4761641A.7040204@teksol.info> Hi all, I will distribute a Merb application as a gem. All the pieces are in place, except one: when daemonizing, the PID files are put in the default log/ location, instead of the place I defined. I looked through the code, and it seems possible to change the location of the log files, but the paths are hard-coded. I would have to abstract these away. Am I approaching this the right way, or should I look into another way ? Thanks ! Fran?ois From luislavena at gmail.com Thu Dec 13 12:24:16 2007 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 13 Dec 2007 14:24:16 -0300 Subject: constants_rewrite branch, Merb.root and Dir.pwd? Message-ID: <71166b3b0712130924j2ddd3303i5605d0c9d69aa00b@mail.gmail.com> Hello Guys, Doing some svn up and some looking at the code in the repo, found that MERB_ROOT and the replacement Merb.root constant based heavily on Dir.pwd (on trunk: http://merb.devjavu.com/browser/trunk/lib/merb.rb#L89) Dir.pwd present a problem when you try to run something "outside" the root of your app, let say inside app directory it will wrongly assing MERB_ROOT to Dir.pwd and will not be able to locate any of the other files that depend on it. Also found other issues when running specs with it, but don't have the code handy right now (on linux, code is on windows office). Shouldn't we use instead File.expand_path(File.join(__FILE__, '..')) Yeah, a bit of dark to the code clarity, but it works. I'll submit a proper patch later. Regards, -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From ez at engineyard.com Thu Dec 13 16:56:39 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Thu, 13 Dec 2007 13:56:39 -0800 Subject: Distributing a Merb application as a Gem In-Reply-To: <4761641A.7040204@teksol.info> References: <4761641A.7040204@teksol.info> Message-ID: <21C5700A-B268-4F06-B041-FC925CBD5FF6@engineyard.com> On Dec 13, 2007, at 8:55 AM, Fran?ois Beausoleil wrote: > Hi all, > > I will distribute a Merb application as a gem. All the pieces are in > place, except one: when daemonizing, the PID files are put in the > default log/ location, instead of the place I defined. > > I looked through the code, and it seems possible to change the > location > of the log files, but the paths are hard-coded. I would have to > abstract these away. > > Am I approaching this the right way, or should I look into another > way ? > > Thanks ! > Fran?ois > Hi Francios- Yeah I think being able to run a merb app as a gem is a good goal. I would be happy to accept a patch that made the log file and pid files location configurable. Cheers- - Ezra Zygmuntowicz -- Founder & Software Architect -- ezra at engineyard.com -- EngineYard.com From ez at engineyard.com Thu Dec 13 16:57:13 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Thu, 13 Dec 2007 13:57:13 -0800 Subject: Merb::RenderMixin#set_status refers to non-existent RESPONSE_CODES constant In-Reply-To: <4761548E.1020808@teksol.info> References: <4761548E.1020808@teksol.info> Message-ID: <3B2915CF-1876-42F3-9781-7E4DB60DEBAB@engineyard.com> On Dec 13, 2007, at 7:49 AM, Fran?ois Beausoleil wrote: > #set_status > http://merb.devjavu.com/browser/trunk/lib/merb/mixins/render.rb#L270 > > refers to a non-existent constant. I tried, while creating #359, to > make things OK, but I failed. I started by using STATUS_CODES > instead, > then used #[] instead of calling a method named STATUS_CODES, then I > found out that during the call to #inherited > http://merb.devjavu.com/browser/trunk/lib/merb/exceptions.rb#L111, the > STATUS constant isn't defined (yet). I tried to add a #status > method to > Base, but even that failed because the class didn't have the constant > during the call to #inherited. > > So, I'm rather stuck. It's probably a good idea to make the exception > subclasses have a method, rather than a constant, to return the > correct > status code value. > > What's the consensus ? Should I start work on this ? What effect > would > this have on the rest of the code ? > > Bye ! > Fran?ois Beausoleil > http://blog.teksol.info/ > Francios- I have applied your doc patch and I also think I fixed the code problem with the set_status helper. Can you please try again with trunk and verify it works for you? Thanks - Ezra Zygmuntowicz -- Founder & Software Architect -- ezra at engineyard.com -- EngineYard.com From hello at timperrett.com Tue Dec 18 19:16:24 2007 From: hello at timperrett.com (Tim Perrett) Date: Wed, 19 Dec 2007 00:16:24 +0000 Subject: Questions on writing plugin for merb Message-ID: Hey all, I am looking to write a plugin for merb and have a few queries about how to best go about it. I have a few questions (sorry if some are very merb newbie ones): - It seems all the plugins are gems; I can just add dependencies (my plugin will require soap4r) as per any usual gem spec? - If I want my plugin to add some new generate functionality? Is this possible? If so, are there any examples? I dont seem to be able to find any :( - The plugin needs to go into the gem dir right? So anything within the gem dir is automatically included on the app load path? - If there were some view helpers in the gem, is there way of forcing them to be included like in rails where you include them into the ActionView module so they are instantly available in views? It also seems that in version 0.4.2, doing "merb -P my_plugin" doesnt work outside a merb app? Is this a bug? Thanks for any pointers!! Cheers Tim From fernand.galiana at gmail.com Tue Dec 18 23:16:53 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Tue, 18 Dec 2007 21:16:53 -0700 Subject: Trapping custom exceptions in merb 0.5.0 Message-ID: <30ab479c0712182016o2b493cdesc3ffab9f9a075fab@mail.gmail.com> Hi, I have the following setup: class Fred < Application class InvalidKey < Merb::ControllerExceptions::Unauthorized; end def blee raise InvalidKey unless key end end I have added a view exception template in views/exceptions/invalid_key.html.erb but I am not seeing the exception page being rendered ?? The request seems to correctly go to the right exception controller action but the exception page is not being rendered ?? NOTE: Changing to raise NotFound unless key produces the same result... What am I missing ? Thanks, Fernand Stack: Unable to connect. Invalid credentials - (InvalidKey) /Users/fgaliana/work/new_ci/projects/domain/applications/fred/trunk/app/controllers/fred.rb:19:in 'blee' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/abstract_controller.rb:87:in `send' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/abstract_controller.rb:87:in `call_action' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/abstract_controller.rb:43:in `dispatch' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/controller.rb:112:in `dispatch' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/dispatcher.rb:51:in `dispatch_action' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/dispatcher.rb:51:in `synchronize' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/dispatcher.rb:51:in `dispatch_action' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/dispatcher.rb:35:in `handle' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/mongrel_handler.rb:87:in `process' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:159:in `process_client' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:158:in `each' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:158:in `process_client' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:285:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:285:in `initialize' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:285:in `new' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:285:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:268:in `initialize' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:268:in `new' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel.rb:268:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel/configurator.rb:282:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel/configurator.rb:281:in `each' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel/configurator.rb:281:in `run' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/server.rb:628:in `cloaker_' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel/configurator.rb:50:in `call' /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.2/lib/mongrel/configurator.rb:50:in `initialize' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/server.rb:619:in `new' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/server.rb:619:in `mongrel_start' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/lib/merb/server.rb:548:in `run' /opt/local/lib/ruby/gems/1.8/gems/merb-0.5.0/bin/merb:6 /opt/local/bin/merb:16:in `load' /opt/local/bin/merb:16 Setting up session Finalize session Time spent in Exceptions#invalid_key action: 0.006838 seconds Routing to controller: Exceptions action: invalid_key Route Recognition & Parsing HTTP Input took: seconds Request Times: {:controller=>"Exceptions", :action_time=>0.006838, :total_request_time=>0.016953, :action=>"invalid_key"} Response status: 401 Complete Request took: 0.016953 seconds, 58.986610039521 Requests/Second -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20071218/bbab1623/attachment-0001.html From luke.sutton at gmail.com Wed Dec 19 01:11:19 2007 From: luke.sutton at gmail.com (Luke Sutton) Date: Wed, 19 Dec 2007 16:41:19 +1030 Subject: Questions on writing plugin for merb In-Reply-To: References: Message-ID: <78CFC1B6-A06B-4619-A90E-FEDE571B8355@gmail.com> Hi Tim, > I am looking to write a plugin for merb and have a few queries about > how to best go about it. I have a few questions (sorry if some are > very merb newbie ones): > > - It seems all the plugins are gems; I can just add dependencies (my > plugin will require soap4r) as per any usual gem spec? Yep > - If I want my plugin to add some new generate functionality? Is this > possible? If so, are there any examples? I dont seem to be able to > find any :( Do you mean adding generators? I don't know too much about this, but someone else on the list can probably fill you in. > - The plugin needs to go into the gem dir right? So anything within > the gem dir is automatically included on the app load path? That's right. Although they don't have to be in the gem dir if you don't need. They can be installed like regular gems. > - If there were some view helpers in the gem, is there way of forcing > them to be included like in rails where you include them into the > ActionView module so they are instantly available in views? Yep. You need to mix them into the ViewContext module. The merb_helpers plugin has a good example: class Merb::ViewContext #:nodoc: include Merb::Helpers::Form end > It also seems that in version 0.4.2, doing "merb -P my_plugin" doesnt > work outside a merb app? Is this a bug? I've heard a few other people complain about this, but I haven't seen it myself. It's definitely a bug :) -- Luke From luke.sutton at gmail.com Wed Dec 19 01:13:51 2007 From: luke.sutton at gmail.com (Luke Sutton) Date: Wed, 19 Dec 2007 16:43:51 +1030 Subject: Trapping custom exceptions in merb 0.5.0 In-Reply-To: <30ab479c0712182016o2b493cdesc3ffab9f9a075fab@mail.gmail.com> References: <30ab479c0712182016o2b493cdesc3ffab9f9a075fab@mail.gmail.com> Message-ID: I've noticed an intermittent problem where new templates aren't being picked up. Have you tried restarting merb? -- Luke From hello at timperrett.com Wed Dec 19 04:49:18 2007 From: hello at timperrett.com (Tim Perrett) Date: Wed, 19 Dec 2007 09:49:18 +0000 Subject: Questions on writing plugin for merb In-Reply-To: <2fff50390712181641j43dba3e9wdb0e1d449ea2a6a@mail.gmail.com> References: <2fff50390712181641j43dba3e9wdb0e1d449ea2a6a@mail.gmail.com> Message-ID: <7AA955D4-9312-4E09-B627-78876D76CDC1@timperrett.com> On 19 Dec 2007, at 00:41, Daniel N wrote: > - If I want my plugin to add some new generate functionality? Is this > possible? If so, are there any examples? I dont seem to be able to > find any :( > > You can look at the ORM plugins, although they are a bit different > since the subclass specific helpers in merb. To see the generators > themselves that merb uses in > http://merb.devjavu.com/browser/trunk/lib/merb/generators/merb_generator_helpers.rb > > Basically if you want a generator you would create a generator in the > > merb_generators directory. If you want one specifically for > datamapper, activerecord, sequel, rspec or test_unit you would put > it in those directories with _generator added to the end. > > eg. > activerecord_generators > datamapper_generators > rspec_generators > my_generator_name_generator.rb > templates > template1.erb > template2.erb > USAGE > > The usage file, if present will allow the generator to be listed in > a call to > script/generate Ok, so just to check I understand it, my folder structure of my plugin might look something like: + some_merb_plugin + lib + merb_generators - my_demo_generator.rb + templates - template1.erb - USAGE + spec That will automatically then be included when script/generate is called? Looking at the source of the merb controller (et al) generators, there all subclasses of RubiGen::Base, so id presumably be able to copy that structure to create the generator I want? > - The plugin needs to go into the gem dir right? So anything within > the gem dir is automatically included on the app load path? > > It doesn't have to go in there. That's just a way to make sure your > app will see it on a shared host. You include a line in > dependencies.rb > dependency "my_plugin" Cool - I guess that negates the need for putting them in the gem dir. > - If there were some view helpers in the gem, is there way of forcing > them to be included like in rails where you include them into the > ActionView module so they are instantly available in views? > > Merb::ViewContext is the class that these should be put into. If > you put them in there. They will be avilable to your views. Sweet, that makes sense. Cheers Tim From hello at timperrett.com Wed Dec 19 12:17:28 2007 From: hello at timperrett.com (Tim Perrett) Date: Wed, 19 Dec 2007 17:17:28 +0000 Subject: Questions on writing plugin for merb In-Reply-To: <7AA955D4-9312-4E09-B627-78876D76CDC1@timperrett.com> References: <2fff50390712181641j43dba3e9wdb0e1d449ea2a6a@mail.gmail.com> <7AA955D4-9312-4E09-B627-78876D76CDC1@timperrett.com> Message-ID: <70FF6C54-E3DE-4B7F-A879-159706A5895B@timperrett.com> Ok, ive got my gem, its all packaged and installed into my system gem repository. I then added it to the list of dependencies, in a fresh merb app. However, when I do script/generate, I don't see it on the list of installed generators? Any ideas? Thanks Tim From hello at timperrett.com Wed Dec 19 12:58:46 2007 From: hello at timperrett.com (Tim Perrett) Date: Wed, 19 Dec 2007 17:58:46 +0000 Subject: Questions on writing plugin for merb In-Reply-To: <70FF6C54-E3DE-4B7F-A879-159706A5895B@timperrett.com> References: <2fff50390712181641j43dba3e9wdb0e1d449ea2a6a@mail.gmail.com> <7AA955D4-9312-4E09-B627-78876D76CDC1@timperrett.com> <70FF6C54-E3DE-4B7F-A879-159706A5895B@timperrett.com> Message-ID: <1325D370-4ED2-4E36-B7BB-AFA4802C599A@timperrett.com> Sorry to reply to my own message - ive fixed it, it was not packaging the generator files in the gem. You have got to change the gem spec to make sure it includes it. cheers Tim On 19 Dec 2007, at 17:17, Tim Perrett wrote: > Ok, ive got my gem, its all packaged and installed into my system gem > repository. > > I then added it to the list of dependencies, in a fresh merb app. > > However, when I do script/generate, I don't see it on the list of > installed generators? Any ideas? > > Thanks > > Tim From francois at teksol.info Wed Dec 19 14:08:46 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Wed, 19 Dec 2007 14:08:46 -0500 Subject: Distributing a Merb application as a Gem In-Reply-To: <21C5700A-B268-4F06-B041-FC925CBD5FF6@engineyard.com> References: <4761641A.7040204@teksol.info> <21C5700A-B268-4F06-B041-FC925CBD5FF6@engineyard.com> Message-ID: <47696C3E.3020505@teksol.info> Hello Ez, all, Ezra Zygmuntowicz a ?crit : > On Dec 13, 2007, at 8:55 AM, Fran?ois Beausoleil wrote: > >> I will distribute a Merb application as a gem. All the pieces are in >> place, except one: when daemonizing, the PID files are put in the >> default log/ location, instead of the place I defined. >> >> I looked through the code, and it seems possible to change the location >> of the log files, but the paths are hard-coded. I would have to >> abstract these away. > > Yeah I think being able to run a merb app as a gem is a good goal. I > would be happy to accept a patch that made the log file and pid files > location configurable. Ticket #372 implements this. http://merb.devjavu.com/ticket/372 Any plans on when 0.5 will be released ? Thanks ! Fran?ois From francois at teksol.info Wed Dec 19 16:08:20 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Wed, 19 Dec 2007 16:08:20 -0500 Subject: Nested partials losing the view context ? Message-ID: <47698844.60509@teksol.info> Hi all ! I can't seem to make a simple thing work... The code is here: http://pastie.caboo.se/130660 Essentially, that's a form with a couple of partials. The backtrace is included in the pastie. It looks like the context for the current view is lost when a partial is rendered. In _series.html.erb:2, I use "series" to get the name. This is the parameter I received from _form.html.erb. On line 3, I use series again, but this time, it is treated as a missing method call, and ends up in the controller, as designed. Can anyone shed any light on this ? Thanks ! -- Fran?ois Beausoleil http://blog.teksol.info/ From francois at teksol.info Wed Dec 19 16:16:48 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Wed, 19 Dec 2007 16:16:48 -0500 Subject: Nested partials losing the view context ? In-Reply-To: <2fff50390712191312l7c8e3c7ah68e68d4c66f61ce1@mail.gmail.com> References: <47698844.60509@teksol.info> <2fff50390712191312l7c8e3c7ah68e68d4c66f61ce1@mail.gmail.com> Message-ID: <47698A40.2090200@teksol.info> Hi, Daniel N a ?crit : > On Dec 20, 2007 8:08 AM, Fran?ois Beausoleil > wrote: > > Can anyone shed any light on this ? > > What version of merb are you using. I think this was fixed in the > latest gem. The fix is definitley in trunk. Hopefully it fixes this > issue. Of course, why can't I put out complete information... $ gem list -l merb *** LOCAL GEMS *** merb (0.4.2) merb_activerecord (0.4.3) Thanks ! Fran?ois From francois at teksol.info Wed Dec 19 16:42:03 2007 From: francois at teksol.info (=?ISO-8859-1?Q?Fran=E7ois_Beausoleil?=) Date: Wed, 19 Dec 2007 16:42:03 -0500 Subject: Nested partials losing the view context ? In-Reply-To: <47698A40.2090200@teksol.info> References: <47698844.60509@teksol.info> <2fff50390712191312l7c8e3c7ah68e68d4c66f61ce1@mail.gmail.com> <47698A40.2090200@teksol.info> Message-ID: <4769902B.8050703@teksol.info> Fran?ois Beausoleil a ?crit : > Daniel N a ?crit : >> On Dec 20, 2007 8:08 AM, Fran?ois Beausoleil > > wrote: >> >> Can anyone shed any light on this ? >> >> What version of merb are you using. I think this was fixed in the >> latest gem. The fix is definitley in trunk. Hopefully it fixes this >> issue. > > Of course, why can't I put out complete information... > > $ gem list -l merb > > *** LOCAL GEMS *** > > merb (0.4.2) > merb_activerecord (0.4.3) Unless I read incorrectly, this is wrong: http://merb.devjavu.com/browser/trunk/lib/merb/template/erubis.rb?rev=1032#L24 Is a new view context instantiated for each partial call ? If not, then the context is actually replaced with each partial call. Bye, Fran?ois From fernand.galiana at gmail.com Thu Dec 20 13:45:43 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Thu, 20 Dec 2007 11:45:43 -0700 Subject: Trapping custom exceptions in merb 0.5.0 Message-ID: <9B4BC022-FE94-4766-A2F4-64463213BBED@gmail.com> Hi Luke, Yes I did restart merb, same result ?? -Fernand From fernand.galiana at gmail.com Thu Dec 20 14:25:21 2007 From: fernand.galiana at gmail.com (Fernand Galiana) Date: Thu, 20 Dec 2007 12:25:21 -0700 Subject: Trapping custom exceptions in merb 0.5.0 Message-ID: <30ab479c0712201125p723c7e77w59e23bd261e17b60@mail.gmail.com> Hi Luke, Yes I had restarted merb but same results. I think I've found the problem. Perhaps I have a bit of a contrived example.. Say I have the following page index.rhtml.erb with

Hello World

That is it delegates to the fred controller to gen a chunck of javascript but if the controller action 'fred' throws and exception, this exception won't surface back the browser. Is there a way to solve this with merb ? Thanks, Fernand -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20071220/18b6718f/attachment.html From hello at timperrett.com Sun Dec 23 11:22:11 2007 From: hello at timperrett.com (Tim Perrett) Date: Sun, 23 Dec 2007 16:22:11 +0000 Subject: RSpec testing for merb plugin gem Message-ID: <96B045A9-51C3-4BAD-B8A2-98F68E0EE756@timperrett.com> Hey all I was wondering if someone could point me in the right direction for building some tests for a merb plugin i've written. I took a look at the plugin gems on ruby-forge, but none of them seem to have any tests?! Im not at all familiar with RSpec so not too sure where to start with this? Thanks for any help Tim From hello at timperrett.com Sun Dec 30 18:34:31 2007 From: hello at timperrett.com (Tim Perrett) Date: Sun, 30 Dec 2007 23:34:31 +0000 Subject: Loading config YAML into merb process for the life of the process Message-ID: Hey Chaps, Forgive me for not fully understanding the inner workings of merb, but I would like to read in a YAML configuration file once when the application is booted rather than reading it every time it is used (as presumably the overhead in doing that is significant?) - I had presumed this is how both Merb and rails do it for there database.yml config files (hence its a requirement to restart the process if you change the DB config) but after looking at the rails trunk there seems to be nothing obvious going on that would cache the returned configuration. Are there hooks available so that gem plugins for merb can run code when the application is at different parts of booting? If so, how on earth would I then store said configuration? Many thanks for any pointers Tim From ez at engineyard.com Sun Dec 30 19:12:32 2007 From: ez at engineyard.com (Ezra Zygmuntowicz) Date: Sun, 30 Dec 2007 16:12:32 -0800 Subject: Loading config YAML into merb process for the life of the process In-Reply-To: References: Message-ID: <96E1C1C4-30B2-4CB8-906E-01EA8D4E7D7F@engineyard.com> On Dec 30, 2007, at 3:34 PM, Tim Perrett wrote: > Hey Chaps, > > Forgive me for not fully understanding the inner workings of merb, but > I would like to read in a YAML configuration file once when the > application is booted rather than reading it every time it is used (as > presumably the overhead in doing that is significant?) - I had > presumed this is how both Merb and rails do it for there database.yml > config files (hence its a requirement to restart the process if you > change the DB config) but after looking at the rails trunk there seems > to be nothing obvious going on that would cache the returned > configuration. > > Are there hooks available so that gem plugins for merb can run code > when the application is at different parts of booting? If so, how on > earth would I then store said configuration? > > Many thanks for any pointers > > Tim Hey Tim- There are a few ways of doing this. The best way it to use the Merb::Plugins.config hash. If you generate a fresh plugin: merb -P foobar Then look in the plugin at the lib/foobar.rb file you will see this: # make sure we're running inside Merb if defined?(Merb::Plugins) # Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it Merb::Plugins.config[:foobar] = { :chickens => false } Merb::Plugins.add_rakefiles "foobar/merbtasks" end So your best bet is to load the yaml file here and store it away in the Merb::Plugins.config hash.. Something like this: # Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it Merb::Plugins.config[:foobar] = Erubis.load_yaml_file(MERB_ROOT / 'config' / 'foobar.yml' ) Then you can put your foobar.yml file inside of MERB_ROOT/config/ And now in your app when you want to refer to the hash of stuff loaded from the yaml file you woudl access it like this: Merb::Plugins.config[:foobar][:somekey] Doing it will Erubis.load_yaml_file will load the yaml file and interpolate any erb tags inside of it before yaml loading it. Make sense? Cheers- - Ezra Zygmuntowicz -- Founder & Software Architect -- ezra at engineyard.com -- EngineYard.com