[DRE-commits] [ruby-activesupport-3.2] 01/04: New upstream version 3.2.16
Ondrej Sury
ondrej at moszumanska.debian.org
Sun Dec 15 15:33:53 UTC 2013
This is an automated email from the git hooks/post-receive script.
ondrej pushed a commit to branch master
in repository ruby-activesupport-3.2.
commit 6d4299aca3086d1b6856c69c07a375d3582b345a
Author: Ondřej Surý <ondrej at sury.org>
Date: Wed Dec 4 17:35:03 2013 +0100
New upstream version 3.2.16
---
CHANGELOG.md | 42 +++++++++++++++++++--
checksums.yaml.gz | Bin 271 -> 268 bytes
lib/active_support/cache/file_store.rb | 3 +-
lib/active_support/core_ext/class/attribute.rb | 2 +-
lib/active_support/core_ext/date_time/acts_like.rb | 1 +
lib/active_support/core_ext/time/calculations.rb | 17 +++++++++
lib/active_support/json/encoding.rb | 8 +++-
lib/active_support/log_subscriber.rb | 4 ++
lib/active_support/tagged_logging.rb | 19 +++++++++-
lib/active_support/testing/performance.rb | 2 +-
lib/active_support/testing/performance/jruby.rb | 2 +-
lib/active_support/testing/performance/rubinius.rb | 2 +-
lib/active_support/testing/performance/ruby.rb | 2 +-
lib/active_support/values/time_zone.rb | 22 ++++++++---
lib/active_support/version.rb | 2 +-
metadata.yml | 31 +++++++++------
16 files changed, 129 insertions(+), 30 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ea72f69..29f7db5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,46 @@
-## unreleased ##
+## Rails 3.2.15 (Oct 16, 2013) ##
-* No changes.
+* Fix ActiveSupport::Cache::FileStore#cleanup to no longer rely on missing each_key method.
+
+ *Murray Steele*
+
+* Add respond_to_missing? for TaggedLogging which is best practice when overriding method_missing. This permits
+ wrapping TaggedLogging by another log abstraction such as em-logger.
+
+ *Wolfram Arnold*
+
+
+## Rails 3.2.14 (Jul 22, 2013) ##
+
+* Make `Time.at_with_coercion` retain the second fraction and return local time.
+
+ Fixes #11350
+
+ *Neer Friedman*, *Andrew White*
+
+* Fix `ActiveSupport::TaggedLogging` incorrectly providing program name the same as log message
+ even when block is not provided.
+
+ *Carson Reinke*
+
+* Override `Time.at` to support the passing of Time-like values when called with a single argument.
+
+ *Andrew White*
+
+* Revert the changes on unicode character encoding from `ActiveSupport::JSON.encode`.
+ This was causing a regression where the resulting string is always returning UTF-8.
+ Also it changes the behavior of this method on a stable release.
+ Fixes #9498.
+
+ *Rafael Mendonça França*
+
+* Fix `ActiveSupport::TimeZone.parse` when time is at a local DST jump.
+ Fixes #9678.
+ *Andrew White*
-## Rails 3.2.13 (Feb 17, 2013) ##
+## Rails 3.2.13 (Mar 18, 2013) ##
* Fix DateTime comparison with DateTime::Infinity object.
diff --git a/checksums.yaml.gz b/checksums.yaml.gz
index 3f51d0a..d257f08 100644
Binary files a/checksums.yaml.gz and b/checksums.yaml.gz differ
diff --git a/lib/active_support/cache/file_store.rb b/lib/active_support/cache/file_store.rb
index 9460532..c800365 100644
--- a/lib/active_support/cache/file_store.rb
+++ b/lib/active_support/cache/file_store.rb
@@ -29,7 +29,8 @@ module ActiveSupport
def cleanup(options = nil)
options = merged_options(options)
- each_key(options) do |key|
+ search_dir(cache_path) do |fname|
+ key = file_path_key(fname)
entry = read_entry(key, options)
delete_entry(key, options) if entry && entry.expired?
end
diff --git a/lib/active_support/core_ext/class/attribute.rb b/lib/active_support/core_ext/class/attribute.rb
index 305ed49..cd7877f 100644
--- a/lib/active_support/core_ext/class/attribute.rb
+++ b/lib/active_support/core_ext/class/attribute.rb
@@ -67,7 +67,7 @@ class Class
# object.setting = false # => NoMethodError
def class_attribute(*attrs)
options = attrs.extract_options!
- instance_reader = options.fetch(:instance_reader, true)
+ instance_reader = instance_reader = options.fetch(:instance_reader, true)
instance_writer = options.fetch(:instance_writer, true)
attrs.each do |name|
diff --git a/lib/active_support/core_ext/date_time/acts_like.rb b/lib/active_support/core_ext/date_time/acts_like.rb
index c79745c..8fbbe0d 100644
--- a/lib/active_support/core_ext/date_time/acts_like.rb
+++ b/lib/active_support/core_ext/date_time/acts_like.rb
@@ -1,3 +1,4 @@
+require 'date'
require 'active_support/core_ext/object/acts_like'
class DateTime
diff --git a/lib/active_support/core_ext/time/calculations.rb b/lib/active_support/core_ext/time/calculations.rb
index 9146d82..0383a6a 100644
--- a/lib/active_support/core_ext/time/calculations.rb
+++ b/lib/active_support/core_ext/time/calculations.rb
@@ -45,6 +45,23 @@ class Time
def current
::Time.zone ? ::Time.zone.now : ::Time.now
end
+
+ # Layers additional behavior on Time.at so that ActiveSupport::TimeWithZone and DateTime
+ # instances can be used when called with a single argument
+ def at_with_coercion(*args)
+ return at_without_coercion(*args) if args.size != 1
+
+ # Time.at can be called with a time or numerical value
+ time_or_number = args.first
+
+ if time_or_number.is_a?(ActiveSupport::TimeWithZone) || time_or_number.is_a?(DateTime)
+ at_without_coercion(time_or_number.to_f).getlocal
+ else
+ at_without_coercion(time_or_number)
+ end
+ end
+ alias_method :at_without_coercion, :at
+ alias_method :at, :at_with_coercion
end
# Tells whether the Time object's time lies in the past
diff --git a/lib/active_support/json/encoding.rb b/lib/active_support/json/encoding.rb
index a50e652..bd2f909 100644
--- a/lib/active_support/json/encoding.rb
+++ b/lib/active_support/json/encoding.rb
@@ -122,7 +122,13 @@ module ActiveSupport
if string.respond_to?(:force_encoding)
string = string.encode(::Encoding::UTF_8, :undef => :replace).force_encoding(::Encoding::BINARY)
end
- json = string.gsub(escape_regex) { |s| ESCAPED_CHARS[s] }
+ json = string.
+ gsub(escape_regex) { |s| ESCAPED_CHARS[s] }.
+ gsub(/([\xC0-\xDF][\x80-\xBF]|
+ [\xE0-\xEF][\x80-\xBF]{2}|
+ [\xF0-\xF7][\x80-\xBF]{3})+/nx) { |s|
+ s.unpack("U*").pack("n*").unpack("H*")[0].gsub(/.{4}/n, '\\\\u\&')
+ }
json = %("#{json}")
json.force_encoding(::Encoding::UTF_8) if json.respond_to?(:force_encoding)
json
diff --git a/lib/active_support/log_subscriber.rb b/lib/active_support/log_subscriber.rb
index 6296c1d..ed7c73b 100644
--- a/lib/active_support/log_subscriber.rb
+++ b/lib/active_support/log_subscriber.rb
@@ -118,5 +118,9 @@ module ActiveSupport
bold = bold ? BOLD : ""
"#{bold}#{color}#{text}#{CLEAR}"
end
+
+ def format_duration(duration)
+ "%.1fms" % duration
+ end
end
end
diff --git a/lib/active_support/tagged_logging.rb b/lib/active_support/tagged_logging.rb
index 7e7f7ec..232c367 100644
--- a/lib/active_support/tagged_logging.rb
+++ b/lib/active_support/tagged_logging.rb
@@ -44,7 +44,14 @@ module ActiveSupport
deprecate :silence
def add(severity, message = nil, progname = nil, &block)
- message = (block_given? ? block.call : progname) if message.nil?
+ if message.nil?
+ if block_given?
+ message = block.call
+ else
+ message = progname
+ progname = nil #No instance variable for this like Logger
+ end
+ end
@logger.add(severity, "#{tags_text}#{message}", progname)
end
@@ -65,6 +72,16 @@ module ActiveSupport
@logger.send(method, *args)
end
+ if RUBY_VERSION < '1.9'
+ def respond_to?(*args)
+ super || @logger.respond_to?(*args)
+ end
+ else
+ def respond_to_missing?(*args)
+ @logger.respond_to? *args
+ end
+ end
+
private
def tags_text
tags = current_tags
diff --git a/lib/active_support/testing/performance.rb b/lib/active_support/testing/performance.rb
index dd23f8d..5b74e52 100644
--- a/lib/active_support/testing/performance.rb
+++ b/lib/active_support/testing/performance.rb
@@ -23,7 +23,7 @@ module ActiveSupport
# each implementation should define metrics and freeze the defaults
DEFAULTS =
- if ARGV.include?('--benchmark') # HAX for rake test
+ if ENV["BENCHMARK_TESTS"]
{ :runs => 4,
:output => 'tmp/performance',
:benchmark => true }
diff --git a/lib/active_support/testing/performance/jruby.rb b/lib/active_support/testing/performance/jruby.rb
index b347539..af08f0e 100644
--- a/lib/active_support/testing/performance/jruby.rb
+++ b/lib/active_support/testing/performance/jruby.rb
@@ -6,7 +6,7 @@ module ActiveSupport
module Testing
module Performance
DEFAULTS.merge!(
- if ARGV.include?('--benchmark')
+ if ENV["BENCHMARK_TESTS"]
{:metrics => [:wall_time, :user_time, :memory, :gc_runs, :gc_time]}
else
{ :metrics => [:wall_time],
diff --git a/lib/active_support/testing/performance/rubinius.rb b/lib/active_support/testing/performance/rubinius.rb
index d9ebfbe..baabd9c 100644
--- a/lib/active_support/testing/performance/rubinius.rb
+++ b/lib/active_support/testing/performance/rubinius.rb
@@ -4,7 +4,7 @@ module ActiveSupport
module Testing
module Performance
DEFAULTS.merge!(
- if ARGV.include?('--benchmark')
+ if ENV["BENCHMARK_TESTS"]
{:metrics => [:wall_time, :memory, :objects, :gc_runs, :gc_time]}
else
{ :metrics => [:wall_time],
diff --git a/lib/active_support/testing/performance/ruby.rb b/lib/active_support/testing/performance/ruby.rb
index 50c4852..5aaed2b 100644
--- a/lib/active_support/testing/performance/ruby.rb
+++ b/lib/active_support/testing/performance/ruby.rb
@@ -9,7 +9,7 @@ module ActiveSupport
module Testing
module Performance
DEFAULTS.merge!(
- if ARGV.include?('--benchmark')
+ if ENV["BENCHMARK_TESTS"]
{ :metrics => [:wall_time, :memory, :objects, :gc_runs, :gc_time] }
else
{ :min_percent => 0.01,
diff --git a/lib/active_support/values/time_zone.rb b/lib/active_support/values/time_zone.rb
index c7d8fc2..f935180 100644
--- a/lib/active_support/values/time_zone.rb
+++ b/lib/active_support/values/time_zone.rb
@@ -268,13 +268,23 @@ module ActiveSupport
# Time.zone.now # => Fri, 31 Dec 1999 14:00:00 HST -10:00
# Time.zone.parse('22:30:00') # => Fri, 31 Dec 1999 22:30:00 HST -10:00
def parse(str, now=now)
- date_parts = Date._parse(str)
- return if date_parts.blank?
- time = Time.parse(str, now) rescue DateTime.parse(str)
- if date_parts[:offset].nil?
- ActiveSupport::TimeWithZone.new(nil, self, time)
+ parts = Date._parse(str, false)
+ return if parts.empty?
+
+ time = Time.utc(
+ parts.fetch(:year, now.year),
+ parts.fetch(:mon, now.month),
+ parts.fetch(:mday, now.day),
+ parts.fetch(:hour, 0),
+ parts.fetch(:min, 0),
+ parts.fetch(:sec, 0),
+ parts.fetch(:sec_fraction, 0) * 1000000
+ )
+
+ if parts[:offset]
+ TimeWithZone.new(time - parts[:offset], self)
else
- time.in_time_zone(self)
+ TimeWithZone.new(nil, self, time)
end
end
diff --git a/lib/active_support/version.rb b/lib/active_support/version.rb
index 03b1e51..6ef2d9d 100644
--- a/lib/active_support/version.rb
+++ b/lib/active_support/version.rb
@@ -2,7 +2,7 @@ module ActiveSupport
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
- TINY = 13
+ TINY = 16
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
diff --git a/metadata.yml b/metadata.yml
index 8d9722d..7014211 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,41 +1,47 @@
--- !ruby/object:Gem::Specification
name: activesupport
version: !ruby/object:Gem::Version
- version: 3.2.13
+ version: 3.2.16
platform: ruby
authors:
- David Heinemeier Hansson
autorequire:
bindir: bin
cert_chain: []
-date: 2013-03-18 00:00:00.000000000 Z
+date: 2013-12-03 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: i18n
requirement: !ruby/object:Gem::Requirement
requirements:
- - - '='
+ - - "~>"
- !ruby/object:Gem::Version
- version: 0.6.1
+ version: '0.6'
+ - - ">="
+ - !ruby/object:Gem::Version
+ version: 0.6.4
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - '='
+ - - "~>"
+ - !ruby/object:Gem::Version
+ version: '0.6'
+ - - ">="
- !ruby/object:Gem::Version
- version: 0.6.1
+ version: 0.6.4
- !ruby/object:Gem::Dependency
name: multi_json
requirement: !ruby/object:Gem::Requirement
requirements:
- - - ~>
+ - - "~>"
- !ruby/object:Gem::Version
version: '1.0'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - - ~>
+ - - "~>"
- !ruby/object:Gem::Version
version: '1.0'
description: A toolkit of support libraries and Ruby core extensions extracted from
@@ -260,22 +266,23 @@ files:
- lib/active_support/xml_mini.rb
- lib/active_support.rb
homepage: http://www.rubyonrails.org
-licenses: []
+licenses:
+- MIT
metadata: {}
post_install_message:
rdoc_options:
-- --encoding
+- "--encoding"
- UTF-8
require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - - '>='
+ - - ">="
- !ruby/object:Gem::Version
version: 1.8.7
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - - '>='
+ - - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-activesupport-3.2.git
More information about the Pkg-ruby-extras-commits
mailing list