Will there be a way for rails 3 to load plugins from gems that have
been installed via the bundler?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Will there be a way for rails 3 to load plugins from gems that have
been installed via the bundler?
cheers
snusnu
If you install jammit as a plugin (via ./script/plugin install
git://github.com/samgranieri/jammit.git -r rails3) and type rake
routes, then the plugin loader will pick up the asset routes.
If you install jammit via the bundler, then type rake routes, then the
asset route wont show up. I tried installing it as a gem using a
locally checked out repo switched to the rails 3 branch.
Here's my gemfile lines for Jammit:
directory "/Users/sam/Documents/Development/ruby/gems/jammit"
gem 'jammit'
I hope this helps.
-- Sam
On Jan 19, 9:37 pm, Ryan Bigg <radarliste...@gmail.com> wrote:
> Could you elaborate? An example on what gem you're trying to use would be
> helpful!
>
> 2010/1/20 Sam Granieri <s...@samgranieri.com>
>
>
>
>
>
> > Will there be a way for rails 3 to load plugins from gems that have
> > been installed via the bundler?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Ruby on Rails: Core" group.
> > To post to this group, send email to rubyonra...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > rubyonrails-co...@googlegroups.com<rubyonrails-core%2Bunsubscrib e...@googlegroups.com>
I am working on a blog post now, but the basic idea is that ActionController, ActiveRecord, etc. are all "plugins" now. So anything that they can do, you can do too.
Another option would be to move it into lib/my_lib/railtie.rb (or whatever) and require it from my_lib.rb. You can then do require "my_lib/railtie" if defined?(Rails), since the Rails constant will always be required before your gems (check out boot.rb if you want to see how).
I suggest you write a post on how Railtie subclasses look like, what they can do and what are the options of hooking into the initializer other than simply appending new initialization steps to the list.
You can also look at the latest docs on railtie.rb that I just added at:
Is this actually the case at the moment? As far as I can see, there's no Bundler.require_env call anywhere in the Rails initialization. Should there be one somewhere to ensure that bundled gems are required?
The only way I have been able to load my gem plugin is using an explicit require at the bottom of boot.rb.
-Sam Pohlenz
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.