Commit Graph

6816 Commits

Author SHA1 Message Date
yuuji.yaginuma
392d03a292 use message that specified in argument to error message 2016-08-31 08:52:23 +09:00
Andrew White
3132fa6b7d Merge pull request #25880 from ryandv/fix_performance_regression_in_timewithzone_to_time
Fix performance regression in `TimeWithZone#to_time`
2016-08-30 08:42:45 +01:00
yuuji.yaginuma
6582c7c54a use inspect for show from value
If `from` is nil, in order to avoid the blank is showed.
2016-08-29 09:06:10 +09:00
Anton Davydov
aa595909bf Fix typo in Delegation#delegate_missing_to doc [skip ci] 2016-08-27 14:47:17 +03:00
Santosh Wadghule
3cece0b657 Move custom assertion to its proper place
ActiveSupport::Testing::Assertions.

We have a separate module in which have defined Rails' own custom
assertions. So it would be good to keep all custom Rails' assertions in
one place i.e. in this module.
2016-08-27 08:33:08 +05:30
Ryan De Villa
af054a5ae9 Memoize coerced TimeWithZone value in TimeWithZone#localtime. 2016-08-23 14:07:07 -04:00
Ryan De Villa
fa9f1538f0 Fix performance regression in TimeWithZone#to_time
A performance regression was introduced by commit b79adc4323ff289aed3f5787fdfbb9542aa4f89f
from Rails 4.0.0.beta1, in which `TimeWithZone#to_time` no longer returns a
cached instance attribute but instead coerces the value to `Time`. This
coerced value is not cached, and recomputation degrades the performance
of comparisons between TimeWithZone objects.

See b79adc4323 (diff-3497a506c921a3a3e40fd517e92e4fe3R322)
for the change in question.

The following benchmark, which reverts the change linked above, demonstrates
the performance regression:

    require 'active_support/time'
    require 'benchmark/ips'

    utc = Time.utc(2000, 1, 1, 0)
    time_zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']

    twz = ActiveSupport::TimeWithZone.new(utc, time_zone)
    twz2 = ActiveSupport::TimeWithZone.new(Time.utc(1999, 12, 31, 23, 59, 59), ActiveSupport::TimeZone['UTC'])

    patchedTimeWithZone = Class.new(ActiveSupport::TimeWithZone) do
      def to_time
        utc
      end
    end

    patched_twz = patchedTimeWithZone.new(utc, time_zone)
    patched_twz2 = patchedTimeWithZone.new(Time.utc(1999, 12, 31, 23, 59, 59), ActiveSupport::TimeZone['UTC'])

    Benchmark.ips do |x|
      x.report("comparison out of the box") { twz <=> twz2 }
      x.report("comparison reverting to_time") { patched_twz <=> patched_twz2 }
      x.compare!
    end

The results, when run in rails-dev-box, are as follows:

    Warming up --------------------------------------
    comparison out of the box
                            24.765k i/100ms
    comparison reverting to_time
                            57.237k i/100ms
    Calculating -------------------------------------
    comparison out of the box
                            517.245k (± 4.7%) i/s -      2.600M in   5.038700s
    comparison reverting to_time
                              2.624M (± 5.0%) i/s -     13.050M in   4.985808s

    Comparison:
    comparison reverting to_time:  2624266.1 i/s
    comparison out of the box:   517244.6 i/s - 5.07x slower

The change made to run the benchmark, however, is not possible, as it would
undo the intent to standardize the return value of `to_time` to `Time` in
the system timezone.

Our proposed solution is to restore the caching behaviour of `to_time`
as it existed prior to the change linked above.

