activesupport 4.0.9 → 4.0.10.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/active_support/core_ext/date_time/calculations.rb +3 -1
- data/lib/active_support/core_ext/object/to_param.rb +1 -58
- data/lib/active_support/core_ext/object/to_query.rb +56 -7
- data/lib/active_support/dependencies.rb +4 -4
- data/lib/active_support/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbe2fae1659ed09f9f3371afbe8edf5f8ae2bde6
|
4
|
+
data.tar.gz: 646c199436cbc39b5f9e35429e02941d041ee9f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f662fa9d21c765dc91d693ffd1c17ee4d555b258c708bf5f277a7b8daaea50e5f4b83f5f88d3486a60ab60d418883f1f5b1edb9e360952f40057267c4a2acd62
|
7
|
+
data.tar.gz: 8fc5fa8bc07108c8db350eb7c36cafcbf3904b8fe37a4b2252e5ee3f675af2b3812ece503c916011e4e1b01b50a75b61cc3f60144ddaf007dbb0e1d54ad035d1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## Rails 4.0.10 (August 19, 2014) ##
|
2
|
+
|
3
|
+
* Fix DateTime comparison with DateTime::Infinity object.
|
4
|
+
|
5
|
+
*Rafael Mendonça França*
|
6
|
+
|
7
|
+
* Make Dependencies pass a name to NameError error.
|
8
|
+
|
9
|
+
*arthurnn*, *Yuki Nishijima*
|
10
|
+
|
11
|
+
|
1
12
|
## Rails 4.0.9 (August 18, 2014) ##
|
2
13
|
|
3
14
|
*No changes*
|
@@ -158,7 +158,9 @@ class DateTime
|
|
158
158
|
# Layers additional behavior on DateTime#<=> so that Time and
|
159
159
|
# ActiveSupport::TimeWithZone instances can be compared with a DateTime.
|
160
160
|
def <=>(other)
|
161
|
-
if other.
|
161
|
+
if other.kind_of?(Infinity)
|
162
|
+
super
|
163
|
+
elsif other.respond_to? :to_datetime
|
162
164
|
super other.to_datetime
|
163
165
|
else
|
164
166
|
nil
|
@@ -1,58 +1 @@
|
|
1
|
-
|
2
|
-
# Alias of <tt>to_s</tt>.
|
3
|
-
def to_param
|
4
|
-
to_s
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
class NilClass
|
9
|
-
# Returns +self+.
|
10
|
-
def to_param
|
11
|
-
self
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class TrueClass
|
16
|
-
# Returns +self+.
|
17
|
-
def to_param
|
18
|
-
self
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class FalseClass
|
23
|
-
# Returns +self+.
|
24
|
-
def to_param
|
25
|
-
self
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
class Array
|
30
|
-
# Calls <tt>to_param</tt> on all its elements and joins the result with
|
31
|
-
# slashes. This is used by <tt>url_for</tt> in Action Pack.
|
32
|
-
def to_param
|
33
|
-
collect { |e| e.to_param }.join '/'
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
class Hash
|
38
|
-
# Returns a string representation of the receiver suitable for use as a URL
|
39
|
-
# query string:
|
40
|
-
#
|
41
|
-
# {name: 'David', nationality: 'Danish'}.to_param
|
42
|
-
# # => "name=David&nationality=Danish"
|
43
|
-
#
|
44
|
-
# An optional namespace can be passed to enclose the param names:
|
45
|
-
#
|
46
|
-
# {name: 'David', nationality: 'Danish'}.to_param('user')
|
47
|
-
# # => "user[name]=David&user[nationality]=Danish"
|
48
|
-
#
|
49
|
-
# The string pairs "key=value" that conform the query string
|
50
|
-
# are sorted lexicographically in ascending order.
|
51
|
-
#
|
52
|
-
# This method is also aliased as +to_query+.
|
53
|
-
def to_param(namespace = nil)
|
54
|
-
collect do |key, value|
|
55
|
-
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
|
56
|
-
end.sort * '&'
|
57
|
-
end
|
58
|
-
end
|
1
|
+
require 'active_support/core_ext/object/to_query'
|
@@ -1,17 +1,45 @@
|
|
1
|
-
require 'active_support/core_ext/object/to_param'
|
2
|
-
|
3
1
|
class Object
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
# Alias of <tt>to_s</tt>.
|
3
|
+
def to_param
|
4
|
+
to_s
|
5
|
+
end
|
6
|
+
|
7
|
+
# Converts an object into a string suitable for use as a URL query string,
|
8
|
+
# using the given <tt>key</tt> as the param name.
|
8
9
|
def to_query(key)
|
9
10
|
require 'cgi' unless defined?(CGI) && defined?(CGI::escape)
|
10
11
|
"#{CGI.escape(key.to_param)}=#{CGI.escape(to_param.to_s)}"
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
15
|
+
class NilClass
|
16
|
+
# Returns +self+.
|
17
|
+
def to_param
|
18
|
+
self
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class TrueClass
|
23
|
+
# Returns +self+.
|
24
|
+
def to_param
|
25
|
+
self
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class FalseClass
|
30
|
+
# Returns +self+.
|
31
|
+
def to_param
|
32
|
+
self
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
14
36
|
class Array
|
37
|
+
# Calls <tt>to_param</tt> on all its elements and joins the result with
|
38
|
+
# slashes. This is used by <tt>url_for</tt> in Action Pack.
|
39
|
+
def to_param
|
40
|
+
collect { |e| e.to_param }.join '/'
|
41
|
+
end
|
42
|
+
|
15
43
|
# Converts an array into a string suitable for use as a URL query string,
|
16
44
|
# using the given +key+ as the param name.
|
17
45
|
#
|
@@ -23,5 +51,26 @@ class Array
|
|
23
51
|
end
|
24
52
|
|
25
53
|
class Hash
|
26
|
-
|
54
|
+
# Returns a string representation of the receiver suitable for use as a URL
|
55
|
+
# query string:
|
56
|
+
#
|
57
|
+
# {name: 'David', nationality: 'Danish'}.to_query
|
58
|
+
# # => "name=David&nationality=Danish"
|
59
|
+
#
|
60
|
+
# An optional namespace can be passed to enclose the param names:
|
61
|
+
#
|
62
|
+
# {name: 'David', nationality: 'Danish'}.to_query('user')
|
63
|
+
# # => "user[name]=David&user[nationality]=Danish"
|
64
|
+
#
|
65
|
+
# The string pairs "key=value" that conform the query string
|
66
|
+
# are sorted lexicographically in ascending order.
|
67
|
+
#
|
68
|
+
# This method is also aliased as +to_param+.
|
69
|
+
def to_query(namespace = nil)
|
70
|
+
collect do |key, value|
|
71
|
+
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
|
72
|
+
end.sort * '&'
|
73
|
+
end
|
74
|
+
|
75
|
+
alias_method :to_param, :to_query
|
27
76
|
end
|
@@ -446,7 +446,7 @@ module ActiveSupport #:nodoc:
|
|
446
446
|
raise ArgumentError, "A copy of #{from_mod} has been removed from the module tree but is still active!"
|
447
447
|
end
|
448
448
|
|
449
|
-
raise NameError
|
449
|
+
raise NameError.new("#{from_mod} is not missing constant #{const_name}!", const_name) if from_mod.const_defined?(const_name, false)
|
450
450
|
|
451
451
|
qualified_name = qualified_name_for from_mod, const_name
|
452
452
|
path_suffix = qualified_name.underscore
|
@@ -498,9 +498,9 @@ module ActiveSupport #:nodoc:
|
|
498
498
|
end
|
499
499
|
end
|
500
500
|
|
501
|
-
|
502
|
-
|
503
|
-
|
501
|
+
name_error = NameError.new("uninitialized constant #{qualified_name}", const_name)
|
502
|
+
name_error.set_backtrace(caller.reject {|l| l.starts_with? __FILE__ })
|
503
|
+
raise name_error
|
504
504
|
end
|
505
505
|
|
506
506
|
# Remove the constants that have been autoloaded, and those that have been
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activesupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.10.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -317,9 +317,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
317
317
|
version: 1.9.3
|
318
318
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
319
319
|
requirements:
|
320
|
-
- - "
|
320
|
+
- - ">"
|
321
321
|
- !ruby/object:Gem::Version
|
322
|
-
version:
|
322
|
+
version: 1.3.1
|
323
323
|
requirements: []
|
324
324
|
rubyforge_project:
|
325
325
|
rubygems_version: 2.3.0
|