| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
This patch modifies XmlMini::Parsing["decimal"] to handle a string that
contains an invalid number. Since [ruby/ruby@a0e438c#diff-6b866d482baf2bdfd8433893fb1f6d36R144](https://github.com/ruby/ruby/commit/a0e438cd3c28d2eaf4efa18243d5b6edafa14d88#diff-6b866d482baf2bdfd8433893fb1f6d36R144) this case raises an `ArgumentError`. `String.to_f` returns 0.0 if there is not a valid number at the start of the argument, so current behavior is conserved.
See https://travis-ci.org/rails/rails/jobs/463180341#L6264
Related: #34600, #34601
|
| |
|
|
|
|
|
|
|
|
|
| |
If the same block is included multiple times, we no longer raise an exception
or overwrite the included block instance variable.
Fixes #14802.
[Mark J. Titorenko + Vlad Bokov]
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents the array from being dumped as a DRbObject so we can reduce
communication with the server.
In DRb, if `Marshal.dump` fails, `Marshal.dump` is executed again after
converting the object to `DRbObject`. This also possible to reduce the
execution of `Marshal.dump` by converting to a format that can be
marshalized in advance using `DRbObject`.
This is the same approach to Action Pack's parallel test. Ref: 5751b7ea58d7cf259dda30fb42fff51fc6ae93d5
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the `Duration` class was introduced in 276c9f29, the `parts` were
represented as an array of arrays
(for example `[[:seconds, 5], [:days, 3], [:seconds, 7]]`).
At that time the `reduce` in `#inspect` made sense,
since we would need to get the totals for each part
(the example would become `{ seconds: 12, days: 3 }`).
With the current version of `Duration` we call `to_h` on the `parts`
immediately on initialize, so now the `reduce` doesn't seem to be doing
anything meaningful.
|
|\
| |
| | |
`atomic_write`: Ensure correct permission when `tmpdir` is the same as `dirname`.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Expand documentation for Hash#slice!
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since #33449, `event.end = Time.now` is not used anymore and should use
`event.finish!`.
We can't use `deprecate :end=` in definition time in this module due to
circular require in `active_support/deprecation/behaviors`.
|
|\ \ \
| | | |
| | | | |
Windows support for parallelization and instrumenter
|
| |/ /
| | |
| | |
| | |
| | | |
Add Windows support for `ActiveSupport::Testing::Parallelization`
and `ActiveSupport::Notifications::Instrumenter`.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
DRb wraps in `DRbUnknown` if the data contains a type that can not be
resolved locally. This can happen if an error occurs in the test and the
error class can not be resolved on the server side.
When this happens, an instance of `DRbUnknown` is passed to the `result`
of `Server#record`. This causes another error(undefined method assertions
for #<DRb::DRbUnknown:> (NoMethodError)) in `reporter.record`.
This can confirm by the following steps.
```
$ rails new app -B --dev; cd app
$ rails g scaffold user name:string
$ edit `config.action_controller.allow_forgery_protection = true` in environments/test.rb
$ bin/rails t
```
In the case of `DRbUnknown` occurs, can't resolve error exception. So wrap
exception with `DRbRemoteError` in the same way as an unmarshalled object.
|
|\ \
| | |
| | | |
Fix DRb::DRbServerNotFound errors in parallel tests
|
| | |
| | |
| | |
| | | |
marshallable DRbRemoteError
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes #34359
Prior to 5.2.0 (2cad8d7), HashWithIndifferentAccess#to_options acted as
an alias to HashWithIndifferentAccess#symbolize_keys. Now, #to_options
returns an instance of HashWithIndifferentAccess while #symbolize_keys
returns and instance of Hash.
This pr makes it so HashWithIndifferentAccess#to_options acts as an
alias for HashWithIndifferentAccess#symbolize_keys once again.
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
albertoalmagro/privatize-constants-activesupport-timezone
Privatize and add # :nodoc: to constants
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Both `UTC_OFFSET_WITH_COLON` and `UTC_OFFSET_WITHOUT_COLON` are only
used within `ActiveSupport::TimeZone` and in my opinion they do not
provide relevant information that should appear in the docs.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
If you require `nokogiri` from `app/models/user.rb`, dependencies.rb
does not mark `Nokogiri` as an autoloaded constant, as expected.
But the logic to detect these non-autoloaded constants is incomplete.
See the tests defined in the patch for some cases incorrectly handled.
|
|\ \ \
| | | |
| | | | |
Implement AR#inspect using ParameterFilter
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
AR instance support `filter_parameters` since #33756.
Though Regex or Proc is valid as `filter_parameters`,
they are not supported as AR#inspect.
I also add :mask option and #filter_params to
`ActiveSupport::ParameterFilter#new` to implement this.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
There are two main reasons why `assert_called_with` should require
`args` argument:
1) If we want to assert that some method should be called and we don't
need to check with which arguments it should be called then we should use
`assert_called`.
2) `assert_called_with` without `args` argument doesn't assert anything!
```ruby
assert_called_with(@object, :increment) do
@object.decrement
end
```
It causes false assertions in tests that could cause regressions in the project.
I found this bug by working on
[minitest-mock_expectations](https://github.com/bogdanvlviv/minitest-mock_expectations) gem.
This gem is an extension for minitest that provides almost the same method call
assertions.
I was wondering whether you would consider adding "minitest-mock_expectations"
to `rails/rails` instead of private `ActiveSupport::Testing::MethodCallAssertions` module.
If yes, I'll send a patch - https://github.com/bogdanvlviv/rails/commit/a970ecc42c3a9637947599f2c13e3762e4b59208
|
|\ \ \ \
| | | | |
| | | | | |
Make it easier to find abort documentation
|
| | |_|/
| |/| |
| | | | |
Make sure how to abort is documented on https://api.rubyonrails.org/classes/ActiveSupport/Callbacks.html
|
| | | |
| | | |
| | | |
| | | | |
[ci skip]
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Improve variable naming by renaming from `e` to `event`.
The arguments to rename this are:
* The naming `e` is usually a convention used for exceptions.
* No other method in this class uses the naming `e`. All other
methods are using `event`.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Since #29294, `mattr_acessor` uses kwargs for `instance_reader`,
`instance_writer`, and `instance_accessor` options.
`thread_mattr_accessor` and `config_accessor` also take the same
options, so let's maintain these options handles the same.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
`ruby -ractive_support/core_ext/range/conversions.rb -ep` dies with uninitialized constant ActiveSupport
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
a5b0c60714e1e8d8c182af830a26e1c7c884271d
|
| | | |
| | | |
| | | |
| | | | |
in favor of `array.flatten.pack("U*")` and `string.scan(/\X/).map(&:codepoints)`, respectively.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Use \X meta character directly to get grapheme clusters.
Thanks to @mtsmfm for the tip:
https://github.com/rails/rails/pull/34123#issuecomment-429028878
r? @jeremy
|
|\ \ \ \
| | | | |
| | | | | |
Extend doc for ActiveSupport::Cache#fetch_multi
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In favor of String#is_utf8?.
I think this method was made for internal use only, and its usage was removed here: https://github.com/rails/rails/pull/8261/files#diff-ce956ebe93786930e40f18db1da5fd46L39.
|
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
- Adding a Float as a duration to a datetime would result in the Float
being rounded. Doing something like would have no effect because the
0.45 seconds would be rounded to 0 second.
```ruby
time = DateTime.parse("2018-1-1")
time += 0.45.seconds
```
This behavior was intentionally added a very long time ago, the
reason was because Ruby 1.8 was using `Integer#gcd` in the
constructor of Rational which didn't accept a float value.
That's no longer the case and doing `Rational(0.45, 86400)` would
now perfectly work fine.
- Fixes #34008
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Use String methods directly instead.
|
|\ \ \ \
| |_|_|/
|/| | | |
clarify role of unique_id in ActiveSupport::Notifications [ci skip]
|
| | | | |
|