Benchmark of our solution:

    require 'active_support/time'
    require 'benchmark/ips'

    patchedTimeWithZone = Class.new(ActiveSupport::TimeWithZone) do
      def to_time
        @to_time ||= super
      end
    end

    utc = Time.utc(2000, 1, 1, 0)
    time_zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)']

    twz = ActiveSupport::TimeWithZone.new(utc, time_zone)
    twz2 = ActiveSupport::TimeWithZone.new(Time.utc(1999, 12, 31, 23, 59, 59), ActiveSupport::TimeZone['UTC'])

    patched_twz = patchedTimeWithZone.new(utc, time_zone)
    patched_twz2 = patchedTimeWithZone.new(Time.utc(1999, 12, 31, 23, 59, 59), ActiveSupport::TimeZone['UTC'])

    Benchmark.ips do |x|
      x.report("TimeWithZone comparison - existing implementation") { twz <=> twz2 }
      x.report("TimeWithZone comparison - caching implementation") { patched_twz <=> patched_twz2 }
      x.compare!
    end

Results in rails-dev-box:

    Warming up --------------------------------------
    TimeWithZone comparison - existing implementation
                            26.629k i/100ms
    TimeWithZone comparison - caching implementation
                            59.144k i/100ms
    Calculating -------------------------------------
    TimeWithZone comparison - existing implementation
                            489.757k (± 4.2%) i/s -      2.450M in   5.011639s
    TimeWithZone comparison - caching implementation
                              2.802M (± 5.3%) i/s -     13.958M in   4.996116s

    Comparison:
    TimeWithZone comparison - caching implementation:  2801519.1 i/s
    TimeWithZone comparison - existing implementation:   489756.7 i/s - 5.72x slower
2016-08-23 14:07:07 -04:00
Rafael Mendonça França
32e25e812d
Merge pull request #25628 from ysksn/options
Remove parameter "options = nil" for #clear
2016-08-17 02:55:58 -03:00
Rafael França
e1aabeedd8 Merge pull request #25863 from mechanicles/remove-duplicate-test
Remove duplicate test.
2016-08-16 14:58:06 -03:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces

Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Eileen M. Uchitelle
22996ca6ab Merge pull request #25570 from y-yagi/remove_useless_parameter
remove useless parameter
2016-08-15 11:45:40 -04:00
mrageh
3bbd2d4dff
Add documentation about ActiveSupport.on_load
[ci skip]

This commit adds some docs that explain how `LazyLoadHooks.on_load` method
works.
2016-08-13 01:01:21 +01:00
Rafael França
cd8f5913e8 Merge pull request #26100 from vipulnsward/changelogs
Pass over changelogs
2016-08-12 20:19:41 -03:00
Xavier Noria
432222fae1 prefer __dir__ over __FILE__ in File.expand_path
Thinking .. relative to files is not natural, we are used
to think "parent of a directory", and we have __dir__
nowadays.
2016-08-11 01:03:14 +02:00
Vipul A M
8b984161d6
Pass over changelogs [ci skip] 2016-08-10 09:33:13 +05:30
Xavier Noria
996a27ec3a let instance thread_mattr_* methods delegate to the class-level ones
This code has too much duplication and the rationale for the concatenation
may not be obvious to the reader. You define the ones at class-level, explain
why does the code concatenates there, and then the convenience ones at
instance-level just delegate.
2016-08-08 16:01:37 +02:00
Yves Senn
e9852c92bf Merge pull request #25681 from willnet/fix-thread_mattr_accessor
Fix `thread_mattr_accessor` share variable superclass with subclass
2016-08-08 12:35:29 +02:00
Xavier Noria
628474f2d3 damn typos [ci skip] 2016-08-08 01:21:27 +02:00
Xavier Noria
55dfa00976 explain why aliasing uses explicit selfs [ci skip] 2016-08-08 01:19:32 +02:00
Xavier Noria
a9dc45459a code gardening: removes redundant selfs
A few have been left for aesthetic reasons, but have made a pass
and removed most of them.

