From eb716f630771cd4ffde8aa9bff79301822cb4b2b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 12 Jul 2011 09:37:55 -0400 Subject: grammar/tense correction to rails application doc --- railties/lib/rails/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index fe29668c72..692f8f546f 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -11,7 +11,7 @@ module Rails # == Initialization # # Rails::Application is responsible for executing all railties, engines and plugin - # initializers. Besides, it also executed some bootstrap initializers (check + # initializers. It also executes some bootstrap initializers (check # Rails::Application::Bootstrap) and finishing initializers, after all the others # are executed (check Rails::Application::Finisher). # -- cgit v1.2.3 From 2f30fb03bb90a624fa36e9142e76c15788dd5048 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 12 Jul 2011 09:54:43 -0400 Subject: misc grammar and clarity changes for rails/engine docs --- railties/lib/rails/engine.rb | 55 +++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 26 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index eb6fcd5dd7..556aed19cf 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -5,13 +5,14 @@ require 'rbconfig' require 'rails/engine/railties' module Rails - # Rails::Engine allows you to wrap a specific Rails application and share it across - # different applications. Since Rails 3.0, every Rails::Application is nothing - # more than an engine, allowing you to share it very easily. + # Rails::Engine allows you to wrap a specific Rails application or subset of + # functionality and share it with other applications. Since Rails 3.0, every + # Rails::Application is just an engine, which allows for simple + # feature and application sharing. # - # Any Rails::Engine is also a Rails::Railtie, so the same methods - # (like rake_tasks and +generators+) and configuration available in the - # latter can also be used in the former. + # Any Rails::Engine is also a Rails::Railtie, so the same + # methods (like rake_tasks and +generators+) and configuration + # options that are available in railties can also be used in engines. # # == Creating an Engine # @@ -71,12 +72,13 @@ module Rails # # == Paths # - # Since Rails 3.0, both your application and engines do not have hardcoded paths. - # This means that you are not required to place your controllers at app/controllers, - # but in any place which you find convenient. + # Since Rails 3.0, applications and engines have more flexible path configuration (as + # opposed to the previous hardcoded path configuration). This means that you are not + # required to place your controllers at app/controllers, but in any place + # which you find convenient. # # For example, let's suppose you want to place your controllers in lib/controllers. - # All you would need to do is: + # You can set that as an option: # # class MyEngine < Rails::Engine # paths["app/controllers"] = "lib/controllers" @@ -105,9 +107,9 @@ module Rails # paths["config/routes"] # => ["config/routes.rb"] # end # - # Your Application class adds a couple more paths to this set. And as in your - # Application,all folders under +app+ are automatically added to the load path. - # So if you have app/observers, it's added by default. + # The Application class adds a couple more paths to this set. And as in your + # Application, all folders under +app+ are automatically added to the load path. + # If you have an app/observers folder for example, it will be added by default. # # == Endpoint # @@ -130,8 +132,8 @@ module Rails # # == Middleware stack # - # As an engine can now be rack endpoint, it can also have a middleware stack. The usage is exactly - # the same as in Application: + # As an engine can now be a rack endpoint, it can also have a middleware + # stack. The usage is exactly the same as in Application: # # module MyEngine # class Engine < Rails::Engine @@ -141,8 +143,8 @@ module Rails # # == Routes # - # If you don't specify an endpoint, routes will be used as the default endpoint. You can use them - # just like you use an application's routes: + # If you don't specify an endpoint, routes will be used as the default + # endpoint. You can use them just like you use an application's routes: # # # ENGINE/config/routes.rb # MyEngine::Engine.routes.draw do @@ -191,8 +193,8 @@ module Rails # == Isolated Engine # # Normally when you create controllers, helpers and models inside an engine, they are treated - # as they were created inside the application. This means all application helpers and named routes - # will be available to your engine's controllers. + # as if they were created inside the application itself. This means that all helpers and + # named routes from the application will be available to your engine's controllers as well. # # However, sometimes you want to isolate your engine from the application, especially if your engine # has its own router. To do that, you simply need to call +isolate_namespace+. This method requires @@ -240,9 +242,9 @@ module Rails # text_field :title # => # end # - # Additionally an isolated engine will set its name according to namespace, so + # 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. + # to "my_engine_", changing the MyEngine::Article model to use the my_engine_article table. # # == Using Engine's routes outside Engine # @@ -274,12 +276,13 @@ module Rails # end # end # - # Note that the :as option given to mount takes the engine_name as default, so most of the time + # Note that the :as option given to mount takes the engine_name as default, so most of the time # you can simply omit it. # - # Finally, if you want to generate a url to an engine's route using polymorphic_url, you also need - # to pass the engine helper. Let's say that you want to create a form pointing to one of the - # engine's routes. All you need to do is pass the helper as the first element in array with + # Finally, if you want to generate a url to an engine's route using + # polymorphic_url, you also need to pass the engine helper. Let's + # say that you want to create a form pointing to one of the engine's routes. + # All you need to do is pass the helper as the first element in array with # attributes for url: # # form_for([my_engine, @user]) @@ -319,7 +322,7 @@ module Rails # # Note that some of the migrations may be skipped if a migration with the same name already exists # in application. In such a situation you must decide whether to leave that migration or rename the - # migration in application and rerun copying migrations. + # migration in the application and rerun copying migrations. # # If your engine has migrations, you may also want to prepare data for the database in # the seeds.rb file. You can load that data using the load_seed method, e.g. -- cgit v1.2.3 From 85dd1dd663a8efac97e4d6a5dc33b23f1a75dc52 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 12 Jul 2011 10:20:42 -0400 Subject: grammar correction for rails/paths #add method arguments --- railties/lib/rails/paths.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index 09ff0ef378..6aecebe273 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -31,8 +31,8 @@ module Rails # root.add "config/routes", :with => "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. + # The #add method accepts the following options as arguments: + # eager_load, autoload, autoload_once and glob. # # Finally, the Path object also provides a few helpers: # -- cgit v1.2.3 From 46be69a220cf1815320ecdd7595d8fa37dcb5fd5 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Tue, 19 Jul 2011 23:54:48 +0530 Subject: spacing fix --- railties/lib/rails/engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 556aed19cf..b5b4c2becc 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -73,7 +73,7 @@ module Rails # == Paths # # Since Rails 3.0, applications and engines have more flexible path configuration (as - # opposed to the previous hardcoded path configuration). This means that you are not + # opposed to the previous hardcoded path configuration). This means that you are not # required to place your controllers at app/controllers, but in any place # which you find convenient. # -- cgit v1.2.3 From 38310ab1a6f559860e25b0e28bef9560bb452ae6 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 23 Jul 2011 12:14:10 +0200 Subject: little details seen while doing a pass through what's new in docrails --- railties/lib/rails/engine.rb | 3 ++- railties/lib/rails/paths.rb | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index b5b4c2becc..cb897e94d7 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -5,7 +5,7 @@ require 'rbconfig' require 'rails/engine/railties' module Rails - # Rails::Engine allows you to wrap a specific Rails application or subset of + # Rails::Engine allows you to wrap a specific Rails application or subset of # functionality and share it with other applications. Since Rails 3.0, every # Rails::Application is just an engine, which allows for simple # feature and application sharing. @@ -176,6 +176,7 @@ module Rails # == Engine name # # There are some places where an Engine's name is used: + # # * routes: when you mount an Engine with mount(MyEngine::Engine => '/my_engine'), # it's used as default :as option # * some of the rake tasks are based on engine name, e.g. my_engine:install:migrations, diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index 6aecebe273..daa1bdfc29 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -2,7 +2,7 @@ require 'set' module Rails module Paths - # This object is an extended hash that behaves as root of the Rails::Paths system. + # This object is an extended hash that behaves as root of the Rails::Paths system. # It allows you to collect information about how you want to structure your application # paths by a Hash like API. It requires you to give a physical path on initialization. # @@ -10,13 +10,13 @@ module Rails # root.add "app/controllers", :eager_load => true # # The command above creates a new root object and add "app/controllers" as a path. - # This means we can get a Path object back like below: + # This means we can get a +Rails::Paths::Path+ object back like below: # # path = root["app/controllers"] # 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: + # The +Path+ object is simply an array and allows you to easily add extra paths: # # path.is_a?(Array) # => true # path.inspect # => ["app/controllers"] @@ -24,17 +24,17 @@ module Rails # path << "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, + # 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"] # - # The #add method accepts the following options as arguments: + # The +add+ method accepts the following options as arguments: # eager_load, autoload, autoload_once and glob. # - # Finally, the Path object also provides a few helpers: + # Finally, the +Path+ object also provides a few helpers: # # root = Root.new "/rails" # root.add "app/controllers" @@ -42,7 +42,7 @@ module Rails # root["app/controllers"].expanded # => ["/rails/app/controllers"] # root["app/controllers"].existent # => ["/rails/app/controllers"] # - # Check the Path documentation for more information. + # Check the Rails::Paths::Path documentation for more information. class Root < ::Hash attr_accessor :path -- cgit v1.2.3