From a4679839adbccfdff38bd60b3757f1e31d60102b Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 8 Jun 2011 03:52:33 +0530 Subject: [PATCH 01/14] fix typo --- actionmailer/lib/action_mailer/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index ccc25c775b..3b4e59d703 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -365,7 +365,7 @@ module ActionMailer #:nodoc: Mail.register_observer(delivery_observer) end - # Register an Inteceptor which will be called before mail is sent. + # Register an Interceptor which will be called before mail is sent. # Either a class or a string can be passed in as the Interceptor. If a string is passed in # it will be constantized. def register_interceptor(interceptor) From 7fd8f71ce0b8e0bf30b416d5b6425bb5b636ed76 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 8 Jun 2011 04:48:03 +0530 Subject: [PATCH 02/14] fix incorrect validation examples --- .../source/active_record_validations_callbacks.textile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index 36094dcddc..50ff1c9ff7 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -182,7 +182,7 @@ It can receive an +:accept+ option, which determines the value that will be cons class Person < ActiveRecord::Base - validates :terms_of_service, :acceptance => true, :accept => 'yes' + validates :terms_of_service, :acceptance => { :accept => 'yes' } end @@ -338,7 +338,7 @@ WARNING. Note that the regular expression above allows a trailing newline charac class Player < ActiveRecord::Base validates :points, :numericality => true - validates :games_played, :numericality => true, :only_integer => true + validates :games_played, :numericality => { :only_integer => true } end @@ -393,8 +393,8 @@ There is a +:scope+ option that you can use to specify other attributes that are class Holiday < ActiveRecord::Base - validates :name, :uniqueness => true, :scope => :year, - :message => "should happen once per year" + validates :name, :uniqueness => { :scope => :year, + :message => "should happen once per year" } end @@ -402,7 +402,7 @@ There is also a +:case_sensitive+ option that you can use to define whether the class Person < ActiveRecord::Base - validates :name, :uniqueness => true, :case_sensitive => false + validates :name, :uniqueness => { :case_sensitive => false } end From e89a25370529cb5dcf507f71675e6dd5aa6ec188 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 8 Jun 2011 04:53:09 +0530 Subject: [PATCH 03/14] minor fixes from 5acf76d --- railties/guides/source/configuring.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index da951a0833..c53fa3c3f2 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -366,12 +366,12 @@ There are a number of settings available on +config.action_mailer+: * +config.action_mailer.observers+ registers observers which will be notified when mail is delivered. -config.active_record.observers = ["MailObserver"] +config.action_mailer.observers = ["MailObserver"] * +config.action_mailer.interceptors+ registers interceptors which will be called before mail is sent. -config.active_record.interceptors = ["MailInterceptor"] +config.action_mailer.interceptors = ["MailInterceptor"] h4. Configuring Active Resource From 18d84e50a209bfb54bdd4621bfa3a9ec62afeac8 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 8 Jun 2011 05:06:58 +0530 Subject: [PATCH 04/14] use git: rather than https: in git remote urls; else, github asks for passwords everytime we push --- railties/guides/source/contributing_to_ruby_on_rails.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile index 2ce8ddc702..564fe56603 100644 --- a/railties/guides/source/contributing_to_ruby_on_rails.textile +++ b/railties/guides/source/contributing_to_ruby_on_rails.textile @@ -350,7 +350,7 @@ Navigate to the Rails "GitHub repository":https://github.com/rails/rails and pre Add the new remote to your local repository on your local machine: -$ git remote add mine https://@github.com//rails.git +$ git remote add mine git@github.com:/rails.git Push to your remote: From 5c53754f330219bd32d5793e71f516fba62f32bf Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 8 Jun 2011 06:47:22 +0530 Subject: [PATCH 05/14] fix generators guide url --- railties/guides/source/command_line.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/guides/source/command_line.textile b/railties/guides/source/command_line.textile index 5fe9ad101b..2fe5be43b1 100644 --- a/railties/guides/source/command_line.textile +++ b/railties/guides/source/command_line.textile @@ -5,7 +5,7 @@ Rails comes with every command line tool you'll need to * Create a Rails application * Generate models, controllers, database migrations, and unit tests * Start a development server -* Mess with objects through an interactive shell +* Experiment with objects through an interactive shell * Profile and benchmark your new creation endprologue. @@ -507,7 +507,7 @@ $ rails server mongrel h4. The Rails Generation: Generators -INFO: For a good rundown on generators, see "Understanding Generators":http://wiki.rubyonrails.org/rails/pages/UnderstandingGenerators. A lot of its material is presented here. +INFO: For a good rundown on generators, see "Understanding Generators":generators.html. A lot of its material is presented here. Generators are code that generates code. Let's experiment by building one. Our generator will generate a text file. From def4a538cc56760365d1fc0840dc33c09def0db8 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 8 Jun 2011 15:01:19 +0530 Subject: [PATCH 06/14] remove generators section from command line guide in favor of the separate generator guide --- railties/guides/source/command_line.textile | 94 --------------------- 1 file changed, 94 deletions(-) diff --git a/railties/guides/source/command_line.textile b/railties/guides/source/command_line.textile index 2fe5be43b1..026c15feba 100644 --- a/railties/guides/source/command_line.textile +++ b/railties/guides/source/command_line.textile @@ -504,97 +504,3 @@ $ rails server mongrel => Rails 3.1.0 application starting on http://0.0.0.0:3000 ... - -h4. The Rails Generation: Generators - -INFO: For a good rundown on generators, see "Understanding Generators":generators.html. A lot of its material is presented here. - -Generators are code that generates code. Let's experiment by building one. Our generator will generate a text file. - -The Rails generator by default looks in these places for available generators, where Rails.root is the root of your Rails application, like /home/foobar/commandsapp: - -* Rails.root/lib/generators -* Rails.root/vendor/generators -* Inside any plugin with a directory like "generators" or "rails_generators" -* ~/.rails/generators -* Inside any Gem you have installed with a name ending in "_generator" -* Inside any Gem installed with a "rails_generators" path, and a file ending in "_generator.rb" -* Finally, the builtin Rails generators (controller, model, mailer, etc.) - -Let's try the fourth option (in our home directory), which will be easy to clean up later: - - -$ mkdir -p ~/.rails/generators/tutorial_test/templates -$ touch ~/.rails/generators/tutorial_test/templates/tutorial.erb -$ touch ~/.rails/generators/tutorial_test/tutorial_test_generator.rb - - -We'll fill +tutorial_test_generator.rb+ out with: - - -class TutorialTestGenerator < Rails::Generator::Base - def initialize(*runtime_args) - super(*runtime_args) - @tut_args = runtime_args - end - - def manifest - record do |m| - m.directory "public" - m.template "tutorial.erb", File.join("public", "tutorial.txt"), - :assigns => { :args => @tut_args } - end - end -end - - -We take whatever args are supplied, save them to an instance variable, and literally copying from the Rails source, implement a +manifest+ method, which calls +record+ with a block, and we: - -* Check there's a *public* directory. You bet there is. -* Run the ERB template called "tutorial.erb". -* Save it into "Rails.root/public/tutorial.txt". -* Pass in the arguments we saved through the +:assigns+ parameter. - -Next we'll build the template: - - -$ cat ~/.rails/generators/tutorial_test/templates/tutorial.erb -I'm a template! - -I got assigned some args: -<%= require 'pp'; PP.pp(args, "") %> - - -Then we'll make sure it got included in the list of available generators: - - -$ rails generate -... -... -Installed Generators - User: tutorial_test - - -SWEET! Now let's generate some text, yeah! - - -$ rails generate tutorial_test arg1 arg2 arg3 - exists public - create public/tutorial.txt - - -And the result: - - -$ cat public/tutorial.txt -I'm a template! - -I got assigned some args: -[["arg1", "arg2", "arg3"], - {:collision=>:ask, - :quiet=>false, - :generator=>"tutorial_test", - :command=>:create}] - - -Tada! From 3dacc8527882689d3ddc2b787de3c71e927400cc Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 8 Jun 2011 19:42:18 +0530 Subject: [PATCH 07/14] minor corrections in configuring guide --- railties/guides/source/configuring.textile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index c53fa3c3f2..a4cc62c117 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -220,21 +220,21 @@ h4. Configuring Active Record * +config.active_record.table_name_suffix+ lets you set a global string to be appended to table names. If you set this to +_northwest+, then the Customer class will look for +customers_northwest+ as its table. The default is an empty string. -* +config.active_record.pluralize_table_names+ specifies whether Rails will look for singular or plural table names in the database. If set to +true+ (the default), then the Customer class will use the +customers+ table. If set to +false+, then the Customer class will use the +customer+ table. +* +config.active_record.pluralize_table_names+ specifies whether Rails will look for singular or plural table names in the database. If set to true (the default), then the Customer class will use the +customers+ table. If set to false, then the Customer class will use the +customer+ table. * +config.active_record.default_timezone+ determines whether to use +Time.local+ (if set to +:local+) or +Time.utc+ (if set to +:utc+) when pulling dates and times from the database. The default is +:utc+ for Rails, although Active Record defaults to +:local+ when used outside of Rails. * +config.active_record.schema_format+ controls the format for dumping the database schema to a file. The options are +:ruby+ (the default) for a database-independent version that depends on migrations, or +:sql+ for a set of (potentially database-dependent) SQL statements. -* +config.active_record.timestamped_migrations+ controls whether migrations are numbered with serial integers or with timestamps. The default is +true+, to use timestamps, which are preferred if there are multiple developers working on the same application. +* +config.active_record.timestamped_migrations+ controls whether migrations are numbered with serial integers or with timestamps. The default is true, to use timestamps, which are preferred if there are multiple developers working on the same application. -* +config.active_record.lock_optimistically+ controls whether Active Record will use optimistic locking. By default this is +true+. +* +config.active_record.lock_optimistically+ controls whether Active Record will use optimistic locking and is true by default. * +config.active_record.whitelist_attributes+ will create an empty whitelist of attributes available for mass-assignment security for all models in your app. The MySQL adapter adds one additional configuration option: -* +ActiveRecord::ConnectionAdapters::MysqlAdapter.emulate_booleans+ controls whether Active Record will consider all +tinyint(1)+ columns in a MySQL database to be booleans. By default this is +true+. +* +ActiveRecord::ConnectionAdapters::MysqlAdapter.emulate_booleans+ controls whether Active Record will consider all +tinyint(1)+ columns in a MySQL database to be booleans and is true by default. The schema dumper adds one additional configuration option: @@ -260,7 +260,7 @@ h4. Configuring Action Controller * +config.action_controller.request_forgery_protection_token+ sets the token parameter name for RequestForgery. Calling +protect_from_forgery+ sets it to +:authenticity_token+ by default. -* +config.action_controller.allow_forgery_protection+ enables or disables CSRF protection. By default this is +false+ in test mode and +true+ in all other modes. +* +config.action_controller.allow_forgery_protection+ enables or disables CSRF protection. By default this is false in test mode and true in all other modes. * +config.action_controller.relative_url_root+ can be used to tell Rails that you are deploying to a subdirectory. The default is +ENV['RAILS_RELATIVE_URL_ROOT']+. @@ -350,11 +350,11 @@ There are a number of settings available on +config.action_mailer+: ** +:location+ - The location of the sendmail executable. Defaults to +/usr/sbin/sendmail+. ** +:arguments+ - The command line arguments. Defaults to +-i -t+. -* +config.action_mailer.raise_delivery_errors+ specifies whether to raise an error if email delivery cannot be completed. It defaults to +true+. +* +config.action_mailer.raise_delivery_errors+ specifies whether to raise an error if email delivery cannot be completed. It defaults to true. * +config.action_mailer.delivery_method+ defines the delivery method. The allowed values are +:smtp+ (default), +:sendmail+, and +:test+. -* +config.action_mailer.perform_deliveries+ specifies whether mail will actually be delivered. By default this is +true+; it can be convenient to set it to +false+ for testing. +* +config.action_mailer.perform_deliveries+ specifies whether mail will actually be delivered and is true by default. It can be convenient to set it to false for testing. * +config.action_mailer.default+ configures Action Mailer defaults. These default to: @@ -478,13 +478,13 @@ Serves as a placeholder so that +:load_environment_config+ can be defined to run *+set_clear_dependencies_hook+* Provides a hook for +active_record.set_dispatch_hooks+ to use, which will run before this initializer. This initializer -- which runs only if +cache_classes+ is set to +false+ -- uses +ActionDispatch::Callbacks.after+ to remove the constants which have been referenced during the request from the object space so that they will be reloaded during the following request. -*+initialize_dependency_mechanism+* If +config.cache_classes+ is set to +true+, configures +ActiveSupport::Dependencies.mechanism+ to +require+ dependencies rather than +load+ them. +*+initialize_dependency_mechanism+* If +config.cache_classes+ is true, configures +ActiveSupport::Dependencies.mechanism+ to +require+ dependencies rather than +load+ them. *+bootstrap_hook+* Runs all configured +before_initialize+ blocks. *+i18n.callbacks+* In the development environment, sets up a +to_prepare+ callback which will call +I18n.reload!+ if any of the locales have changed since the last request. In production mode this callback will only run on the first request. -*+active_support.initialize_whiny_nils+* Requires +active_support/whiny_nil+ if +config.whiny_nils+ is set to +true+. This file will output errors such as: +*+active_support.initialize_whiny_nils+* Requires +active_support/whiny_nil+ if +config.whiny_nils+ is true. This file will output errors such as: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id @@ -568,13 +568,13 @@ The error occurred while evaluating nil.each *+build_middleware_stack+* Builds the middleware stack for the application, returning an object which has a +call+ method which takes a Rack environment object for the request. -*+eager_load!+* If +config.cache_classes+ is +true+, runs the +config.before_eager_load+ hooks and then calls +eager_load!+ which will load all the Ruby files from +config.eager_load_paths+. +*+eager_load!+* If +config.cache_classes+ is true, runs the +config.before_eager_load+ hooks and then calls +eager_load!+ which will load all the Ruby files from +config.eager_load_paths+. *+finisher_hook+* Provides a hook for after the initialization of process of the application is complete, as well as running all the +config.after_initialize+ blocks for the application, railties and engines. *+set_routes_reloader+* Configures Action Dispatch to reload the routes file using +ActionDispatch::Callbacks.to_prepare+. -*+disable_dependency_loading+* Disables the automatic dependency loading if the +config.cache_classes+ is set to +true+ and +config.dependency_loading+ is set to +false+. +*+disable_dependency_loading+* Disables the automatic dependency loading if the +config.cache_classes+ is set to true and +config.dependency_loading+ is set to false. h3. Changelog From 266b1bd9b4acc01cace6ea7cea3e9c29dc4e0e0c Mon Sep 17 00:00:00 2001 From: Bratish Goswami Date: Wed, 8 Jun 2011 22:47:25 +0530 Subject: [PATCH 08/14] =?UTF-8?q?Added=20acronym=20and=20reference=20link?= =?UTF-8?q?=20for=20Model=E2=80=93view=E2=80=93controller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 5abc6f927c..7e2d7850c8 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,7 +1,7 @@ == Welcome to Rails Rails is a web-application framework that includes everything needed to create -database-backed web applications according to the Model-View-Controller pattern. +database-backed web applications according to the {Model-View-Controller (MVC)}[http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller] pattern. Understanding the MVC pattern is key to understanding Rails. MVC divides your application into three layers, each with a specific responsibility. From fe2482e50b1eebc12025d4c39c94e33dca8e95a8 Mon Sep 17 00:00:00 2001 From: Mohammad Typaldos Date: Wed, 8 Jun 2011 18:50:55 -0400 Subject: [PATCH 09/14] require_tree is pretty simple --- railties/guides/source/asset_pipeline.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index 5d0dfee41c..a8373087d9 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/railties/guides/source/asset_pipeline.textile @@ -32,9 +32,9 @@ Sprockets, the rails tie that powers the asset pipeline, provides three directiv The require directive loads a file with the supplied basename from the following paths: app/assets/*, lib/assets/*, vendor/assets/*, as well as any of your gem's asset files. -Require tree does... +Using the +require_tree+ directive you can easily include an entire folder of assets. The paths must be relative, so begin them with either a forward slash or dots. For example to include a folder in the same directory I would do +require_tree ./folder_name+ -Require self does... +Require self does... something h4. Stacking Preprocessors From 4f9e2425216653649d4b4b6d73eeca3c1f9f312d Mon Sep 17 00:00:00 2001 From: Ben Orenstein Date: Wed, 8 Jun 2011 23:20:13 -0400 Subject: [PATCH 10/14] Describe the user name 'variable' in a way that doesn't confuse the textile parser. --- railties/guides/source/contributing_to_ruby_on_rails.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile index 564fe56603..e6ec061c9a 100644 --- a/railties/guides/source/contributing_to_ruby_on_rails.textile +++ b/railties/guides/source/contributing_to_ruby_on_rails.textile @@ -361,7 +361,7 @@ $ git push mine my_new_branch h4. Issue a Pull Request -Navigate to the Rails repository you just pushed to (e.g. https://github.com//rails) and press "Pull Request" in the upper right hand corner. +Navigate to the Rails repository you just pushed to (e.g. https://github.com/your-user-name/rails) and press "Pull Request" in the upper right hand corner. Write your branch name in branch field (is filled with master by default) and press "Update Commit Range" From 45a5201b8697e3af13450e2672faf2daae5e5756 Mon Sep 17 00:00:00 2001 From: Mohammad Typaldos Date: Thu, 9 Jun 2011 03:57:55 -0400 Subject: [PATCH 11/14] Match tone already established --- railties/guides/source/asset_pipeline.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index a8373087d9..c12bc3d1dc 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/railties/guides/source/asset_pipeline.textile @@ -32,7 +32,7 @@ Sprockets, the rails tie that powers the asset pipeline, provides three directiv The require directive loads a file with the supplied basename from the following paths: app/assets/*, lib/assets/*, vendor/assets/*, as well as any of your gem's asset files. -Using the +require_tree+ directive you can easily include an entire folder of assets. The paths must be relative, so begin them with either a forward slash or dots. For example to include a folder in the same directory I would do +require_tree ./folder_name+ +Using the +require_tree+ directive you can easily include an entire folder of assets. The paths must be relative, so begin them with either a forward slash or dots. For example to include a folder in the same directory you would do +require_tree ./folder_name+ Require self does... something From 1395b30803527bccd1f5c248092b54424176eca8 Mon Sep 17 00:00:00 2001 From: John Hinnegan Date: Thu, 9 Jun 2011 10:22:44 -0700 Subject: [PATCH 12/14] update palmist link on performance_testing --- railties/guides/source/performance_testing.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/performance_testing.textile b/railties/guides/source/performance_testing.textile index 83db7eee59..fe0915bfea 100644 --- a/railties/guides/source/performance_testing.textile +++ b/railties/guides/source/performance_testing.textile @@ -573,7 +573,7 @@ h3. Useful Links h4. Rails Plugins and Gems * "Rails Analyzer":http://rails-analyzer.rubyforge.org -* "Palmist":http://www.flyingmachinestudios.com/projects/ +* "Palmist":http://www.flyingmachinestudios.com/programming/announcing-palmist * "Rails Footnotes":https://github.com/josevalim/rails-footnotes/tree/master * "Query Reviewer":https://github.com/dsboulder/query_reviewer/tree/master From 262a42b12ec188c14839d9b352ba545058221f4f Mon Sep 17 00:00:00 2001 From: ganesh Date: Fri, 10 Jun 2011 15:53:55 +0530 Subject: [PATCH 13/14] shallow_path example updated --- actionpack/lib/action_dispatch/routing/mapper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index ec76d1da1e..6d6bde1449 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1102,9 +1102,9 @@ module ActionDispatch # # The +comments+ resource here will have the following routes generated for it: # - # post_comments GET /sekret/posts/:post_id/comments(.:format) - # post_comments POST /sekret/posts/:post_id/comments(.:format) - # new_post_comment GET /sekret/posts/:post_id/comments/new(.:format) + # post_comments GET /posts/:post_id/comments(.:format) + # post_comments POST /posts/:post_id/comments(.:format) + # new_post_comment GET /posts/:post_id/comments/new(.:format) # edit_comment GET /sekret/comments/:id/edit(.:format) # comment GET /sekret/comments/:id(.:format) # comment PUT /sekret/comments/:id(.:format) From 029290f3def838c5293929d5bc42d3b6e5662d32 Mon Sep 17 00:00:00 2001 From: thoefer Date: Sat, 11 Jun 2011 00:52:11 +0200 Subject: [PATCH 14/14] Fixed minor typo: 'Arraw' to 'Array' --- activesupport/lib/active_support/core_ext/array/wrap.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/core_ext/array/wrap.rb b/activesupport/lib/active_support/core_ext/array/wrap.rb index 7fabae3138..f420270dc4 100644 --- a/activesupport/lib/active_support/core_ext/array/wrap.rb +++ b/activesupport/lib/active_support/core_ext/array/wrap.rb @@ -14,7 +14,7 @@ class Array # This method is similar in purpose to Kernel#Array, but there are some differences: # # * If the argument responds to +to_ary+ the method is invoked. Kernel#Array - # moves on to try +to_a+ if the returned value is +nil+, but Arraw.wrap returns + # moves on to try +to_a+ if the returned value is +nil+, but Array.wrap returns # such a +nil+ right away. # * If the returned value from +to_ary+ is neither +nil+ nor an +Array+ object, Kernel#Array # raises an exception, while Array.wrap does not, it just returns the value.