diff options
author | Xavier Noria <fxn@hashref.com> | 2011-03-06 17:52:30 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-03-06 17:52:30 +0100 |
commit | 89d825d02172f7c1ba1211119ea9844206aae9c3 (patch) | |
tree | 4716db6c964db1b81843523932be4b097b9291db /activesupport/lib | |
parent | 5e7ce47fb9ab50858fe067a6eb6c0462c5c5681e (diff) | |
parent | 6ce844a3c1d9c1de4ae54cbe73e0dbd0acbe688a (diff) | |
download | rails-89d825d02172f7c1ba1211119ea9844206aae9c3.tar.gz rails-89d825d02172f7c1ba1211119ea9844206aae9c3.tar.bz2 rails-89d825d02172f7c1ba1211119ea9844206aae9c3.zip |
Merge branch 'master' of git://github.com/lifo/docrails
Diffstat (limited to 'activesupport/lib')
9 files changed, 28 insertions, 13 deletions
diff --git a/activesupport/lib/active_support/backtrace_cleaner.rb b/activesupport/lib/active_support/backtrace_cleaner.rb index 8465bc1e10..0e6bc30fa2 100644 --- a/activesupport/lib/active_support/backtrace_cleaner.rb +++ b/activesupport/lib/active_support/backtrace_cleaner.rb @@ -8,7 +8,7 @@ module ActiveSupport # filter or modify the paths of any lines of the backtrace, you can call BacktraceCleaner#remove_filters! These two methods # will give you a completely untouched backtrace. # - # Example: + # ==== Example: # # bc = BacktraceCleaner.new # bc.add_filter { |line| line.gsub(Rails.root, '') } diff --git a/activesupport/lib/active_support/configurable.rb b/activesupport/lib/active_support/configurable.rb index be19189c04..8c56a21ef7 100644 --- a/activesupport/lib/active_support/configurable.rb +++ b/activesupport/lib/active_support/configurable.rb @@ -64,21 +64,21 @@ module ActiveSupport end # Reads and writes attributes from a configuration <tt>OrderedHash</tt>. - # - # require 'active_support/configurable' - # + # + # require 'active_support/configurable' + # # class User # include ActiveSupport::Configurable - # end + # end # # user = User.new - # + # # user.config.allowed_access = true # user.config.level = 1 # # user.config.allowed_access # => true # user.config.level # => 1 - # + # def config @_config ||= self.class.config.inheritable_copy end diff --git a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb index 01863a162b..63b4ba49e9 100644 --- a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +++ b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb @@ -3,12 +3,23 @@ class Hash # # options = options.reverse_merge(:size => 25, :velocity => 10) # +<<<<<<< HEAD + # The default <tt>:size</tt> and <tt>:velocity</tt> are only set if the +options+ hash passed in doesn't already + # have the respective key. + # + # As contrast, using Ruby's built in <tt>merge</tt> would require writing the following: + # + # def setup(options = {}) + # options = { :size => 25, :velocity => 10 }.merge(options) + # end +======= # is equivalent to # # options = {:size => 25, :velocity => 10}.merge(options) # # This is particularly useful for initializing an options hash # with default values. +>>>>>>> 20768176292cbcb883ab152b4aa9ed8c664771cd def reverse_merge(other_hash) other_hash.merge(self) end diff --git a/activesupport/lib/active_support/core_ext/object/blank.rb b/activesupport/lib/active_support/core_ext/object/blank.rb index d0c1ea8326..7b5832b51a 100644 --- a/activesupport/lib/active_support/core_ext/object/blank.rb +++ b/activesupport/lib/active_support/core_ext/object/blank.rb @@ -13,7 +13,11 @@ class Object respond_to?(:empty?) ? empty? : !self end +<<<<<<< HEAD + # An object is present if it's not #blank?. +======= # An object is present if it's not <tt>blank?</tt>. +>>>>>>> 20768176292cbcb883ab152b4aa9ed8c664771cd def present? !blank? end diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index 6a344867ee..79a0de7940 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -1,7 +1,7 @@ require 'active_support/core_ext/hash/keys' # This class has dubious semantics and we only have it so that -# people can write params[:key] instead of params['key'] +# people can write <tt>params[:key]</tt> instead of <tt>params['key']</tt> # and they get the same value for both keys. module ActiveSupport @@ -109,7 +109,7 @@ module ActiveSupport end # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second. - # This overloaded definition prevents returning a regular hash, if reverse_merge is called on a HashWithDifferentAccess. + # This overloaded definition prevents returning a regular hash, if reverse_merge is called on a <tt>HashWithDifferentAccess</tt>. def reverse_merge(other_hash) super self.class.new_from_hash_copying_default(other_hash) end diff --git a/activesupport/lib/active_support/i18n_railtie.rb b/activesupport/lib/active_support/i18n_railtie.rb index 4a9ee5a769..a25e951080 100644 --- a/activesupport/lib/active_support/i18n_railtie.rb +++ b/activesupport/lib/active_support/i18n_railtie.rb @@ -14,7 +14,7 @@ module I18n @reloader ||= ActiveSupport::FileUpdateChecker.new([]){ I18n.reload! } end - # Add I18n::Railtie.reloader to ActionDispatch callbacks. Since, at this + # Add <tt>I18n::Railtie.reloader</tt> to ActionDispatch callbacks. Since, at this # point, no path was added to the reloader, I18n.reload! is not triggered # on to_prepare callbacks. This will only happen on the config.after_initialize # callback below. diff --git a/activesupport/lib/active_support/log_subscriber.rb b/activesupport/lib/active_support/log_subscriber.rb index df335af841..10675edac5 100644 --- a/activesupport/lib/active_support/log_subscriber.rb +++ b/activesupport/lib/active_support/log_subscriber.rb @@ -21,7 +21,7 @@ module ActiveSupport # ActiveRecord::LogSubscriber.attach_to :active_record # # Since we need to know all instance methods before attaching the log subscriber, - # the line above should be called after your ActiveRecord::LogSubscriber definition. + # the line above should be called after your <tt>ActiveRecord::LogSubscriber</tt> definition. # # After configured, whenever a "sql.active_record" notification is published, # it will properly dispatch the event (ActiveSupport::Notifications::Event) to diff --git a/activesupport/lib/active_support/message_encryptor.rb b/activesupport/lib/active_support/message_encryptor.rb index d21f90f8b7..4f7cd12d48 100644 --- a/activesupport/lib/active_support/message_encryptor.rb +++ b/activesupport/lib/active_support/message_encryptor.rb @@ -7,7 +7,7 @@ module ActiveSupport # # The cipher text and initialization vector are base64 encoded and returned to you. # - # This can be used in situations similar to the MessageVerifier, but where you don't + # This can be used in situations similar to the <tt>MessageVerifier</tt>, but where you don't # want users to be able to determine the value of the payload. class MessageEncryptor class InvalidMessage < StandardError; end diff --git a/activesupport/lib/active_support/message_verifier.rb b/activesupport/lib/active_support/message_verifier.rb index 9a4468f73c..8f3946325a 100644 --- a/activesupport/lib/active_support/message_verifier.rb +++ b/activesupport/lib/active_support/message_verifier.rb @@ -2,7 +2,7 @@ require 'active_support/base64' require 'active_support/core_ext/object/blank' module ActiveSupport - # MessageVerifier makes it easy to generate and verify messages which are signed + # +MessageVerifier+ makes it easy to generate and verify messages which are signed # to prevent tampering. # # This is useful for cases like remember-me tokens and auto-unsubscribe links where the |