From 862a05edf3af128f25a87999936262b733ed781e Mon Sep 17 00:00:00 2001 From: Michael de Silva Date: Sun, 27 Jan 2013 06:12:33 +0530 Subject: [PATCH 1/5] Detail middleware initialization points in the initialization guide [ci skip] --- guides/source/initialization.md | 75 ++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/guides/source/initialization.md b/guides/source/initialization.md index 8ba5fa4601..9be985a2a4 100644 --- a/guides/source/initialization.md +++ b/guides/source/initialization.md @@ -464,7 +464,80 @@ def initialize!(group=:default) #:nodoc: end ``` -As you can see, you can only initialize an app once. This is also where the initializers are run. +As you can see, you can only initialize an app once. This is also where +the initializers are run through their three stages: `Bootstrap`, +`Railties`, and `Finisher`. +The resulting [middleware initialization +points](https://gist.github.com/4645422) are shown below: + + +NOTE: #BOOTSTRAP +load_environment_hook +load_active_support +set_eager_load +initialize_logger +initialize_cache +initialize_dependency_mechanism +bootstrap_hook +\-------------- +\#RAILTIES +active_support.deprecation_behavior +active_support.initialize_time_zone +active_support.initialize_beginning_of_week +active_support.set_configs +action_dispatch.configure +active_model.secure_password +action_view.embed_authenticity_token_in_remote_forms +action_view.logger +action_view.set_configs +action_view.caching +action_controller.assets_config +action_controller.set_helpers_path +action_controller.parameters_config +action_controller.set_configs +action_controller.compile_config_methods +active_record.initialize_timezone +active_record.logger +active_record.migration_error +active_record.check_schema_cache_dump +active_record.set_configs +active_record.initialize_database +active_record.validate_explain_support +active_record.log_runtime +active_record.set_reloader_hooks +active_record.add_watchable_files +action_mailer.logger +action_mailer.set_configs +action_mailer.compile_config_methods +setup_sass +setup_compression +set_load_path +set_autoload_paths +add_routing_paths +add_locales +add_view_paths +load_environment_config +append_assets_path +prepend_helpers_path +load_config_initializers +engines_blank_point +turbolinks_xhr_headers +\-------------- +\#FINISHER +add_generator_templates +ensure_autoload_once_paths_as_subset +add_builtin_route +build_middleware_stack +define_main_app_helper +add_to_prepare_blocks +run_prepare_callbacks +eager_load! +finisher_hook +set_routes_reloader_hook +set_clear_dependencies_hook +disable_dependency_loading +\-------------- + TODO: review this From 879c18df83ec019da08d8ba7688b5722af5981bb Mon Sep 17 00:00:00 2001 From: Manish Valechha Date: Sun, 27 Jan 2013 00:26:43 -0400 Subject: [PATCH 2/5] Fix typo in rails plugins guide --- guides/source/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/plugins.md b/guides/source/plugins.md index f8f04c3c67..695f25f8a9 100644 --- a/guides/source/plugins.md +++ b/guides/source/plugins.md @@ -86,7 +86,7 @@ Run `rake` to run the test. This test should fail because we haven't implemented Great - now you are ready to start development. -Then in `lib/yaffle.rb` require `lib/core_ext`: +Then in `lib/yaffle.rb` add `require "yaffle/core_ext"`: ```ruby # yaffle/lib/yaffle.rb From f409e0519f3532ddc8dff818546e7e3c02668b1d Mon Sep 17 00:00:00 2001 From: manishval Date: Tue, 29 Jan 2013 14:58:52 -0400 Subject: [PATCH 3/5] Typo in code --- guides/source/generators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/generators.md b/guides/source/generators.md index 8b91dfc5a5..1a08eb420a 100644 --- a/guides/source/generators.md +++ b/guides/source/generators.md @@ -310,7 +310,7 @@ In Rails 3.0 and above, generators don't just look in the source root for templa ```erb module <%= class_name %>Helper - attr_reader :<%= plural_name %>, <%= plural_name.singularize %> + attr_reader :<%= plural_name %>, :<%= plural_name.singularize %> end ``` From 26db079f94a12f03e64a31acf6b584b333c3d687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicholas=20Schultz-M=C3=B8ller?= Date: Thu, 31 Jan 2013 15:11:18 +0100 Subject: [PATCH 4/5] Fix formatting: ruby->erb. [ci skip] --- guides/source/caching_with_rails.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/source/caching_with_rails.md b/guides/source/caching_with_rails.md index e52264f296..a270ec7a7e 100644 --- a/guides/source/caching_with_rails.md +++ b/guides/source/caching_with_rails.md @@ -99,14 +99,14 @@ end This method generates a cache key that depends on all products and can be used in the view: -```ruby +```erb <% cache(cache_key_for_products) do %> All available products: <% end %> ``` You can also use an Active Record model as the cache key: -```ruby +```erb <% Product.all.each do |p| %> <% cache(p) do %> <%= link_to p.name, product_url(p) %> @@ -118,7 +118,7 @@ Behind the scenes, a method called `cache_key` will be invoked on the model and You can also combine the two schemes which is called "Russian Doll Caching": -```ruby +```erb <% cache(cache_key_for_products) do %> All available products: <% Product.all.each do |p| %> From 6a8687355253744c747654d5647b5730ea6901fd Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 2 Feb 2013 10:27:52 +0100 Subject: [PATCH 5/5] Revert "Detail middleware initialization points in the initialization guide [ci skip]" I feel this is too detailed for the guide. Most of that is not public interface, and if tomorrow something is added or removed in those chains we do not want to come here to maintain it. Also, linking to a gist is not a good idea in a guide. We could have a more broad description of what goes in what order, the most key and public things. This reverts commit 862a05edf3af128f25a87999936262b733ed781e. --- guides/source/initialization.md | 75 +-------------------------------- 1 file changed, 1 insertion(+), 74 deletions(-) diff --git a/guides/source/initialization.md b/guides/source/initialization.md index 9be985a2a4..8ba5fa4601 100644 --- a/guides/source/initialization.md +++ b/guides/source/initialization.md @@ -464,80 +464,7 @@ def initialize!(group=:default) #:nodoc: end ``` -As you can see, you can only initialize an app once. This is also where -the initializers are run through their three stages: `Bootstrap`, -`Railties`, and `Finisher`. -The resulting [middleware initialization -points](https://gist.github.com/4645422) are shown below: - - -NOTE: #BOOTSTRAP -load_environment_hook -load_active_support -set_eager_load -initialize_logger -initialize_cache -initialize_dependency_mechanism -bootstrap_hook -\-------------- -\#RAILTIES -active_support.deprecation_behavior -active_support.initialize_time_zone -active_support.initialize_beginning_of_week -active_support.set_configs -action_dispatch.configure -active_model.secure_password -action_view.embed_authenticity_token_in_remote_forms -action_view.logger -action_view.set_configs -action_view.caching -action_controller.assets_config -action_controller.set_helpers_path -action_controller.parameters_config -action_controller.set_configs -action_controller.compile_config_methods -active_record.initialize_timezone -active_record.logger -active_record.migration_error -active_record.check_schema_cache_dump -active_record.set_configs -active_record.initialize_database -active_record.validate_explain_support -active_record.log_runtime -active_record.set_reloader_hooks -active_record.add_watchable_files -action_mailer.logger -action_mailer.set_configs -action_mailer.compile_config_methods -setup_sass -setup_compression -set_load_path -set_autoload_paths -add_routing_paths -add_locales -add_view_paths -load_environment_config -append_assets_path -prepend_helpers_path -load_config_initializers -engines_blank_point -turbolinks_xhr_headers -\-------------- -\#FINISHER -add_generator_templates -ensure_autoload_once_paths_as_subset -add_builtin_route -build_middleware_stack -define_main_app_helper -add_to_prepare_blocks -run_prepare_callbacks -eager_load! -finisher_hook -set_routes_reloader_hook -set_clear_dependencies_hook -disable_dependency_loading -\-------------- - +As you can see, you can only initialize an app once. This is also where the initializers are run. TODO: review this