| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* Rename `ActiveSupport::Try` => `ActiveSupport::Tryable`
* Include the modules inline
* `private` indentation
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Delegator` inherits from `BasicObject`, which means that it will not
have `Object#try` defined. It will then delegate the call to the
underlying object, which will not (necessarily) respond to the method
defined in the enclosing `Delegator`.
This patches `Delegator` with the `#try` method to work around the
surprising behaviour.
Fixes #5790
|
|
|
|
|
|
|
| |
The feature was accepted and added to Ruby 2.3+ so we don't need to
define it again.
See https://bugs.ruby-lang.org/issues/11151
|
|\
| |
| |
| | |
Move Integer#positive? and Integer#negative? query methods to Numeric
|
| |
| |
| |
| | |
By this way Integer, Rational, Float, Fixnum, Bignum classes have the same behaviour
|
|/
|
|
|
|
|
|
|
| |
this removes the following warning:
```
test/core_ext/integer_ext_test.rb:34: warning: ambiguous first argument; put parentheses or a space even after `-' operator
test/core_ext/integer_ext_test.rb:38: warning: ambiguous first argument; put parentheses or a space even after `-' operator
```
|
|
|
|
| |
Fixnum#zero?
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Previously when converting AS::TimeWithZone to YAML it would be output
as a UTC timestamp. Whilst this preserves the time information accurately
it loses the timezone information. This commit changes that so that it is
saved along with the time information. It also provides nicer encoding of
AS::TimeZone instances themselves which previously embedded all of the
data from the TZInfo records.
Fixes #9183.
|
| |
|
|
|
| |
…as discussed #19413
|
|\
| |
| | |
Replace occurences of alias_method_chain with their Module#prepend counterpart
|
| |
| |
| |
| |
| |
| |
| | |
Thanks @fbernier for suggestion! <3
At this moment we can use Module#prepend in all all cases
except of Range because of the bug [1] in MRI 2.2
[1] https://bugs.ruby-lang.org/issues/10847
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reverting this as it's not the implementation that we would like it to be.
This is being used inside of ActiveSUpport::TimeZone[] and it's unaware
of the context in which to find the timezone period so the timezone found
changes depending on whether DST is in effect for the current period.
This means that `'2001-01-01'.in_time_zone(-9)` changes from winter/summer
even though it's the same date that we're trying to convert.
Since finding timezones by numeric offsets is a bit hit and miss we should
introduce a new API for finding them which supplies the date context in
which we want to search and we should probably also deprecate the finding
of timezones via the [] method, though this needs further discussion.
This reverts commit 2cc2fa3633edd96773023c6b09d07c7b9d9b841d.
|
|
|
|
|
|
| |
When given a specific offset, use the first result found where the
total current offset (including any periodic deviations such as DST)
from UTC is equal.
|
|\
| |
| | |
Improve the Rubinius build
|
| | |
|
|/
|
|
| |
(relates to #19157)
|
|
|
|
| |
[egilburg]
|
| |
|
| |
|
|\
| |
| |
| | |
Fix a backtracking problem in String#truncate_words
|
|/
|
|
| |
Fixes #19070.
|
|
|
|
|
|
|
| |
This caused a performance regression since we were decided to do the nil
check in run time not in the load time.
See https://github.com/rails/rails/pull/15187#issuecomment-71760058
|
|
|
|
| |
onwards.
|
|
|
|
|
|
| |
Staying true to Ruby convention, we now return the value of the yielded
block from `File.atomic_write {...}`. This mimics the behavior of MRI's
`File.open {...}`.
|
|
|
|
|
|
|
| |
tests
- Fixed the wrong use of with_indifferent_access on hash in the test which failed for isolated tests
- Renamed to appropriately specify what the test does
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi there,
i have an app without english as available locale. So i got an error when we try to inspect something like 1.day. This is done automatically when we use the dalli cache.
I would like to change the :en to ::I18n.default_locale to be sure that this is always constant and is an available locale.
Tests are all green with this change.
Calculating -------------------------------------
:locale => :en 2.024k i/100ms
:locale => ::I18n.default_locale 2.236k i/100ms
-------------------------------------------------
:locale => :en 25.758k (±26.3%) i/s - 117.392k
:locale => ::I18n.default_locale 26.311k (±18.1%) i/s - 127.452k
|
| |
|
|
|
|
| |
Date, Time, and DateTime
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and DateTime
`#on_weekend?` returns true if the receiving date/time falls on a Saturday or
Sunday.
`#next_weekday` returns a new date/time representing the next day that does
not fall on a Saturday or Sunday.
`#prev_weekday` returns a new date/time representing the previous day that
does not fall on a Saturday or Sunday.
|
| |
|
|
|
|
|
| |
bebugger doesn't work with Ruby 2.2 so we don't need to support it
anymore
|
|
|
|
|
| |
Now that Rails requires Ruby >= 2.0, there is no need to check whether
`BigDecimal` exists or not.
|
| |
|
|
|
|
| |
`silence_stderr`, `silence_stream`, `capture` and `quietly`.
|
| |
|
|
|
|
|
| |
`MissingSourceFile` was just an alias to `LoadError` and was not
being raised inside the framework.
|
|\
| |
| |
| |
| |
| |
| | |
replace use of MissingSourceFile with LoadError
Conflicts:
activesupport/test/core_ext/load_error_test.rb
|
| | |
|
| |
| |
| |
| | |
They are already present on Ruby 2.2
|
|\ \
| | |
| | | |
Rely on NameError#name instead of its error message
|
| | |
| | |
| | |
| | |
| | |
| | | |
Rubinius' error messages don't call `#inspect` on the concerned object
while the assertion is here to address a wrong inspection on MRI with
time zones so let's keep this test for now on Rubinius.
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Delegate comparison operator to value
|
| | | | |
|