From 495722a95687e25114ae75608dd3107ac5d6611b Mon Sep 17 00:00:00 2001 From: Ronak Jangir Date: Wed, 7 Oct 2015 21:07:46 +0530 Subject: =?UTF-8?q?Fixed=20wording=20in=20Assertion=20docs,=20changed=20?= =?UTF-8?q?=E2=80=98Assert=E2=80=99=20->=20=E2=80=98Asserts=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- activesupport/lib/active_support/testing/assertions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/testing/assertions.rb b/activesupport/lib/active_support/testing/assertions.rb index ae8c15d8bf..29305e0082 100644 --- a/activesupport/lib/active_support/testing/assertions.rb +++ b/activesupport/lib/active_support/testing/assertions.rb @@ -3,7 +3,7 @@ require 'active_support/core_ext/object/blank' module ActiveSupport module Testing module Assertions - # Assert that an expression is not truthy. Passes if object is + # Asserts that an expression is not truthy. Passes if object is # +nil+ or +false+. "Truthy" means "considered true in a conditional" # like if foo. # -- cgit v1.2.3 From efbd62f0c5c927a08e860b318b7bb561b2602a98 Mon Sep 17 00:00:00 2001 From: amitkumarsuroliya Date: Sun, 11 Oct 2015 01:43:08 +0530 Subject: Corrected ActiveSupport `time_with_zone` outputs [ci skip] --- activesupport/lib/active_support/time_with_zone.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 3592dcba39..d571bbd51c 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -117,8 +117,8 @@ module ActiveSupport # string if the time zone is already UTC. # # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" - # Time.zone.now.formatted_offset(true) # => "-05:00" - # Time.zone.now.formatted_offset(false) # => "-0500" + # Time.zone.now.formatted_offset(true) # => "-04:00" + # Time.zone.now.formatted_offset(false) # => "-0400" # Time.zone = 'UTC' # => "UTC" # Time.zone.now.formatted_offset(true, "0") # => "0" def formatted_offset(colon = true, alternate_utc_string = nil) @@ -128,14 +128,14 @@ module ActiveSupport # Returns the time zone abbreviation. # # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" - # Time.zone.now.zone # => "EST" + # Time.zone.now.zone # => "EDT" def zone period.zone_identifier.to_s end # Returns a string of the object's date, time, zone and offset from UTC. # - # Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25 EST -05:00" + # Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25 EDT -04:00" def inspect "#{time.strftime('%a, %d %b %Y %H:%M:%S')} #{zone} #{formatted_offset}" end @@ -143,7 +143,7 @@ module ActiveSupport # Returns a string of the object's date and time in the ISO 8601 standard # format. # - # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" + # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-04:00" def xmlschema(fraction_digits = 0) "#{time.strftime(PRECISIONS[fraction_digits.to_i])}#{formatted_offset(true, 'Z'.freeze)}" end @@ -284,8 +284,8 @@ module ActiveSupport # the current object's time and the +other+ time. # # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' - # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28 EST -05:00 - # now - 1000 # => Sun, 02 Nov 2014 01:09:48 EST -05:00 + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28 EDT -04:00 + # now - 1000 # => Sun, 02 Nov 2014 01:09:48 EDT -04:00 # # If subtracting a Duration of variable length (i.e., years, months, days), # move backward from #time, otherwise move backward from #utc, for accuracy -- cgit v1.2.3 From 1d8d3b37c1bc759e0da8c24625ec0ea68c5d6d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Sat, 10 Oct 2015 17:16:58 -0300 Subject: Revert "Corrected ActiveSupport `time_with_zone` outputs [ci skip]" This reverts commit efbd62f0c5c927a08e860b318b7bb561b2602a98. Right now Eastern Time zone is on daylight saving, so the output in the documentation is different but this doesn't mean that it is wrong. Daylight savings only happen in 3 months in a year so it is better to use the normal time zone in the documentation. --- activesupport/lib/active_support/time_with_zone.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index d571bbd51c..3592dcba39 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -117,8 +117,8 @@ module ActiveSupport # string if the time zone is already UTC. # # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" - # Time.zone.now.formatted_offset(true) # => "-04:00" - # Time.zone.now.formatted_offset(false) # => "-0400" + # Time.zone.now.formatted_offset(true) # => "-05:00" + # Time.zone.now.formatted_offset(false) # => "-0500" # Time.zone = 'UTC' # => "UTC" # Time.zone.now.formatted_offset(true, "0") # => "0" def formatted_offset(colon = true, alternate_utc_string = nil) @@ -128,14 +128,14 @@ module ActiveSupport # Returns the time zone abbreviation. # # Time.zone = 'Eastern Time (US & Canada)' # => "Eastern Time (US & Canada)" - # Time.zone.now.zone # => "EDT" + # Time.zone.now.zone # => "EST" def zone period.zone_identifier.to_s end # Returns a string of the object's date, time, zone and offset from UTC. # - # Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25 EDT -04:00" + # Time.zone.now.inspect # => "Thu, 04 Dec 2014 11:00:25 EST -05:00" def inspect "#{time.strftime('%a, %d %b %Y %H:%M:%S')} #{zone} #{formatted_offset}" end @@ -143,7 +143,7 @@ module ActiveSupport # Returns a string of the object's date and time in the ISO 8601 standard # format. # - # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-04:00" + # Time.zone.now.xmlschema # => "2014-12-04T11:02:37-05:00" def xmlschema(fraction_digits = 0) "#{time.strftime(PRECISIONS[fraction_digits.to_i])}#{formatted_offset(true, 'Z'.freeze)}" end @@ -284,8 +284,8 @@ module ActiveSupport # the current object's time and the +other+ time. # # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)' - # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28 EDT -04:00 - # now - 1000 # => Sun, 02 Nov 2014 01:09:48 EDT -04:00 + # now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28 EST -05:00 + # now - 1000 # => Sun, 02 Nov 2014 01:09:48 EST -05:00 # # If subtracting a Duration of variable length (i.e., years, months, days), # move backward from #time, otherwise move backward from #utc, for accuracy -- cgit v1.2.3 From aa37991e436fb4284a16c324ab5115d73784ff38 Mon Sep 17 00:00:00 2001 From: amitkumarsuroliya Date: Sun, 11 Oct 2015 02:40:29 +0530 Subject: Improved `KeyError` messages on bang version, since commit https://github.com/rails/rails/commit/e768c519fb6015e00961702a5165c6dab548a954 bang version produces `KeyError` [ci skip] --- activesupport/lib/active_support/ordered_options.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb index 45864990ce..53a55bd986 100644 --- a/activesupport/lib/active_support/ordered_options.rb +++ b/activesupport/lib/active_support/ordered_options.rb @@ -20,7 +20,7 @@ module ActiveSupport # To raise an exception when the value is blank, append a # bang to the key name, like: # - # h.dog! # => raises KeyError + # h.dog! # => raises KeyError: key not found: :dog # class OrderedOptions < Hash alias_method :_get, :[] # preserve the original #[] method -- cgit v1.2.3 From 05c610df9a2d361a1eae92ffc624f1e5fda474a3 Mon Sep 17 00:00:00 2001 From: amitkumarsuroliya Date: Sun, 11 Oct 2015 07:41:15 +0530 Subject: Fixed `ActiveSupport::NumberHelper` Outputs [ci skip] --- activesupport/lib/active_support/number_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/number_helper.rb b/activesupport/lib/active_support/number_helper.rb index 504f96961a..248521e677 100644 --- a/activesupport/lib/active_support/number_helper.rb +++ b/activesupport/lib/active_support/number_helper.rb @@ -115,8 +115,8 @@ module ActiveSupport # number_to_percentage(100, precision: 0) # => 100% # number_to_percentage(1000, delimiter: '.', separator: ',') # => 1.000,000% # number_to_percentage(302.24398923423, precision: 5) # => 302.24399% - # number_to_percentage(1000, locale: :fr) # => 1 000,000% - # number_to_percentage:(1000, precision: nil) # => 1000% + # number_to_percentage(1000, locale: :fr) # => 1000,000% + # number_to_percentage(1000, precision: nil) # => 1000% # number_to_percentage('98a') # => 98a% # number_to_percentage(100, format: '%n %') # => 100.000 % def number_to_percentage(number, options = {}) -- cgit v1.2.3 From 1002bf6127f137f1b749f661ad4443c94a8136c1 Mon Sep 17 00:00:00 2001 From: amitkumarsuroliya Date: Sun, 11 Oct 2015 13:03:57 +0530 Subject: Add missing punctuation mark in `ActiveSupport` docs [ci skip] It improves readability of docs --- activesupport/lib/active_support/dependencies.rb | 6 +++--- activesupport/lib/active_support/gem_version.rb | 2 +- activesupport/lib/active_support/key_generator.rb | 4 ++-- activesupport/lib/active_support/log_subscriber.rb | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 16b726bcba..dc9f97168a 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -25,21 +25,21 @@ module ActiveSupport #:nodoc: # :doc: # Execute the supplied block without interference from any - # concurrent loads + # concurrent loads. def self.run_interlock Dependencies.interlock.running { yield } end # Execute the supplied block while holding an exclusive lock, # preventing any other thread from being inside a #run_interlock - # block at the same time + # block at the same time. def self.load_interlock Dependencies.interlock.loading { yield } end # Execute the supplied block while holding an exclusive lock, # preventing any other thread from being inside a #run_interlock - # block at the same time + # block at the same time. def self.unload_interlock Dependencies.interlock.unloading { yield } end diff --git a/activesupport/lib/active_support/gem_version.rb b/activesupport/lib/active_support/gem_version.rb index 7068f09d87..ece68bbcb6 100644 --- a/activesupport/lib/active_support/gem_version.rb +++ b/activesupport/lib/active_support/gem_version.rb @@ -1,5 +1,5 @@ module ActiveSupport - # Returns the version of the currently loaded Active Support as a Gem::Version + # Returns the version of the currently loaded Active Support as a Gem::Version. def self.gem_version Gem::Version.new VERSION::STRING end diff --git a/activesupport/lib/active_support/key_generator.rb b/activesupport/lib/active_support/key_generator.rb index 6bc3db6ec6..e88b04da3e 100644 --- a/activesupport/lib/active_support/key_generator.rb +++ b/activesupport/lib/active_support/key_generator.rb @@ -2,7 +2,7 @@ require 'concurrent' require 'openssl' module ActiveSupport - # KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2 + # KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2. # It can be used to derive a number of keys for various purposes from a given secret. # This lets Rails applications have a single secure secret, but avoid reusing that # key in multiple incompatible contexts. @@ -24,7 +24,7 @@ module ActiveSupport # CachingKeyGenerator is a wrapper around KeyGenerator which allows users to avoid # re-executing the key generation process when it's called using the same salt and - # key_size + # key_size. class CachingKeyGenerator def initialize(key_generator) @key_generator = key_generator diff --git a/activesupport/lib/active_support/log_subscriber.rb b/activesupport/lib/active_support/log_subscriber.rb index e782cd2d4b..c4f685a4b4 100644 --- a/activesupport/lib/active_support/log_subscriber.rb +++ b/activesupport/lib/active_support/log_subscriber.rb @@ -3,7 +3,7 @@ require 'active_support/core_ext/class/attribute' require 'active_support/subscriber' module ActiveSupport - # ActiveSupport::LogSubscriber is an object set to consume + # ActiveSupport::LogSubscriber is an object set to consume. # ActiveSupport::Notifications with the sole purpose of logging them. # The log subscriber dispatches notifications to a registered object based # on its given namespace. -- cgit v1.2.3 From e9a8b15778adeeda8dfccd2af6ca86b7e6bda575 Mon Sep 17 00:00:00 2001 From: amitkumarsuroliya Date: Sun, 11 Oct 2015 22:44:32 +0530 Subject: Remove wrong period mark in `ActiveSupport::LogSubscriber` docs [ci skip] --- activesupport/lib/active_support/log_subscriber.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/log_subscriber.rb b/activesupport/lib/active_support/log_subscriber.rb index c4f685a4b4..e782cd2d4b 100644 --- a/activesupport/lib/active_support/log_subscriber.rb +++ b/activesupport/lib/active_support/log_subscriber.rb @@ -3,7 +3,7 @@ require 'active_support/core_ext/class/attribute' require 'active_support/subscriber' module ActiveSupport - # ActiveSupport::LogSubscriber is an object set to consume. + # ActiveSupport::LogSubscriber is an object set to consume # ActiveSupport::Notifications with the sole purpose of logging them. # The log subscriber dispatches notifications to a registered object based # on its given namespace. -- cgit v1.2.3