aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-10-21 18:49:19 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-10-21 18:49:19 +0530
commitf938019da210ea2bfccabdf61424852e8006c741 (patch)
tree7cd316340f230efe5b2d55b7df5a85232e5d5db5 /activesupport
parentcec66e589f69a10ab9d6e4b62dd34ff09e5dc01b (diff)
parente84281398e79e09b637c888860fcefd6f82bf968 (diff)
downloadrails-f938019da210ea2bfccabdf61424852e8006c741.tar.gz
rails-f938019da210ea2bfccabdf61424852e8006c741.tar.bz2
rails-f938019da210ea2bfccabdf61424852e8006c741.zip
Merge branch 'master' of github.com:lifo/docrails
Conflicts: activesupport/lib/active_support/core_ext/hash/slice.rb guides/source/active_support_core_extensions.md
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/array/wrap.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/hash/slice.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/module/deprecation.rb8
-rw-r--r--activesupport/lib/active_support/core_ext/time/calculations.rb2
5 files changed, 8 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/wrap.rb b/activesupport/lib/active_support/core_ext/array/wrap.rb
index 7bf28b2f27..ffaf6ef024 100644
--- a/activesupport/lib/active_support/core_ext/array/wrap.rb
+++ b/activesupport/lib/active_support/core_ext/array/wrap.rb
@@ -23,7 +23,7 @@ class Array
# The last point is particularly worth comparing for some enumerables:
#
# Array(foo: :bar) # => [[:foo, :bar]]
- # Array.wrap(foo: :bar) # => [{:foo => :bar}]
+ # Array.wrap(foo: :bar) # => [{foo: :bar}]
#
# There's also a related idiom that uses the splat operator:
#
diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb
index 828f03ad62..f5e3a9b842 100644
--- a/activesupport/lib/active_support/core_ext/hash/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -131,7 +131,7 @@ class Hash
else
xml_value = Hash[value.map { |k,v| [k, typecast_xml_value(v)] }]
- # Turn { :files => { :file => #<StringIO> } } into { :files => #<StringIO> } so it is compatible with
+ # Turn { files: { file: #<StringIO> } } into { files: #<StringIO> } so it is compatible with
# how multipart uploaded files from HTML appear
xml_value['file'].is_a?(StringIO) ? xml_value['file'] : xml_value
end
diff --git a/activesupport/lib/active_support/core_ext/hash/slice.rb b/activesupport/lib/active_support/core_ext/hash/slice.rb
index de09f26f3d..a92c5968ed 100644
--- a/activesupport/lib/active_support/core_ext/hash/slice.rb
+++ b/activesupport/lib/active_support/core_ext/hash/slice.rb
@@ -21,7 +21,7 @@ class Hash
# Returns a hash containing the removed key/value pairs.
#
# { a: 1, b: 2, c: 3, d: 4 }.slice!(:a, :b)
- # # => {:c => 3, :d => 4}
+ # # => {c: 3, d: 4}
def slice!(*keys)
keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true)
omit = slice(*self.keys - keys)
diff --git a/activesupport/lib/active_support/core_ext/module/deprecation.rb b/activesupport/lib/active_support/core_ext/module/deprecation.rb
index 34ec6a3d8f..cc45cee5b8 100644
--- a/activesupport/lib/active_support/core_ext/module/deprecation.rb
+++ b/activesupport/lib/active_support/core_ext/module/deprecation.rb
@@ -2,13 +2,13 @@ require 'active_support/deprecation/method_wrappers'
class Module
# deprecate :foo
- # deprecate :bar => 'message'
- # deprecate :foo, :bar, :baz => 'warning!', :qux => 'gone!'
+ # deprecate bar: 'message'
+ # deprecate :foo, :bar, baz: 'warning!', qux: 'gone!'
#
# You can also use custom deprecator instance:
#
- # deprecate :foo, :deprecator => MyLib::Deprecator.new
- # deprecate :foo, :bar => "warning!", :deprecator => MyLib::Deprecator.new
+ # deprecate :foo, deprecator: MyLib::Deprecator.new
+ # deprecate :foo, bar: "warning!", deprecator: MyLib::Deprecator.new
#
# \Custom deprecators must respond to <tt>deprecation_warning(deprecated_method_name, message, caller_backtrace)</tt>
# method where you can implement your custom warning behavior.
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb
index e3665cd896..931851d40e 100644
--- a/activesupport/lib/active_support/core_ext/time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -135,7 +135,7 @@ class Time
# Returns a new Time representing the start of the day (0:00)
def beginning_of_day
- #(self - seconds_since_midnight).change(:usec => 0)
+ #(self - seconds_since_midnight).change(usec: 0)
change(:hour => 0)
end
alias :midnight :beginning_of_day