| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
| |
|
|
|
|
|
|
| |
assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message
assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
|
|
|
|
|
|
|
|
| |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
| |
On ruby 2.1.1 the behavior of .select and .reject has changed.
They will return a Hash new instance, so we need to override them to
keep the instance object class.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TL;DR The primary driver is to remove autoload surprise.
This is related to #12106. (The root cause for that ticket is that
json/add defines Regexp#to_json among others, but here I'll reproduce
the problem without json/add.)
Before:
>> require 'active_support/core_ext/to_json'
=> true
>> //.as_json
NoMethodError: undefined method `as_json' for //:Regexp
from (irb):3
from /Users/godfrey/.rvm/rubies/ruby-2.0.0-p195/bin/irb:16:in `<main>'
>> //.to_json
=> "\"(?-mix:)\""
>> //.as_json
=> "(?-mix:)"
After:
>> require 'active_support/core_ext/to_json'
=> true
>> //.as_json
=> "(?-mix:)"
This is because ActiveSupport::JSON is autoloaded the first time
Object#to_json is called, which causes additional core extentions
(previously defined in active_support/json/encoding.rb) to be loaded.
When someone require 'active_support/core_ext', the expectation is
that it would add certain methods to the core classes NOW. The
previous behaviour causes additional methods to be loaded the first
time you call `to_json`, which could cause nasty surprises and other
unplesant side-effects.
This change moves all core extensions in to core_ext/json. AS::JSON is
still autoloaded on first #to_json call, but since it nolonger
include the core extensions, it should address the aforementioned bug.
*Requiring core_ext/object/to_json now causes a deprecation warnning*
|
| |
|
| |
|
|
|
|
| |
No sense over-testing this MRI-specific behavior. See ruby/ruby@8d6add973ebcb3b4c1efbfaf07786550a3e219af
|
|
|
|
|
|
| |
Ruby implementations should be free to produce exception
messages that are not identical to MRI. For example,
Rubinius produces 'Expected an even number, got 5'.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
There are a bunch of other implicit branches that adds
1.8.x specific code that still needs to be removed. Pull
requests for those cases are welcome.
|
|
|
|
|
| |
`Array#extract_options!`
`ActiveSupport::OrderedHash` is actually a subclass of the hash, so it does make sense that it should be extractable from the array list.
|
|
|
|
|
| |
ActiveSupport::OrderedHash did not behave identically to Hash when given
a block with a splat.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes Hash subclasses convert to HWIA by default for nested
objects of subclasses of Hash, but allows certain subclasses to prevent nested
conversion by introducing Hash#nested_under_indifferent_access that subclasses
can overwrite.
ActiveSupport::OrderedHash is one such subclass that overwrites
+nested_under_indifferent_access+, since implicitly converting it to HWIA would
remove the ordering of keys and values in Ruby 1.8.
This change is necessary because commit ce9456e broke nested indifferent access
conversion for all subclasses of Hash.
|
| |
|
|
|
|
|
|
| |
block [#6366 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
|
|
|
|
| |
[#5601 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
bit the code
|
| |
|
|
|
|
|
|
| |
returned (the test would pass for an array and would pass by chance for hashes).
[#4875 state:resolved]
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
|
|
|
| |
all Ruby core classes.
This is required because the JSON gem is incompatible with Rails behavior and was not allowing ActiveModel::Errors to be serialized.
So we need to ensure Rails implementation is the one triggered. [#4890 state:resolved]
|
|
|
|
|
|
|
|
| |
This ensures that an OrderedHash's keys are set up appropriately when using update.
[#4973 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
| |
|
|
|
|
|
|
| |
This reverts commit 72f9fec607c4a72b2e88995d0cb32b16b96e9068.
It is wrong, this feature is a little undocumented, doing some research.
|
| |
|
|
|
|
| |
Signed-off-by: Xavier Noria <fxn@hashref.com>
|
|
|
|
|
|
|
|
| |
[#4838 state:committed]
For better consistency with Ruby's own Hash implementation.
Signed-off-by: Xavier Noria <fxn@hashref.com>
|
|
|
|
|
|
| |
[#3608 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
| |
Signed-off-by: Michael Koziarski <michael@koziarski.com>
|
|
|
|
|
|
| |
1.8.7 [#2832 state:resolved]
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
|
|
|
|
|
|
| |
[#2615 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
|
|
|
| |
Matches ruby1.9's Hash#to_a.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2629 state:committed]
|
| |
|
|
|
|
| |
default value
|
|
|
|
|
|
| |
state:resolved]
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
|
|
|
|
|
|
| |
[#1559 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
|
|
|
|
| |
did not sync the @keys after the operation.
This probably holds true for other mutating methods as well.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
|