1. 18 1月, 2018 1 次提交
    • K
      Enable autocorrect for `Lint/EndAlignment` cop · 5ac6ec54
      Koichi ITO 提交于
      ### Summary
      
      This PR changes .rubocop.yml.
      
      Regarding the code using `if ... else ... end`, I think the coding style
      that Rails expects is as follows.
      
      ```ruby
      var = if cond
        a
      else
        b
      end
      ```
      
      However, the current .rubocop.yml setting does not offense for the
      following code.
      
      ```ruby
      var = if cond
              a
            else
              b
            end
      ```
      
      I think that the above code expects offense to be warned.
      Moreover, the layout by autocorrect is unnatural.
      
      ```ruby
      var = if cond
        a
            else
              b
            end
      ```
      
      This PR adds a setting to .rubocop.yml to make an offense warning and
      autocorrect as expected by the coding style.
      And this change also fixes `case ... when ... end` together.
      
      Also this PR itself is an example that arranges the layout using
      `rubocop -a`.
      
      ### Other Information
      
      Autocorrect of `Lint/EndAlignment` cop is `false` by default.
      https://github.com/bbatsov/rubocop/blob/v0.51.0/config/default.yml#L1443
      
      This PR changes this value to `true`.
      
      Also this PR has changed it together as it is necessary to enable
      `Layout/ElseAlignment` cop to make this behavior.
      5ac6ec54
  2. 11 7月, 2017 1 次提交
  3. 09 7月, 2017 1 次提交
  4. 02 7月, 2017 1 次提交
  5. 01 7月, 2017 1 次提交
  6. 23 5月, 2017 1 次提交
  7. 20 4月, 2017 1 次提交
  8. 15 2月, 2017 1 次提交
  9. 07 8月, 2016 2 次提交
  10. 12 4月, 2016 1 次提交
  11. 24 2月, 2016 2 次提交
  12. 04 11月, 2015 1 次提交
  13. 25 8月, 2015 1 次提交
  14. 30 10月, 2012 1 次提交
  15. 15 9月, 2012 1 次提交
  16. 14 9月, 2012 2 次提交
  17. 13 9月, 2012 2 次提交
    • P
      Change ActiveSupport::Deprecation to class. · 71993c6f
      Piotr Niełacny 提交于
      ActiveSupport::Deprecation is now a class rather than a module. You can
      get instance of ActiveSupport::Deprecation calling #instance method.
      
        ActiveSupport::Deprecation.instance
      
      But when you need to get new object od ActiveSupport::Deprecation you
      need to just call #new.
      
        @instance = ActiveSupport::Deprecation.new
      
      Since you can create a new object, you can change the version and the
      name of the library where the deprecator concerned.
      
        ActiveSupport::Deprecation.new('2.0', 'MyGem')
      
      If you need use another deprecator instance you can select it in the
      options of deprecate method.
      
        deprecate :method, :deprecator => deprecator_instance
      
      Documentation has been updated.
      71993c6f
    • R
      extend ActiveSupport::Deprecation with self, allow other objects to extend/include it also. · 2c690a0f
      Robert Pankowecki 提交于
      test local deprecation
      
      deprecator object
      
      Test ActiveSupport::Deprecation when included
      2c690a0f
  18. 23 6月, 2012 1 次提交
  19. 18 6月, 2012 1 次提交
  20. 27 4月, 2011 1 次提交
  21. 13 1月, 2011 1 次提交
  22. 21 12月, 2010 1 次提交
  23. 25 8月, 2010 1 次提交
  24. 01 7月, 2010 1 次提交
  25. 06 3月, 2010 1 次提交
  26. 18 4月, 2009 1 次提交