| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \
| | |
| | | |
DateTime#<=> return nil when compare to the invalid String as Time.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
before:
p Time.now == 'a' # => false
p Time.now <=> 'a' # => nil
require 'active_support'
require 'active_support/core_ext'
p Time.now == 'a' # => false
p Time.now <=> 'a' # => invalid date (ArgumentError)
and on ruby 2.2, Time.now == 'a' warning.
warning: Comparable#== will no more rescue exceptions of #<=> in the next release.
warning: Return nil in #<=> if the comparison is inappropriate or avoid such comparison.
after:
- Error handling.
- Quiet warnings.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
knovoselic/active_support_concern_class_methods_fix
[ActiveSupport] Fix for #20489 - ActiveSupport::Concern#class_methods affects parent classes
|
| | | | |
|
| |_|/
|/| |
| | |
| | |
| | | |
This makes it possible to easily get the runner working with existing
setups that rely on `active_support/testing/autorun.rb`.
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
```ruby
Benchmark.ips do |x|
x.report("$&") {
"foo".gsub(/f/) { $&.hex }
}
x.report("block var") {
"foo".gsub(/f/) { |match| match.hex }
}
end
```
```
Calculating -------------------------------------
$& 23.271k i/100ms
block var 24.804k i/100ms
-------------------------------------------------
$& 321.981k (± 7.4%) i/s - 1.606M
block var 324.949k (± 9.2%) i/s - 1.612M
```
|
|\ \
| | |
| | |
| | | |
Improve Test Runner's Minitest integration.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This also adds free mix and matching of directories, files and lines filters.
Like so:
bin/rails test models/post_test.rb test/integration models/person_test.rb:26
You can also mix in a traditional Minitest filter:
bin/rails test test/integration -n /check_it_out/
|
| | |
| | |
| | |
| | | |
[Robin Dupret & Shunsuke Aida]
|
|\ \ \
| | | |
| | | | |
[ci skip] Fix `thoughtbot` capitalization
|
| | | |
| | | |
| | | |
| | | |
| | | | |
The company name is spelled `thoughtbot` per
https://github.com/thoughtbot/presskit/blob/master/README.md#name
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | | |
ActiveSupport::TimeWithZone references `ActiveSupport::Duration` but
does not require it, which can result in a `LoadError` when required
directly without requiring a component less granular like
`active_support/time`, where the autoload for `ActiveSupport::Duration`
is set up.
|
|\ \ \
| | | |
| | | | |
Use block variable instead of global
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
```ruby
require 'benchmark/ips'
Benchmark.ips do |x|
x.report("$&") {
"foo".sub(/f/) { $&.upcase }
}
x.report("block var") {
"foo".sub(/f/) {|match| match.upcase }
}
end
```
```
Calculating -------------------------------------
$& 48.658k i/100ms
block var 49.666k i/100ms
-------------------------------------------------
$& 873.156k (± 9.3%) i/s - 4.331M
block var 969.744k (± 9.2%) i/s - 4.818M
```
It's faster, and gets rid of a few "magic" global variables
|
|\ \ \ \
| | | | |
| | | | | |
Allow Enumerable#pluck to take a splat.
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | | |
This allows easier integration with ActiveRecord, such that
AR#pluck will now use Enumerable#pluck if the relation is loaded,
without needing to hit the database.
|
|\ \ \ \
| | | | |
| | | | | |
Deprecate `assert_template` and `assigns()`.
|
| | |/ /
| |/| | |
|
|/ / /
| | |
| | |
| | |
| | | |
Passing 999999000 < `:nsec` < 999999999 and 999999 < `:usec` < 1000000
to change a time with utc_offset doesn't throw an `ArgumentError`.
|
|/ /
| |
| |
| | |
core_ext/time"
|
|\ \
| | |
| | | |
Replace use of alias chains with prepend at core_ext/date and core_ext/time
|
| | | |
|
| | |
| | |
| | |
| | | |
Allows fetching the same values from arrays as from ActiveRecord associations.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Added multibyte slice! example to doc [ci skip]
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Add bang version to OrderedOptions
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
By:
Aditya Sanghi(@asanghi)
Gaurish Sharma(gaurish)
|
| | | | | |
|
|\ \ \ \ \
| |_|/ / /
|/| | | |
| | | | | |
Remove `.superclass_delegating_accessor`.
|
| |/ / / |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Add documentation for Deprecation::Behavior module
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add documentation for DeprecatedConstantProxy#class
|
| |/ / / / |
|
| |/ / /
|/| | |
| | | |
| | | | |
[ci skip]
|
|\ \ \ \
| | | | |
| | | | | |
Add nodoc label for protected Cache methods
|
| |/ / / |
|
|\ \ \ \
| | | | |
| | | | | |
Update documentation for MemCacheStore::build_mem_cache [ci skip]
|
| |/ / / |
|
|\ \ \ \
| | | | |
| | | | | |
Update documentation for ArrayInquirer#any?
|
| |/ / / |
|
|/ / / |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
* 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
|