aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-12-15 16:39:04 +1000
committerRyan Bigg <radarlistener@gmail.com>2010-12-17 16:24:47 +1000
commit5e0daa0bce83cb01c3db43f2fbcd3d16b14f6eb3 (patch)
treeeff8373bfd0d19d5ebd42d84b9d7372367b218e5
parenta3fbbb626fb8618162d39a55aeb5383406085e6c (diff)
downloadrails-5e0daa0bce83cb01c3db43f2fbcd3d16b14f6eb3.tar.gz
rails-5e0daa0bce83cb01c3db43f2fbcd3d16b14f6eb3.tar.bz2
rails-5e0daa0bce83cb01c3db43f2fbcd3d16b14f6eb3.zip
init guide: Cover ruby version checker and kernel reporting and logger coreext
-rw-r--r--railties/guides/source/initialization.textile25
1 files changed, 25 insertions, 0 deletions
diff --git a/railties/guides/source/initialization.textile b/railties/guides/source/initialization.textile
index 72e10191f9..f42a40e593 100644
--- a/railties/guides/source/initialization.textile
+++ b/railties/guides/source/initialization.textile
@@ -486,6 +486,31 @@ This file is responsible for the initial definition of the +Rails+ module and, r
However, before all that takes place the +rails/ruby_version_check+ file is required first.
+h4. +railties/lib/rails/ruby_version_check.rb+
+
+This file simply checks if the Ruby version is less than 1.8.7 or is 1.9.1 and raises an error if that is the case. Rails 3 simply will not run on earlier versions of Ruby than 1.8.7 or 1.9.1.
+
+NOTE: You should always endeavour to run the latest version of Ruby with your Rails applications. The benefits are many, including security fixes and the like, and very often there is a speed increase associated with it. The caveat is that you could have code that potentially breaks on the latest version, which should be fixed to work on the latest version rather than kept around as an excuse not to upgrade.
+
+h4. +active_support/core_ext/kernel/reporting.rb+
+
+This is the first of the many Active Support core extensions that come with Rails. This one in particular defines methods in the +Kernel+ module which is mixed in to the +Object+ class so the methods are available on +main+ and can therefore be called like this:
+
+<ruby>
+ silence_warnings do
+ # some code
+ end
+</ruby>
+
+These methods can be used to silence STDERR responses and the +silence_stream+ allows you to also silence other streams. Additionally, this mixin allows you to suppress exceptions and capture streams. For more information see the "Silencing Warnings, Streams, and Exceptions":http://guides.rubyonrails.org/active_support_core_extensions.html#silencing-warnings-streams-and-exceptions section from the Active Support Core Extensions Guide.
+
+h4. +active_support/core_ext/logger.rb+
+
+The next file that is required is another Active Support core extension, this time to the +Logger+ class. This begins by defining the +around_[level]+ helpers for the +Logger+ class as well as other methods such as a +datetime_format+ getter and setter for the +formatter+ object tied to a +Logger+ object.
+
+For more information see the "Extensions to Logger":http://guides.rubyonrails.org/active_support_core_extensions.html#extensions-to-logger section from the Active Support Core Extensions Guide.
+
+