1. 09 2月, 2016 1 次提交
    • A
      drop array allocations on `html_safe` · 783858c8
      Aaron Patterson 提交于
      For better or worse, anonymous `*` args will allocate arrays.  Ideally,
      the interpreter would optimize away this allocation.  However, given the
      number of times we call `html_safe` it seems worth the shedding idealism
      and going for performance.  This line was the top allocation spot for a
      scaffold (and presumably worse on real applications).
      783858c8
  2. 08 2月, 2016 3 次提交
  3. 07 2月, 2016 3 次提交
  4. 04 2月, 2016 3 次提交
    • G
      Don't publicize Kernel core extensions · 5a4e8788
      Genadi Samokovarov 提交于
      This is a reaction to a [bug] we hit in web-console. The cause of it was
      a `Kernel` extension called `#console` that was public and was fighting
      over Railties with console block to be run on `rails console`. We solved
      it by making the method private. We did that through `module_function`
      so `::Kernel.console` can be invoked even in `BasicObject`.
      
      I'm proposing to make most of the core Active Support `Kernel`
      extensions `module_function` as well. Those are currently public and we
      are polluting every `Object` public interface with them.
      
      ```ruby
      >> Object.new.respond_to? :silence_warnings
      => true
      
      >> Object.new.respond_to? :with_warnings
      => true
      
      >> Object.new.respond_to? :enable_warnings
      => true
      
      >> Object.new.respond_to? :suppress
      => true
      ``
      
      Some extensions like `Kernel#class_eval` should be public, but most of
      them don't really need to be.
      
      [bug]: https://github.com/rails/web-console/issues/184
      5a4e8788
    • M
      Remove unused dependency · cf18c34e
      Mike Perham 提交于
      railties uses method_source, activesupport does not.  I assume code was refactored and the dependency wasn't removed.
      cf18c34e
    • M
      Remove json gem dependency · f3433f7c
      Mike Perham 提交于
      All modern Rubies ship JSON as part of stdlib.  Using the gem actually hurts multi-platform support due to build difficulties on Windows.
      f3433f7c
  5. 02 2月, 2016 7 次提交
  6. 01 2月, 2016 1 次提交
  7. 30 1月, 2016 1 次提交
  8. 29 1月, 2016 2 次提交
  9. 28 1月, 2016 1 次提交
  10. 27 1月, 2016 1 次提交
  11. 26 1月, 2016 2 次提交
  12. 24 1月, 2016 3 次提交
  13. 23 1月, 2016 3 次提交
    • A
      Document scoping issue with Time.use_zone · 8de32bb2
      Andrew White 提交于
      The Time.use_zone method will only affect ActiveSupport::TimeWithZone
      instances created inside of the block passed to Time.use_zone. This
      could be confusing when fetching a model and then reading the attribute
      before the block and it not changing afterwards because Active Record
      caches the conversion from the database value.
      
      Since changing the behavior of Active Record to recreate the value on
      every attribute read is an expensive operation the best we can do is
      to document the issue.
      
      Fixes #23195.
      
      [ci skip]
      8de32bb2
    • A
      Eliminate instance level writers for class accessors · 4642d68d
      Aaron Patterson 提交于
      Instance level writers can have an impact on how the Active Model /
      Record objects are saved.  Specifically, they can be used to bypass
      validations.  This is a problem if mass assignment protection is
      disabled and specific attributes are passed to the constructor.
      
      CVE-2016-0753
      4642d68d
    • A
      use secure string comparisons for basic auth username / password · 17e6f150
      Aaron Patterson 提交于
      this will avoid timing attacks against applications that use basic auth.
      
      CVE-2015-7576
      17e6f150
  14. 14 1月, 2016 1 次提交
  15. 13 1月, 2016 1 次提交
  16. 10 1月, 2016 1 次提交
    • K
      Extract line filtering to Railties. · 69e55471
      Kasper Timm Hansen 提交于
      The line filter parsing added to ActiveSupport::TestCase is only half the story
      to enable line filtering. The other half, of adding the patterns to the options,
      is done in the Minitest plugin that Railties has.
      
      Thus it makes more sense to have the filter in Railties with the other half and
      all the line filtering tests.
      
      Move the filter and extend Active Support in an initializer, so that when users
      or `rails/all.rb` require `rails/test_unit/railtie` we can still filter by line.
      69e55471
  17. 08 1月, 2016 1 次提交
  18. 07 1月, 2016 1 次提交
  19. 06 1月, 2016 2 次提交
    • S
      [close #22917] Don't output to `STDOUT` twice · 3d10d9d6
      schneems 提交于
      When `rails console` or `rails server` are used along with a logger set to output to `STDOUT` then the contents will show up twice. This happens because the logger is extended with `ActiveSupportLogger.broadcast` with a destination of STDOUT even if it is already outputting to `STDOUT`.
      
      Previously PR #22592 attempted to fix this issue, but it ended up causing NoMethodErrors. A better approach than relying on adding a method and flow control is to inspect the log destination directly. For this `ActiveSupport::Logger.logger_outputs_to?` was introduced
      
      ```ruby
      logger = Logger.new(STDOUT)
      ActiveSupport::Logger.logger_outputs_to?(logger, STDOUT)
      # => true
      ```
      
      To accomplish this we must look inside of an instance variable of standard lib's Logger `@logdev`. There is a related Ruby proposal to expose this method in a standard way: https://bugs.ruby-lang.org/issues/11955
      3d10d9d6
    • S
      Revert "Add Logger option to disable message broadcasts" · 9dcb1b9b
      schneems 提交于
      This reverts related commits due to #22917.
      9dcb1b9b
  20. 03 1月, 2016 1 次提交
  21. 02 1月, 2016 1 次提交