aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-05-04 20:15:00 +0200
committerXavier Noria <fxn@hashref.com>2011-05-04 20:15:00 +0200
commit47e1cca5dcceb7534cb9548d36d93b78ed1f1d81 (patch)
treed85e8f06b932be999a7fa30be1d190fc774c0d73 /railties
parentafc3ccf74cbb6c3d495558e934ced1c006dacda8 (diff)
parent2076295abaf81997481138860eff855f7c1efa38 (diff)
downloadrails-47e1cca5dcceb7534cb9548d36d93b78ed1f1d81.tar.gz
rails-47e1cca5dcceb7534cb9548d36d93b78ed1f1d81.tar.bz2
rails-47e1cca5dcceb7534cb9548d36d93b78ed1f1d81.zip
Merge branch 'master' of git://github.com/lifo/docrails
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/engine.rb32
-rw-r--r--railties/lib/rails/paths.rb38
2 files changed, 35 insertions, 35 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index 6c1064c609..2015a944f0 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -92,17 +92,17 @@ module Rails
# The available paths in an engine are:
#
# class MyEngine < Rails::Engine
- # paths["app"] #=> ["app"]
- # paths["app/controllers"] #=> ["app/controllers"]
- # paths["app/helpers"] #=> ["app/helpers"]
- # paths["app/models"] #=> ["app/models"]
- # paths["app/views"] #=> ["app/views"]
- # paths["lib"] #=> ["lib"]
- # paths["lib/tasks"] #=> ["lib/tasks"]
- # paths["config"] #=> ["config"]
- # paths["config/initializers"] #=> ["config/initializers"]
- # paths["config/locales"] #=> ["config/locales"]
- # paths["config/routes"] #=> ["config/routes.rb"]
+ # paths["app"] # => ["app"]
+ # paths["app/controllers"] # => ["app/controllers"]
+ # paths["app/helpers"] # => ["app/helpers"]
+ # paths["app/models"] # => ["app/models"]
+ # paths["app/views"] # => ["app/views"]
+ # paths["lib"] # => ["lib"]
+ # paths["lib/tasks"] # => ["lib/tasks"]
+ # paths["config"] # => ["config"]
+ # paths["config/initializers"] # => ["config/initializers"]
+ # paths["config/locales"] # => ["config/locales"]
+ # paths["config/routes"] # => ["config/routes.rb"]
# end
#
# Your <tt>Application</tt> class adds a couple more paths to this set. And as in your
@@ -234,14 +234,14 @@ module Rails
# use the prefix "my_engine". In an isolated engine, the prefix will be omitted in url helpers and
# form fields for convenience.
#
- # polymorphic_url(MyEngine::Article.new) #=> "articles_path"
+ # polymorphic_url(MyEngine::Article.new) # => "articles_path"
#
# form_for(MyEngine::Article.new) do
- # text_field :title #=> <input type="text" name="article[title]" id="article_title" />
+ # text_field :title # => <input type="text" name="article[title]" id="article_title" />
# end
#
- # Additionally isolated engine will set its name according to namespace, so
- # MyEngine::Engine.engine_name #=> "my_engine". It will also set MyEngine.table_name_prefix
+ # Additionally an isolated engine will set its name according to namespace, so
+ # MyEngine::Engine.engine_name will be "my_engine". It will also set MyEngine.table_name_prefix
# to "my_engine_", changing MyEngine::Article model to use my_engine_article table.
#
# == Using Engine's routes outside Engine
@@ -250,7 +250,7 @@ module Rails
# <tt>url_helpers</tt> inside +Application+. When you mount an engine in an application's routes, a special helper is
# created to allow you to do that. Consider such a scenario:
#
- # # APP/config/routes.rb
+ # # config/routes.rb
# MyApplication::Application.routes.draw do
# mount MyEngine::Engine => "/my_engine", :as => "my_engine"
# match "/foo" => "foo#index"
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb
index d15887f561..5d217dcb10 100644
--- a/railties/lib/rails/paths.rb
+++ b/railties/lib/rails/paths.rb
@@ -31,23 +31,23 @@ module Rails
# This means we can get a Path object back like below:
#
# path = root["app/controllers"]
- # path.eager_load? #=> true
- # path.is_a?(Rails::Paths::Path) #=> true
+ # path.eager_load? # => true
+ # path.is_a?(Rails::Paths::Path) # => true
#
# The Path object is simply an array and allows you to easily add extra paths:
#
- # path.is_a?(Array) #=> true
- # path.inspect #=> ["app/controllers"]
+ # path.is_a?(Array) # => true
+ # path.inspect # => ["app/controllers"]
#
# path << "lib/controllers"
- # path.inspect #=> ["app/controllers", "lib/controllers"]
+ # path.inspect # => ["app/controllers", "lib/controllers"]
#
# Notice that when you add a path using #add, the path object created already
# contains the path with the same path value given to #add. In some situations,
# you may not want this behavior, so you can give :with as option.
#
# root.add "config/routes", :with => "config/routes.rb"
- # root["config/routes"].inspect #=> ["config/routes.rb"]
+ # root["config/routes"].inspect # => ["config/routes.rb"]
#
# #add also accepts the following options as argument: eager_load, autoload,
# autoload_once and glob.
@@ -58,8 +58,8 @@ module Rails
# root.path = "/rails"
# root.add "app/controllers"
#
- # root["app/controllers"].expanded #=> ["/rails/app/controllers"]
- # root["app/controllers"].existent #=> ["/rails/app/controllers"]
+ # root["app/controllers"].expanded # => ["/rails/app/controllers"]
+ # root["app/controllers"].existent # => ["/rails/app/controllers"]
#
# Check the Path documentation for more information.
class Root < ::Hash
@@ -156,17 +156,17 @@ module Rails
%w(autoload_once eager_load autoload load_path).each do |m|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
- def #{m}!
- @#{m} = true
- end
-
- def skip_#{m}!
- @#{m} = false
- end
-
- def #{m}?
- @#{m}
- end
+ def #{m}! # def eager_load!
+ @#{m} = true # @eager_load = true
+ end # end
+ #
+ def skip_#{m}! # def skip_eager_load!
+ @#{m} = false # @eager_load = false
+ end # end
+ #
+ def #{m}? # def eager_load?
+ @#{m} # @eager_load
+ end # end
RUBY
end