| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
This reverts commit 9420de59f5b7f5ceac77e28e6c326ec145f71f80.
Reason: Turns out we want to keep this method.
|
|
|
|
|
| |
We are promoting too much a feature that will not be widler used.
So for now lets keep just the ArrayInquirer constructor.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its
string-like contents. For example, `request.variant` returns an `ArrayInquirer`
object. To check a request's variants, you can call:
request.variant.phone?
request.variant.any?(:phone, :tablet)
...instead of:
request.variant.include?(:phone)
request.variant.any? { |v| v.in?([:phone, :tablet]) }
`Array#inquiry` is a shortcut for wrapping the receiving array in an
`ArrayInquirer`:
pets = [:cat, :dog]
pets.cat? # => true
pets.ferret? # => false
pets.any?(:cat, :ferret} # => true
|
| |
|
| |
|
|
|
| |
…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
|
|/ |
|
|
|
|
| |
an issue with the redis cache, where this code will sometimes throw an error out of SETEX when passing 0 as the `expires_at`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Run all our tests in random order
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 2f52f969885b2834198de0045748436a4651a94e.
Conflicts:
actionmailer/test/abstract_unit.rb
actionview/test/abstract_unit.rb
activemodel/test/cases/helper.rb
activerecord/test/cases/helper.rb
activesupport/test/abstract_unit.rb
railties/test/abstract_unit.rb
|
|/
|
|
| |
Closes #19227.
|
|
|
|
|
|
| |
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)
|
| | |
|
|/
|
|
| |
[Robin Dupret + Rafael Mendonça França]
|
|
|
|
| |
[egilburg]
|
| |
|
| |
|
|\
| |
| |
| | |
Fix a backtracking problem in String#truncate_words
|
| |
| |
| |
| | |
Fixes #19070.
|
|/
|
|
|
|
|
|
|
|
| |
Adds `read_multi` instrumentation formatted as:
Caches multi read:
- views/david/2/4184ab71db6849621a4d8820fcd2c0ad
- views/david/2/4184ab71db6849621a4d8820fcd2c0ad
- views/david/3/4184ab71db6849621a4d8820fcd2c0ad
- views/david/3/4184ab71db6849621a4d8820fcd2c0ad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`coder.represent_scalar` means something along the lines of "Here is a quoted
string, you can just add it to the output", which is not the case here. It only
works for simple strings that can appear unquoted in YAML, but causes problems
for e.g. primitive-like strings ("1", "true").
`coder.represent_object` on the other hand, means that "This is the Ruby-object
representation for this thing suitable for use in YAML dumping", which is what
we want here.
Before:
YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello"
YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => true
YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => false
YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => 1
YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => 1.1
After:
YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello"
YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => "true"
YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => "false"
YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => "1"
YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => "1.1"
If we ever want Ruby to behave more like PHP or JavaScript though, this is an
excellent trick to use ;)
|
|\
| |
| | |
Fixes incorrect wording of test description
|
| | |
|
|/
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Conflicts:
activesupport/lib/active_support/values/time_zone.rb
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Enable number_to_percentage to keep the number's precision by allowing :precision option value to be nil
Conflicts:
activesupport/CHANGELOG.md
activesupport/lib/active_support/number_helper.rb
activesupport/test/number_helper_test.rb
|
| |
| |
| |
| |
| |
| | |
:precision to be nil
number_helper.number_to_percentage(1000, precision: nil) # => "1000%"
|
|\ \
| | |
| | | |
Extracted silence_stream method to new module in activesupport/testing
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Added include for the same in ActiveSupport::Test.
- Removed occurrences of silence_stream being used elsewhere.
- Reordered activesupport testcase requires alphabetically.
- Removed require of silence stream from test_case
- Moved quietly method to stream helper
- Moved capture output to stream helper module and setup requires for the same elsewhere
|
| | | |
|
|\ \ \
| | | |
| | | | |
Change AS::Testing::TimeHelpers#travel_to to also stub DateTime.now
|
| | | | |
|
|/ / /
| | |
| | |
| | | |
onwards.
|
| | |
| | |
| | |
| | | |
ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
|
| | |
| | |
| | |
| | |
| | |
| | | |
It's a thin layer to provide easy access to sample files throughout
test-cases. This adds the directory `test/fixtures/files` to newly
generated applications.
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|