Note that if the method `foo` returns an array, `foo << 1`
is a regular push, nothing to do with assignments, so
no self required.
2016-08-08 01:12:38 +02:00
Ryuta Kamizono
762e3f05f3 Add Style/EmptyLines in .rubocop.yml and remove extra empty lines 2016-08-07 17:50:59 +09:00
Xavier Noria
b326e82dc0 applies remaining conventions across the project 2016-08-06 20:20:22 +02:00
Xavier Noria
80e66cc4d9 normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
Xavier Noria
411ccbdab2 remove redundant curlies from hash arguments 2016-08-06 19:44:11 +02:00
Xavier Noria
5c315a8fa6 modernizes hash syntax in activesupport 2016-08-06 19:38:33 +02:00
Xavier Noria
e6ab70c439 applies new string literal convention to the rest of the project
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:28:46 +02:00
Xavier Noria
adca8154c6 applies new string literal convention in the gemspecs
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:27:12 +02:00
Xavier Noria
a731125f12 applies new string literal convention in activesupport/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:10:53 +02:00
Xavier Noria
d66e7835be applies new string literal convention in activesupport/lib
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:10:53 +02:00
willnet
3529e58efd Fix thread_mattr_accessor share variable superclass with subclass
The current implementation of `thread_mattr_accessor` set variable
sharing superclass with subclass. So the method doesn't work as documented.

Precondition

    class Account
      thread_mattr_accessor :user
    end

    class Customer < Account
    end

    Account.user = "DHH"
    Account.user  #=> "DHH"
    Customer.user = "Rafael"
    Customer.user # => "Rafael"

Documented behavior

    Account.user  # => "DHH"

Actual behavior

    Account.user  # => "Rafael"

Current implementation set variable statically likes `Thread[:attr_Account_user]`,
and customer also use it.

Make variable name dynamic to use own thread-local variable.
2016-08-04 10:11:06 +09:00
Andrew White
0e762ecdc3 Add :weeks to the list of variable duration parts
Since 434df00 week durations are no longer converted to days. This means
we need to add :weeks to the parts that ActiveSupport::TimeWithZone will
consider being of variable duration to take account of DST transitions.

Fixes #26039.
2016-08-03 14:45:09 +01:00
kyatul
1f5a40469e Add documentation for ActiveSupport::StringInquirer [ci skip] 2016-08-03 12:43:52 +05:30
David Heinemeier Hansson
afc9a82567 Revert "Adds not_in? onto Object" 2016-07-29 14:45:20 -07:00
Bart de Water
73209aa7a3 Add rationale for manually checking auth_tag length, which got lost when #25874 was squashed before merging [skip ci] 2016-07-27 13:41:40 +02:00
Rafael França
0020f1a4c9 Merge pull request #25914 from jmccartie/jm/not_in
Adds `not_in?` onto Object
2016-07-22 19:48:46 -03:00
Xavier Noria
92c60f87a6 revises a regexp
The exclamation mark is not a metacharacter.
2016-07-22 23:20:25 +02:00
Xavier Noria
cfc91c31aa systematic revision of =~ usage in AS
Where appropriate prefer the more concise Regexp#match?, String#include?,
String#start_with?, and String#end_with?
2016-07-22 23:13:49 +02:00
Xavier Noria
aea0e5cd70 adds require for Regexp#match? 2016-07-22 00:33:02 +02:00
Xavier Noria
21c6f810ac revises style 2016-07-22 00:31:09 +02:00
Xavier Noria
9256bbbbd7 the infamous typo only seen in GitHub's diff [ci skip] 2016-07-22 00:27:39 +02:00
Jon McCartie
4db6ac29f2 Adds not_in? onto Object 2016-07-21 17:23:33 -05:00
Xavier Noria
929a650080 performance boost for String#blank? in Ruby 2.4
Some casual benchmarks showed a 2x factor.

All credit goes to @nurse.
2016-07-22 00:16:24 +02:00
Xavier Noria
575dbeeefc define Range#match? if Ruby < 2.4
See the rationale in the documentation included in this patch.

