At the moment when you create a new engine, its rakefile has such lines:

APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'

It loads only selected db tasks under the global rake namespace and makes
all the engine's rake tasks available under the app: namespace.

The other approach would be to bring all the tasks of the engine to the
global rake namespace by doing something like this:

load File.expand_path("../spec/dummy/Rakefile", __FILE__)

Could anyone explain me what is the reasoning behind this task selectivity
and app: namespacing?
It does seem clearer to me to see only really required for the development
of the gem tasks in the global namespace, but is it the only reason?
The problem is that some gems expect to see such tasks as db:test:prepare
and db:abort_if_pending_migrations in the global namespace and fail to work
properly when the tasks are in the app: namespace.
So is it a fail on the side of these gems?

I published this question on the Ruby on Rails: Core group as well, but
somehow my post just didn't appear here, so I'm trying to post it here.
Sorry if in the end the post appears at both the groups.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46f361c7-af71-4d1a-bc69-86222cc8219e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedAug 23, '13 at 10:58a
activeAug 23, '13 at 10:58a
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Yuriy Trofimenko: 1 post

People

Translate

site design / logo © 2021 Grokbase