aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/string/unicode.rb10
-rw-r--r--activesupport/lib/active_support/core_ext/time/conversions.rb2
-rw-r--r--activesupport/lib/active_support/inflector.rb4
-rw-r--r--activesupport/lib/active_support/multibyte/chars.rb2
-rw-r--r--activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb18
5 files changed, 17 insertions, 19 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/unicode.rb b/activesupport/lib/active_support/core_ext/string/unicode.rb
index ba16d4d866..5e20534d1d 100644
--- a/activesupport/lib/active_support/core_ext/string/unicode.rb
+++ b/activesupport/lib/active_support/core_ext/string/unicode.rb
@@ -17,17 +17,17 @@ module ActiveSupport #:nodoc:
# string overrides can also be called through the +chars+ proxy.
#
# name = 'Claus Müller'
- # name.reverse #=> "rell??M sualC"
- # name.length #=> 13
+ # name.reverse # => "rell??M sualC"
+ # name.length # => 13
#
- # name.chars.reverse.to_s #=> "rellüM sualC"
- # name.chars.length #=> 12
+ # name.chars.reverse.to_s # => "rellüM sualC"
+ # name.chars.length # => 12
#
#
# All the methods on the chars proxy which normally return a string will return a Chars object. This allows
# method chaining on the result of any of these methods.
#
- # name.chars.reverse.length #=> 12
+ # name.chars.reverse.length # => 12
#
# The Char object tries to be as interchangeable with String objects as possible: sorting and comparing between
# String and Char work like expected. The bang! methods change the internal string representation in the Chars
diff --git a/activesupport/lib/active_support/core_ext/time/conversions.rb b/activesupport/lib/active_support/core_ext/time/conversions.rb
index edca5b8a98..9054008309 100644
--- a/activesupport/lib/active_support/core_ext/time/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/time/conversions.rb
@@ -59,7 +59,7 @@ module ActiveSupport #:nodoc:
# Converts a Time object to a Date, dropping hour, minute, and second precision.
#
# my_time = Time.now # => Mon Nov 12 22:59:51 -0500 2007
- # my_time.to_date #=> Mon, 12 Nov 2007
+ # my_time.to_date # => Mon, 12 Nov 2007
#
# your_time = Time.parse("1/13/2009 1:13:03 P.M.") # => Tue Jan 13 13:13:03 -0500 2009
# your_time.to_date # => Tue, 13 Jan 2009
diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb
index d319d58a85..a4fd619317 100644
--- a/activesupport/lib/active_support/inflector.rb
+++ b/activesupport/lib/active_support/inflector.rb
@@ -172,8 +172,8 @@ module Inflector
# +titleize+ is also aliased as as +titlecase+.
#
# Examples:
- # "man from the boondocks".titleize #=> "Man From The Boondocks"
- # "x-men: the last stand".titleize #=> "X Men: The Last Stand"
+ # "man from the boondocks".titleize # => "Man From The Boondocks"
+ # "x-men: the last stand".titleize # => "X Men: The Last Stand"
def titleize(word)
humanize(underscore(word)).gsub(/\b('?[a-z])/) { $1.capitalize }
end
diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb
index 65114415eb..ee716de39e 100644
--- a/activesupport/lib/active_support/multibyte/chars.rb
+++ b/activesupport/lib/active_support/multibyte/chars.rb
@@ -10,7 +10,7 @@ module ActiveSupport::Multibyte #:nodoc:
# String methods are proxied through the Chars object, and can be accessed through the +chars+ method. Methods
# which would normally return a String object now return a Chars object so methods can be chained.
#
- # "The Perfect String ".chars.downcase.strip.normalize #=> "the perfect string"
+ # "The Perfect String ".chars.downcase.strip.normalize # => "the perfect string"
#
# Chars objects are perfectly interchangeable with String objects as long as no explicit class checks are made.
# If certain methods do explicitly check the class, call +to_s+ before you pass chars objects to them.
diff --git a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb
index 0166b69ac3..aa9c16f575 100644
--- a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb
+++ b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb
@@ -147,13 +147,11 @@ module ActiveSupport::Multibyte::Handlers #:nodoc:
#
# s = "Müller"
# s.chars[2] = "e" # Replace character with offset 2
- # s
- # #=> "Müeler"
+ # s # => "Müeler"
#
# s = "Müller"
# s.chars[1, 2] = "ö" # Replace 2 characters at character offset 1
- # s
- # #=> "Möler"
+ # s # => "Möler"
def []=(str, *args)
replace_by = args.pop
# Indexed replace with regular expressions already works
@@ -183,10 +181,10 @@ module ActiveSupport::Multibyte::Handlers #:nodoc:
# Example:
#
# "¾ cup".chars.rjust(8).to_s
- # #=> " ¾ cup"
+ # # => " ¾ cup"
#
# "¾ cup".chars.rjust(8, " ").to_s # Use non-breaking whitespace
- # #=> "   ¾ cup"
+ # # => "   ¾ cup"
def rjust(str, integer, padstr=' ')
justify(str, integer, :right, padstr)
end
@@ -196,10 +194,10 @@ module ActiveSupport::Multibyte::Handlers #:nodoc:
# Example:
#
# "¾ cup".chars.rjust(8).to_s
- # #=> "¾ cup "
+ # # => "¾ cup "
#
# "¾ cup".chars.rjust(8, " ").to_s # Use non-breaking whitespace
- # #=> "¾ cup   "
+ # # => "¾ cup   "
def ljust(str, integer, padstr=' ')
justify(str, integer, :left, padstr)
end
@@ -209,10 +207,10 @@ module ActiveSupport::Multibyte::Handlers #:nodoc:
# Example:
#
# "¾ cup".chars.center(8).to_s
- # #=> " ¾ cup "
+ # # => " ¾ cup "
#
# "¾ cup".chars.center(8, " ").to_s # Use non-breaking whitespace
- # #=> " ¾ cup  "
+ # # => " ¾ cup  "
def center(str, integer, padstr=' ')
justify(str, integer, :center, padstr)
end