We are going to gradually introduce this predicate in the code base.
2016-07-22 00:15:52 +02:00
Bart de Water
d4ea18a8cb
Allow MessageEncryptor to take advantage of authenticated encryption modes
AEAD modes like `aes-256-gcm` provide both confidentiality and data authenticity, eliminating the need to use MessageVerifier to check if the encrypted data has been tampered with.

Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
2016-07-21 10:38:33 -07:00
Rafael França
0e825917f1 Merge pull request #25823 from mechanicles/missing-memory-store-tests
Add missing tests for memory store of cache.
2016-07-20 02:12:01 -03:00
Rafael França
cc22c9eae3 Merge pull request #25393 from gsamokovarov/introduce-assert-changes
Introduce `assert_changes` and `assert_no_changes`
2016-07-20 00:57:25 -03:00
Rafael França
8a0b3ca8c4 Merge pull request #25822 from mechanicles/clear-local-cache-on-invalid-parameters-error
Add missing test for clearing up local cache on invalid parameters error.
2016-07-20 00:52:55 -03:00
Santosh Wadghule
2d78a3ae86 Add missing test for clearing up local cache on invalid parameters err.
Add missing test for clearing up local cache and check response should
be present on invalid parameters error.
2016-07-17 20:06:37 +05:30
Santosh Wadghule
6b0792266b Add missing tests for memory store of cache. 2016-07-17 19:05:52 +05:30
Genadi Samokovarov
16f24cd10f Introduce assert_changes and assert_no_changes
Those are assertions that I really do miss from the standard
`ActiveSupport::TestCase`. Think of those as a more general version of
`assert_difference` and `assert_no_difference` (those can be implemented
by assert_changes, should this change be accepted).

Why do we need those? They are useful when you want to check a
side-effect of an operation. `assert_difference` do cover a really
common case, but we `assert_changes` gives us more control. Having a
global error flag? You can test it easily with `assert_changes`. In
fact, you can be really specific about the initial state and the
terminal one.

```ruby
error = Error.new(:bad)
assert_changes -> { Error.current }, from: nil, to: error do
  expected_bad_operation
end
```

`assert_changes` follows `assert_difference` and a string can be given
for evaluation as well.

```ruby
error = Error.new(:bad)
assert_changes 'Error.current', from: nil, to: error do
  expected_bad_operation
end
```

Check out the test cases if you wanna see more examples.

🍻
2016-07-17 12:58:57 +03:00
Rafael Mendonça França
bbbabc22c1
Make sure the time method is unstubed
The minitest stubs were conflicting with the time travel stubs so the
travel_back method call in the teardown block was actually keeping the
time stubbed.
2016-07-17 05:13:20 -03:00
Santosh Wadghule
eb8cd81859 Remove duplicate test.
We already test similar stuff in `test_really_long_keys` so removing
this extra and duplicated test.
2016-07-17 12:07:11 +05:30
oss92
b937c24edc Added :fallback_string option to Array#to_sentence 2016-07-13 20:19:26 +02:00
Rafael França
9be45aceba Merge pull request #25790 from mrageh/wrap-lazy-load-hooks-in-module
Wrap module around lazy load hooks
2016-07-13 01:57:54 -03:00
Rafael Mendonça França
fc50f1fd50
Remove old test that check duplicated items in the load path
This test was added to protect the test suite from our mistakes but now
it is failing because bundler does add duplicated libs in the load path
by design (if the repository has more than one gem)
2016-07-13 01:54:42 -03:00
Akira Matsuda
0796d14211 Missing require 'active_support/multibyte/unicode' 2016-07-12 22:34:11 +09:00
John Gesimondo
424e961be7 Raise ArgumentError for bad strptime arguments 2016-07-11 20:49:21 -07:00
mrageh
949485550f
Wrap module around lazy load hooks
Fix for issue https://github.com/rails/rails/issues/25784

