1. 06 4月, 2015 1 次提交
  2. 05 4月, 2015 1 次提交
  3. 02 4月, 2015 2 次提交
    • B
      Freeze static arguments for gsub · 58d75fd8
      brainopia 提交于
      58d75fd8
    • B
      Prefer string patterns for gsub · cdac52e1
      brainopia 提交于
      https://github.com/ruby/ruby/pull/579 - there is a new optimization
      since ruby 2.2
      
      Previously regexp patterns were faster (since a string was converted to
      regexp underneath anyway). But now string patterns are faster and
      better reflect the purpose.
      
        Benchmark.ips do |bm|
          bm.report('regexp') { 'this is ::a random string'.gsub(/::/, '/') }
          bm.report('string') { 'this is ::a random string'.gsub('::', '/') }
          bm.compare!
        end
        # string: 753724.4 i/s
        # regexp: 501443.1 i/s - 1.50x slower
      cdac52e1
  4. 28 3月, 2015 2 次提交
    • S
      Return super in ActionController::Parameters.const_missing · 1b0526ea
      Shuhei Kagawa 提交于
      The current implementation of ActionController::Parameters.const_missing
      returns `ActionController::Parameters.always_permitted_parameters` even
      if its `super` returns a constant without raising error. This prevents its
      subclass in a autoloading module/class from taking advantage of
      autoloading constants.
      
          class SomeParameters < ActionController::Parameters
            def do_something
              DefinedSomewhere.do_something
            end
          end
      
      In the code above, `DefinedSomewhere` is to be autoloaded with
      `Module.const_missing` but `ActionController::Parameters.const_missing`
      returns `always_permitted_parameters` instead of the autoloaded
      constant.
      
      This pull request fixes the issue respecting `const_missing`'s `super`.
      1b0526ea
    • R
      Define a setup method instead of using setup as block · 9c3c07b3
      Rafael Mendonça França 提交于
      setup as block run before setup actlually runs so it will fail for our
      case
      9c3c07b3
  5. 25 3月, 2015 3 次提交
    • A
      Add changelog entry for #19271 · b6b08842
      Arthur Neves 提交于
      b6b08842
    • G
      Add ActiveSupport::ArrayInquirer and Array#inquiry · c64b99ec
      George Claghorn 提交于
      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
      c64b99ec
    • G
      Provide friendlier access to request variants · 9d9cc477
      George Claghorn 提交于
      Closes #18933.
      9d9cc477
  6. 23 3月, 2015 3 次提交
  7. 21 3月, 2015 1 次提交
    • A
      Fix handling of empty X_FORWARDED_HOST header. · b49cac80
      adam 提交于
      Previously, an empty X_FORWARDED_HOST header would cause
      Actiondispatch::Http:URL.raw_host_with_port to return nil, causing
      Actiondispatch::Http:URL.host to raise a NoMethodError.
      b49cac80
  8. 20 3月, 2015 3 次提交
  9. 19 3月, 2015 1 次提交
  10. 16 3月, 2015 1 次提交
  11. 15 3月, 2015 1 次提交
  12. 13 3月, 2015 1 次提交
    • J
      Return true from head method · d5efb1f9
      Joel Hayhurst 提交于
      It was returning false in normal circumstances.
      This broke the `head :ok and return if` construct.
      Add appropriate test.
      d5efb1f9
  13. 12 3月, 2015 2 次提交
  14. 11 3月, 2015 1 次提交
  15. 10 3月, 2015 3 次提交
  16. 09 3月, 2015 1 次提交
  17. 07 3月, 2015 1 次提交
  18. 06 3月, 2015 5 次提交
  19. 05 3月, 2015 5 次提交
  20. 04 3月, 2015 1 次提交
  21. 03 3月, 2015 1 次提交