1. 22 4月, 2018 1 次提交
  2. 20 4月, 2018 3 次提交
    • B
      Return back "/" to the end of RAILS_GEM_ROOT · f8cbc1dd
      bogdanvlviv 提交于
      - The "/" was removed in 40bdbce1 during
      refactoring. It may cause regression since looks like was added
      intentionaly because it is possible that a name of any another gem
      can start with /rails/, so slash was added to ensure that it is "rails"
      gem.
      I would like to backport this to `5-2-stable` too.
      
      - Use `__dir__` instead of `__FILE__`. Follow up #29176.
      f8cbc1dd
    • B
      Allow rubocop check more files · 1a42d87e
      bogdanvlviv 提交于
      This commit fix pattern of filenames for `CustomCops/AssertNot` and
      `CustomCops/RefuteNot`.
      
      rubocop should check every file under `test/`.
      
      Related to #32441, #32605
      1a42d87e
    • B
      Fix name of the test added by #32613 · e6970c42
      bogdanvlviv 提交于
      e6970c42
  3. 19 4月, 2018 3 次提交
    • D
      Replace `assert !` with `assert_not` · a1ac1867
      Daniel Colson 提交于
      This autocorrects the violations after adding a custom cop in
      3305c78dcd.
      a1ac1867
    • G
      Redis cache store: avoid blocking the server in `#delete_matched` · ef2af628
      Gleb Mazovetskiy 提交于
      Fixes #32610. Closes #32614.
      
      Lua scripts in redis are *blocking*, meaning that no other client can
      execute any commands while the script is running. See
      https://redis.io/commands/eval#atomicity-of-scripts.
      
      This results in the following exceptions once the number of keys is
      sufficiently large:
      
          BUSY Redis is busy running a script.
          You can only call SCRIPT KILL or SHUTDOWN NOSAVE.
      
      This commit replaces the lua-based implementation with one that uses
      `SCAN` and `DEL` in batches. This doesn't block the server.
      
      The primary limitation of `SCAN`, i.e. potential duplicate keys, is of
      no consequence here, because `DEL` ignores keys that do not exist.
      ef2af628
    • D
      Fix exception in AS::Timezone.all when any tzinfo data is missing · 7d25b651
      Dominik Sander 提交于
      Before this change missing timezone data for any of the time zones
      defined in `ActiveSupport::Timezone::MAPPING` caused a `comparison of
      NilClass with ActiveSupport::TimeZone failed` exception.
      
      Attempting to get a timezone by passing a number/duration to `[]` or
      calling `all` directly will try to sort sort the values of `zones_map`.
      Those values are initialized by the return value of `create(zonename)`
      which returns `nil` if `TZInfo` is unable to find the timezone
      information.
      
      In our case the exception was triggered by an outdated tzdata package
      which did not include information for the "recently" added time zones.
      
      Before 078421ba `zones_map` only
      returned the information that have been loaded into `@lazy_zone_map`
      which ignored time zones for which the data could not be loaded, this
      change restores the previous behaviour.
      7d25b651
  4. 16 4月, 2018 1 次提交
  5. 15 4月, 2018 2 次提交
  6. 13 4月, 2018 2 次提交
  7. 12 4月, 2018 3 次提交
    • T
      Cache::Store#read: Fix fixed-width end tag in docs · 68139de2
      Teddy Wing 提交于
      * Fix the ending `</tt>` tag for `:expires_in`. Otherwise, the "or" is
        set in fixed-width also.
      * Re-wrap paragraph to 80 columns.
      
      [ci skip]
      68139de2
    • G
      Fix `ActiveSupport::Cache` compression · 66df3662
      Godfrey Chan 提交于
      (See previous commit for a description of the issue)
      66df3662
    • G
      Add failing test for compression bug · 84b1feea
      Godfrey Chan 提交于
      On Rails 5.2, when compression is enabled (which it is by default),
      the actual value being written to the underlying storage is actually
      _bigger_ than the uncompressed raw value.
      
      This is because the `@marshaled_value` instance variable (typically)
      gets serialized with the entry object, which is then written to the
      underlying storage, essentially double-storing every value (once
      uncompressed, once possibly compressed).
      
      This regression was introduced in #32254.
      84b1feea
  8. 08 4月, 2018 1 次提交
  9. 07 4月, 2018 1 次提交
  10. 06 4月, 2018 1 次提交
    • E
      `SetupAndTeardown#teardown` should call any subsequent after_teardown: · 70fae9a4
      Edouard CHIN 提交于
        If you have a regular test that have a teardown block, and for any reason an exception get raised, ActiveSupport will not run subsequent after_teardown method provided by other module or gems.
        One of them being the ActiveRecord::TestFixtures which won't rollback the transation when the test ends making all subsequent test to be in a weird state.
      
        The default implementation of minitest is to run all teardown methods from the user's test, rescue all exceptions, run all after_teardown methods provided by libraries and finally re-raise the exception that happened in the user's teardown method.
        Rails should do the same.
      70fae9a4
  11. 05 4月, 2018 1 次提交
  12. 04 4月, 2018 1 次提交
    • D
      Autocorrect `refute` RuboCop violations · c1ceafc9
      Daniel Colson 提交于
      73e7aab behaved as expected on codeship, failing the build with
      exactly these RuboCop violations. Hopefully `rubocop -a` will
      have been enough to get a passing build!
      c1ceafc9
  13. 03 4月, 2018 1 次提交
  14. 31 3月, 2018 2 次提交
  15. 30 3月, 2018 1 次提交
  16. 25 3月, 2018 1 次提交
  17. 23 3月, 2018 1 次提交
  18. 22 3月, 2018 2 次提交
  19. 21 3月, 2018 1 次提交
  20. 19 3月, 2018 2 次提交
  21. 15 3月, 2018 1 次提交
    • S
      Don't marshal ActiveSupport::Cache::Entry objects twice · 066919f2
      Sean Griffin 提交于
      When upgrading to Rails 5.2 we're seeing
      `ActiveSupport::Cache::Entry#compress` and
      `ActiveSupport::Cache::Entry#should_compress?` as the highest usage of
      our CPU. At least some part of this is coming from the fact that objects
      are being marshaled multiple times. This memoizes the marshaled value to
      eliminate half the problem.
      066919f2
  22. 14 3月, 2018 1 次提交
  23. 13 3月, 2018 1 次提交
  24. 12 3月, 2018 1 次提交
    • B
      Fix CHANGELOGs [ci skip] · dd075657
      bogdanvlviv 提交于
      - Add missing dots.
      - Remove reference to itself on GitHub.
        Usually, we add references to fixed issues only in a changelog.
      
      Follow up #32223
      dd075657
  25. 09 3月, 2018 1 次提交
  26. 07 3月, 2018 3 次提交
    • N
      Add `before?` and `after?` methods to date and time classes · 20fa0d92
      Nick Holden 提交于
      Equality comparisons between dates and times can take some extra time to
      comprehend. I tend to think of a date or time as "before" or "after"
      another date or time, but I naturally read `<` and `>` as "less than"
      and "greater than." This change seeks to make date/time comparisons more
      human readable.
      20fa0d92
    • A
      [ci skip] Hide internal docs from root AS module · b5aa0266
      Ashe Connor 提交于
      We have a bunch of documentation in
      lib/active_support/core_ext/object/json.rb which is currently appearing
      as documentation for the top-level ActiveSupport module.  We hide it
      from rdoc here.
      Signed-off-by: NAshe Connor <ashe@kivikakk.ee>
      b5aa0266
    • A
      URI.unescape handles mixed Unicode/escaped input · e52ab312
      Ashe Connor 提交于
      Previously, URI.enscape could handle Unicode input (without any actual
      escaped characters), or input with escaped characters (but no actual
      Unicode characters) - not both.
      
          URI.unescape("\xe3\x83\x90")  # => "バ"
          URI.unescape("%E3%83%90")  # => "バ"
          URI.unescape("\xe3\x83\x90%E3%83%90")  # =>
                                               # Encoding::CompatibilityError
      
      We need to let `gsub` handle this for us, and then force back to the
      original encoding of the input.  The result String will be mangled if
      the percent-encoded characters don't conform to the encoding of the
      String itself, but that goes without saying.
      Signed-off-by: NAshe Connor <ashe@kivikakk.ee>
      e52ab312
  27. 06 3月, 2018 1 次提交