[Rails-core] Engine dependency - rails or railties ?

2014-01-07 Thread Emil S
Apologies if the question is too naive.

When I create a new engine using `rails plugin new `, I can
see a default dependency on "rails" in gemspec. Engines such as devise only
have dependency on "railties" and not the whole of "rails".

Why is the default dependency "rails" and not "railties" ?

- Emil

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails-core] Engine dependency - rails or railties ?

2014-01-07 Thread Matt Jones

On Jan 7, 2014, at 5:52 AM, Emil S  wrote:

> Apologies if the question is too naive.
> 
> When I create a new engine using `rails plugin new `, I can see 
> a default dependency on "rails" in gemspec. Engines such as devise only have 
> dependency on "railties" and not the whole of "rails".
> 
> Why is the default dependency "rails" and not "railties” ?


My wild guess would be that a dependency on ‘rails’ will wind up depending on 
the whole set of framework gems (Active Record / Action Pack / etc) via the 
‘rails’ gemspec whereas the ‘railties’ dependency is limited only to the actual 
engine infrastructure.

In Devise’s case ‘railties’ is likely chosen since you can use different ORMs 
and skip the generated controllers if you really want to. For a generated 
engine, you really need the whole ‘rails’ gem, since it puts a full Rails app 
in the test/dummy directory.

—Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.