aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-07-25 16:03:58 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-07-25 16:03:58 +0100
commite033b5d037c303a34e0c5aec2b38ec6270f00f86 (patch)
tree7c69e6ef81028d0c1978d0b1dcea14893a146554 /activesupport
parent0c68d23f19010379a9320690ca17a26743c8f071 (diff)
downloadrails-e033b5d037c303a34e0c5aec2b38ec6270f00f86.tar.gz
rails-e033b5d037c303a34e0c5aec2b38ec6270f00f86.tar.bz2
rails-e033b5d037c303a34e0c5aec2b38ec6270f00f86.zip
Merge docrails
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/buffered_logger.rb4
-rw-r--r--activesupport/lib/active_support/cache/mem_cache_store.rb6
-rw-r--r--activesupport/lib/active_support/callbacks.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/array/conversions.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/enumerable.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/object/duplicable.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/time/marshal_with_utc_flag.rb2
-rw-r--r--activesupport/lib/active_support/inflector.rb6
-rw-r--r--activesupport/lib/active_support/xml_mini/jdom.rb2
-rw-r--r--activesupport/lib/active_support/xml_mini/nokogiri.rb2
-rw-r--r--activesupport/lib/active_support/xml_mini/rexml.rb2
11 files changed, 18 insertions, 14 deletions
diff --git a/activesupport/lib/active_support/buffered_logger.rb b/activesupport/lib/active_support/buffered_logger.rb
index ee66479dde..dfce507b33 100644
--- a/activesupport/lib/active_support/buffered_logger.rb
+++ b/activesupport/lib/active_support/buffered_logger.rb
@@ -68,6 +68,10 @@ module ActiveSupport
message
end
+ # Dynamically add methods such as:
+ # def info
+ # def warn
+ # def debug
for severity in Severity.constants
class_eval <<-EOT, __FILE__, __LINE__ + 1
def #{severity.downcase}(message = nil, progname = nil, &block) # def debug(message = nil, progname = nil, &block)
diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb
index 954d0f5423..96a8000778 100644
--- a/activesupport/lib/active_support/cache/mem_cache_store.rb
+++ b/activesupport/lib/active_support/cache/mem_cache_store.rb
@@ -12,7 +12,7 @@ module ActiveSupport
# and MemCacheStore will load balance between all available servers. If a
# server goes down, then MemCacheStore will ignore it until it goes back
# online.
- # - Time-based expiry support. See #write and the +:expires_in+ option.
+ # - Time-based expiry support. See #write and the <tt>:expires_in</tt> option.
# - Per-request in memory cache for all communication with the MemCache server(s).
class MemCacheStore < Store
module Response # :nodoc:
@@ -64,9 +64,9 @@ module ActiveSupport
# Writes a value to the cache.
#
# Possible options:
- # - +:unless_exist+ - set to true if you don't want to update the cache
+ # - <tt>:unless_exist</tt> - set to true if you don't want to update the cache
# if the key is already set.
- # - +:expires_in+ - the number of seconds that this value may stay in
+ # - <tt>:expires_in</tt> - the number of seconds that this value may stay in
# the cache. See ActiveSupport::Cache::Store#write for an example.
def write(key, value, options = nil)
super
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index f049189b9a..238d1b6804 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -237,7 +237,7 @@ module ActiveSupport
# * the result from the callback
# * the object which has the callback
#
- # If the result from the block evaluates to false, the callback chain is stopped.
+ # If the result from the block evaluates to +true+, the callback chain is stopped.
#
# Example:
# class Storage
diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb
index 5f1ce4142f..11846f265c 100644
--- a/activesupport/lib/active_support/core_ext/array/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -12,7 +12,7 @@ class Array
default_two_words_connector = I18n.translate(:'support.array.two_words_connector', :locale => options[:locale])
default_last_word_connector = I18n.translate(:'support.array.last_word_connector', :locale => options[:locale])
- # Try to emulate to_senteces previous to 2.3
+ # Try to emulate to_sentences previous to 2.3
if options.has_key?(:connector) || options.has_key?(:skip_last_comma)
::ActiveSupport::Deprecation.warn(":connector has been deprecated. Use :words_connector instead", caller) if options.has_key? :connector
::ActiveSupport::Deprecation.warn(":skip_last_comma has been deprecated. Use :last_word_connector instead", caller) if options.has_key? :skip_last_comma
diff --git a/activesupport/lib/active_support/core_ext/enumerable.rb b/activesupport/lib/active_support/core_ext/enumerable.rb
index 8309b617ae..434a32b29b 100644
--- a/activesupport/lib/active_support/core_ext/enumerable.rb
+++ b/activesupport/lib/active_support/core_ext/enumerable.rb
@@ -42,7 +42,7 @@ module Enumerable
#
# The latter is a shortcut for:
#
- # payments.inject { |sum, p| sum + p.price }
+ # payments.inject(0) { |sum, p| sum + p.price }
#
# It can also calculate the sum without the use of a block.
#
diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb
index 8f49ddfd9e..1722726ca2 100644
--- a/activesupport/lib/active_support/core_ext/object/duplicable.rb
+++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb
@@ -1,6 +1,6 @@
class Object
# Can you safely .dup this object?
- # False for nil, false, true, symbols, and numbers; true otherwise.
+ # False for nil, false, true, symbols, numbers, and class objects; true otherwise.
def duplicable?
true
end
diff --git a/activesupport/lib/active_support/core_ext/time/marshal_with_utc_flag.rb b/activesupport/lib/active_support/core_ext/time/marshal_with_utc_flag.rb
index a1c8ece1d7..9de8157eb0 100644
--- a/activesupport/lib/active_support/core_ext/time/marshal_with_utc_flag.rb
+++ b/activesupport/lib/active_support/core_ext/time/marshal_with_utc_flag.rb
@@ -1,5 +1,5 @@
# Pre-1.9 versions of Ruby have a bug with marshaling Time instances, where utc instances are
-# unmarshaled in the local zone, instead of utc. We're layering behavior on the _dump and _load
+# unmarshalled in the local zone, instead of utc. We're layering behavior on the _dump and _load
# methods so that utc instances can be flagged on dump, and coerced back to utc on load.
if RUBY_VERSION < '1.9'
class Time
diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb
index 92c1de057b..4ee96b13b4 100644
--- a/activesupport/lib/active_support/inflector.rb
+++ b/activesupport/lib/active_support/inflector.rb
@@ -155,7 +155,7 @@ module ActiveSupport
# Examples:
# "posts".singularize # => "post"
# "octopi".singularize # => "octopus"
- # "sheep".singluarize # => "sheep"
+ # "sheep".singularize # => "sheep"
# "word".singularize # => "word"
# "CamelOctopi".singularize # => "CamelOctopus"
def singularize(word)
@@ -261,9 +261,9 @@ module ActiveSupport
# <%= link_to(@person.name, person_path(@person)) %>
# # => <a href="/person/1-donald-e-knuth">Donald E. Knuth</a>
def parameterize(string, sep = '-')
- # replace accented chars with ther ascii equivalents
+ # replace accented chars with their ascii equivalents
parameterized_string = transliterate(string)
- # Turn unwanted chars into the seperator
+ # Turn unwanted chars into the separator
parameterized_string.gsub!(/[^a-z0-9\-_\+]+/i, sep)
unless sep.blank?
re_sep = Regexp.escape(sep)
diff --git a/activesupport/lib/active_support/xml_mini/jdom.rb b/activesupport/lib/active_support/xml_mini/jdom.rb
index 1cd714d864..5c3d93c4a1 100644
--- a/activesupport/lib/active_support/xml_mini/jdom.rb
+++ b/activesupport/lib/active_support/xml_mini/jdom.rb
@@ -78,7 +78,7 @@ module ActiveSupport
# Merge all the texts of an element into the hash
#
# hash::
- # Hash to add the converted emement to.
+ # Hash to add the converted element to.
# element::
# XML element whose texts are to me merged into the hash
def merge_texts!(hash, element)
diff --git a/activesupport/lib/active_support/xml_mini/nokogiri.rb b/activesupport/lib/active_support/xml_mini/nokogiri.rb
index 622523a1b9..847ab0152b 100644
--- a/activesupport/lib/active_support/xml_mini/nokogiri.rb
+++ b/activesupport/lib/active_support/xml_mini/nokogiri.rb
@@ -59,7 +59,7 @@ module ActiveSupport
memo[name] = child_hash
end
- # Recusively walk children
+ # Recursively walk children
child.children.each { |c|
callback.call(child_hash, child, c, callback)
}
diff --git a/activesupport/lib/active_support/xml_mini/rexml.rb b/activesupport/lib/active_support/xml_mini/rexml.rb
index aa2461535b..aaf4bb6bfd 100644
--- a/activesupport/lib/active_support/xml_mini/rexml.rb
+++ b/activesupport/lib/active_support/xml_mini/rexml.rb
@@ -60,7 +60,7 @@ module ActiveSupport
# Merge all the texts of an element into the hash
#
# hash::
- # Hash to add the converted emement to.
+ # Hash to add the converted element to.
# element::
# XML element whose texts are to me merged into the hash
def merge_texts!(hash, element)