Skip to content

Commit

Permalink
Added support for independent components residing in /components
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@714 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Feb 20, 2005
1 parent 12a7573 commit 69d0f50
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
11 changes: 11 additions & 0 deletions railties/CHANGELOG
@@ -1,5 +1,16 @@
*SVN*

* Added support for independent components residing in /components. Example:

Controller: components/list/items_controller.rb
(holds a List::ItemsController class with uses_component_template_root called)

Model : components/list/item.rb
(namespace is still shared, so an Item model in app/models will take precedence)

Views : components/list/items/show.rhtml


* Added --sandbox option to script/console that'll roll back all changes made to the database when you quit #672 [bitsweat]

* Added 'recent' as a rake target that'll run tests for files that changed in the last 10 minutes #612 [bitsweat]
Expand Down
2 changes: 1 addition & 1 deletion railties/Rakefile
Expand Up @@ -14,7 +14,7 @@ PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
PKG_DESTINATION = ENV["RAILS_PKG_DESTINATION"] || "../#{PKG_NAME}"


BASE_DIRS = %w( app config/environments db doc log lib public script test vendor )
BASE_DIRS = %w( app config/environments components db doc log lib public script test vendor )
APP_DIRS = %w( apis models controllers helpers views views/layouts )
PUBLIC_DIRS = %w( images javascripts stylesheets _doc )
TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/testing )
Expand Down
7 changes: 7 additions & 0 deletions railties/environments/shared.rb
Expand Up @@ -7,6 +7,7 @@

# Then model subdirectories.
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"])
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/components/[_a-z]*"])

# Followed by the standard includes.
ADDITIONAL_LOAD_PATHS.concat %w(
Expand All @@ -16,6 +17,7 @@
app/helpers
app/apis
config
components
lib
vendor
vendor/railties
Expand Down Expand Up @@ -61,4 +63,9 @@
[ActionController, ActionMailer].each { |mod| mod::Base.template_root ||= "#{RAILS_ROOT}/app/views/" }
ActionController::Routing::Routes.reload

Controllers = Dependencies::LoadingModule.root(
File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers')),
File.expand_path(File.join(RAILS_ROOT, 'components'))
)

# Include your app's configuration here:
7 changes: 7 additions & 0 deletions railties/environments/shared_for_gem.rb
Expand Up @@ -7,6 +7,7 @@

# Then model subdirectories.
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"])
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/components/[_a-z]*"])

# Followed by the standard includes.
ADDITIONAL_LOAD_PATHS.concat %w(
Expand All @@ -16,6 +17,7 @@
app/helpers
app/apis
config
components
lib
vendor
).map { |dir| "#{RAILS_ROOT}/#{dir}" }
Expand Down Expand Up @@ -56,4 +58,9 @@
[ActionController, ActionMailer].each { |mod| mod::Base.template_root ||= "#{RAILS_ROOT}/app/views/" }
ActionController::Routing::Routes.reload

Controllers = Dependencies::LoadingModule.root(
File.expand_path(File.join(RAILS_ROOT, 'app', 'controllers')),
File.expand_path(File.join(RAILS_ROOT, 'components'))
)

# Include your app's configuration here:
Expand Up @@ -102,6 +102,7 @@ def add_options!(opt)
app/models
app/views/layouts
config/environments
components
db
doc
lib
Expand Down

0 comments on commit 69d0f50

Please sign in to comment.