Prior to this commit the lazy_load_hooks.rb file contained important lazy load
hooks. Since [7c90d91](7c90d91c3c) the [documentation](http://api.rubyonrails.org/files/activesupport/lib/active_support/lazy_load_hooks_rb.html) did not display
the comments in this file as the docs for load hooks.

This commit wraps the code within this file in a module so we can display the
documentation for `ActiveSupport` load hooks. By extending `ActiveSupport` with
this module, all the methods within it should still be accessible through
`ActiveSupport`.
2016-07-12 02:44:50 +01:00
Paul Sadauskas
629dde297c AS::Duration should serialize empty values correctly. (#25656)
The current implementation serializes zero-length durations incorrectly (it serializes as `"-P"`), and cannot un-serialize itself:

```
[1] pry(main)> ActiveSupport::Duration.parse(0.minutes.iso8601)
ActiveSupport::Duration::ISO8601Parser::ParsingError: Invalid ISO 8601 duration: "-P" is empty duration
from /Users/rando/.gem/ruby/2.3.1/gems/activesupport-5.0.0/lib/active_support/duration/iso8601_parser.rb:96:in `raise_parsing_error'
```

Postgres empty intervals are serialized as `"PT0S"`, which is also parseable by the Duration deserializer, so I've modified the `ISO8601Serializer` to do the same.

Additionally, the `#normalize` function returned a negative sign if `parts` was blank (all zero). Even though this fix does not rely on the sign, I've gone ahead and corrected that, too, in case a future refactoring of `#serialize` uses it.
2016-07-11 15:45:04 -04:00
John Gesimondo
39d84608ad Update class_attribute docs 2016-07-10 19:04:18 -07:00
Rafael França
3d716b9e66 Merge pull request #25736 from voxik/file-store-test-require-pathname
Pathname might not be always initialized.
2016-07-07 11:26:21 -03:00
Vít Ondruch
34e0eafb4b Pathname might not be always initialized.
Require 'pathname' explicitly
2016-07-07 12:27:01 +02:00
Kasper Timm Hansen
2dfb06a9b5 Merge pull request #24890 from vipulnsward/travel-to-raise
`travel/travel_to` travel time helpers, now raise on nested calls
2016-07-05 20:26:24 +02:00
Rafael França
1c7cbe8da6 Merge pull request #25678 from voxik/DRY-downloader
Dry downloader
2016-07-04 18:26:00 -03:00
Vít Ondruch
c245ca30f2 Skip the test if test data download fails. 2016-07-04 14:12:49 +02:00
Vít Ondruch
a69a5a4147 Pathname might not be always initialized.
Require 'pathname' explicitly
2016-07-04 14:08:27 +02:00
Vít Ondruch
7d7c2d13ba DRY Downloader. 2016-07-04 13:11:44 +02:00
Vipul A M
919e705362
travel/travel_to travel time helpers, now raise on nested calls,
as this can lead to confusing time stubbing.

     Instead of:

         travel_to 2.days.from_now do
           # 2 days from today
           travel_to 3.days.from_now do
             # 5 days from today
           end
         end

     preferred way to achieve above is:

         travel_to 2.days.from_now
         # 2 days from today

         travel_back
         travel_to 5.days.from_now
         # 5 days from today

Closes #24690
Fixes #24689
2016-07-02 15:09:34 -07:00
Yosuke Kabuto
b76f82d714 Update CHANGELOG.md for #25628 [ci skip]
Move new CHANGELOG entry top [ci skip]

Remove parameter "options = nil" for #clear
2016-07-02 23:58:14 +09:00
Rafael França
14996a1490 Merge pull request #25625 from voxik/fix-rails-test-git-layout
Do not depend on Rails git repository layout in ActiveSupport tests.
2016-07-01 21:18:12 -03:00
Matthew Draper
ad95b6fc72 Merge pull request #25344 from matthewd/debug-locks
ActionDispatch::DebugLocks
2016-07-02 06:47:57 +09:30
Matthew Draper
f0c7e2b8c3 Merge pull request #24146 from matthewd/latch-as-proxy
Don't inherit from Concurrent::CountDownLatch
2016-07-02 06:47:38 +09:30
Vipul A M
d7a7a2561a Merge pull request #25600 from pan/constantize-docfix
fix ActiveSupport::Infector.constantize usage API doc [ci skip]
2016-07-01 13:20:02 -07:00
Vít Ondruch
6119a9524b Do not depend on Rails git repository layout in ActiveSupport tests. 2016-07-01 15:29:54 +02:00
Matthew Draper
ea7fee03f7 Partially revert #25192
KeyGenerator is used in other contexts, and we cannot change its
output... even if it does accidentally default to generating excess key
material for our primary internal usage.
2016-07-01 01:01:45 +09:30
Pan GaoYong
37232f6d43 fix ActiveSupport::Infector.constantize usage API doc [ci skip] 2016-06-30 22:37:49 +08:00
yuuji.yaginuma
738156f9ee remove useless parameter 2016-06-29 22:27:37 +09:00
Vipul A M
8ee269cf51
We default to using aes-256-cbc as our verification/signing cipher. It can accept key lengths of 128, 192 or 256-bit, whereas currently we were providing twice the acceptable value.
ruby < 2.4 allowed accepting these values, as extra key bits were ignored. Since ce635262f5 this now has a strict checking on key length.

Default to key length 32 bytes, to match the compatible length for  aes-256-cbc

Fixes #25185
2016-06-27 17:43:55 -07:00
Godfrey Chan
ffded19faf Clearify CHANGELOG for #23011 [ci skip] 2016-06-27 08:37:06 -07:00
Ryunosuke Sato
abbf00e583 Define Pathname#as_json
When the Pathname object is converted as JSON,
it should be a string that means itself.

Expected:
```
>> Pathname.new('/path/to/somewhere.txt').as_json
"/path/to/somewhere.txt"
```

Actual:
```
>> Pathname.new('/path/to/somewhere.txt').as_json
{"path"=>"/path/to/somewhere.txt"}
```
2016-06-25 21:50:16 +09:00
Ryunosuke Sato
236e616688 Define URI::Generic#as_json
When the URI object is converted as JSON,
it is expected that it is a string that means its URI.

Expected:
```
>> URI.parse('http://example.com').as_json
"http://example.com"
```

Actual:
```
>> URI.parse('http://example.com').as_json
{"scheme"=>"http",
 "user"=>nil,
 "password"=>nil,
 "host"=>"example.com",
 "port"=>80,
 "path"=>"",
 "query"=>nil,
 "opaque"=>nil,
 "fragment"=>nil,
 "parser"=>
  {"regexp"=>
    {"SCHEME"=>"(?-mix:\\A[A-Za-z][A-Za-z0-9+\\-.]*\\z)",
     "USERINFO"=>"(?-mix:\\A(?:%\\h\\h|[!$&-.0-;=A-Z_a-z~])*\\z)",
     "HOST"=>
      "(?-mix:\\A(?:(?<IP-literal>\\[(?:(?<IPv6address>(?:\\h{1,4}:){6}(?<ls32>\\h{1,4}:\\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5]|\\d)\\.\\g<dec-octet>\\.\\g<dec-octet>\\.\\g<dec-octet>))|::(?:\\h{1,4}:){5}\\g<ls32>|\\h{,4}::(?:\\h{1,4}:){4}\\g<ls32>|(?:(?:\\h{1,4}:)?\\h{1,4})?::(?:\\h{1,4}:){3}\\g<ls32>|(?:(?:\\h{1,4}:){,2}\\h{1,4})?::(?:\\h{1,4}:){2}\\g<ls32>|(?:(?:\\h{1,4}:){,3}\\h{1,4})?::\\h{1,4}:\\g<ls32>|(?:(?:\\h{1,4}:){,4}\\h{1,4})?::\\g<ls32>|(?:(?:\\h{1,4}:){,5}\\h{1,4})?::\\h{1,4}|(?:(?:\\h{1,4}:){,6}\\h{1,4})?::)|(?<IPvFuture>v\\h+\\.[!$&-.0-;=A-Z_a-z~]+))\\])|\\g<IPv4address>|(?<reg-name>(?:%\\h\\h|[!$&-.0-9;=A-Z_a-z~])*))\\z)",
     "ABS_PATH"=>
      "(?-mix:\\A\\/(?:%\\h\\h|[!$&-.0-;=@-Z_a-z~])*(?:\\/(?:%\\h\\h|[!$&-.0-;=@-Z_a-z~])*)*\\z)",
     "REL_PATH"=>
      "(?-mix:\\A(?:%\\h\\h|[!$&-.0-;=@-Z_a-z~])+(?:\\/(?:%\\h\\h|[!$&-.0-;=@-Z_a-z~])*)*\\z)",
     "QUERY"=>"(?-mix:\\A(?:%\\h\\h|[!$&-.0-;=@-Z_a-z~\\/?])*\\z)",
     "FRAGMENT"=>"(?-mix:\\A(?:%\\h\\h|[!$&-.0-;=@-Z_a-z~\\/?])*\\z)",
     "OPAQUE"=>"(?-mix:\\A(?:[^\\/].*)?\\z)",
     "PORT"=>
      "(?-mix:\\A[\\x09\\x0a\\x0c\\x0d ]*\\d*[\\x09\\x0a\\x0c\\x0d ]*\\z)"}}}
```
2016-06-25 16:43:58 +09:00
Godfrey Chan
3a9428df91 Merge pull request #23011 from arnvald/bugfix/correctly_parse_date
Use correct timezone when parsing date in json
2016-06-25 12:02:07 +08:00
Alex Kitchens
64cabcd77a [ci skip] Add link to method referenced in ActiveSupport::PerThreadRegistry 2016-06-24 15:14:50 -05:00
Kevin McPhillips
b081633efa Update changelog for #25341 2016-06-22 20:42:54 -04:00
aarongray
b30805bd46 Create times in rails timezone not system timezone [ci skip]
Time.new is a Ruby method that uses system timezone. Traveling in time
using it is a recipe for confusion. Instead, Time.zone.local should
be used since it uses the Rails timezone.
2016-06-21 17:22:56 -06:00
Sean Griffin
30dd8b2cb0 Merge pull request #25302 from schneems/schneems/evented-file-boot-at-check-time-master
EventedFileUpdateChecker boots once per process
2016-06-17 10:19:56 -04:00
Alex Kitchens
9bcaa2c154 Change AS::Callback to ActiveSupport::Callbacks in doc [ci skip] 2016-06-14 14:08:33 -05:00
Rafael Mendonça França
6e5b0a184d
Fix missing requires for object/blank 2016-06-13 13:01:32 -04:00
Rafael Mendonça França
4a7cd700b4
Remove deprecated arguments in assert_nothing_raised 2016-06-13 12:05:33 -04:00
schneems
844af9fa7c Lock the whole boot step, get rid of unneeded hash 2016-06-13 09:29:57 -05:00
Genadi Samokovarov
3d8b238dd8 Remove an unused require in ActiveSupport::TestCase
We used to have `assert_blank` and `assert_presence`. [ci skip]
2016-06-13 10:50:48 +03:00
Jon Moss
02a6452e2c
Remove _run_class_setup
Should have been removed by 3073c531983de243219fb55be93fbcebfdd9c44e.
2016-06-10 21:14:33 -04:00
Rafael Mendonça França
1de3db9046
Make sure the yielded variable is the logger 2016-06-10 13:30:50 -04:00
Rafael França
1f452f9a3d Merge pull request #25341 from kmcphillips/master
Broadcast #silence on ActiveSupport::Logger
2016-06-10 13:06:44 -04:00
Rafael França
7fd477c0f5 Merge pull request #25352 from Shopify/optimized-delegate
Replace Kernel#caller by the faster Kernel#caller_locations
2016-06-10 13:04:50 -04:00
Jean Boussier
e8148a5cf4 Replace Kernel#caller by the faster Kernel#caller_locations 2016-06-10 11:34:18 -04:00
Edouard CHIN
3da701dd3c [ci skip] define_model_callbacks only exist in active model:
- Also added a note when calling multiple time `define_callbacks`
2016-06-10 11:31:11 -04:00
Matthew Draper
04b4a0666b Provide a middleware to debug misbehaving locks
Only intended to be enabled when in use; by necessity, it sits above any
reasonable access control.
2016-06-10 19:33:38 +09:30
Kevin McPhillips
83f9cdb02a Be explicit about what Logger class is expected 2016-06-09 22:11:07 -04:00
Kevin McPhillips
99bd118eec Broadcast #silence on logger. Rewrite tests. 2016-06-09 22:10:47 -04:00