1. 26 5月, 2014 1 次提交
  2. 11 4月, 2014 1 次提交
  3. 29 11月, 2013 1 次提交
  4. 07 11月, 2013 1 次提交
    • C
      Add +capitalize+ option to Inflector.humanize · c61544c7
      claudiob 提交于
      So strings can be humanized without being capitalized:
      
          'employee_salary'.humanize                    # => "Employee salary"
          'employee_salary'.humanize(capitalize: false) # => "employee salary"
      c61544c7
  5. 21 8月, 2013 1 次提交
  6. 03 8月, 2013 1 次提交
    • G
      Avoid calling define_method with non-english chars in InflectorTest · ab5e99ed
      Gaurish Sharma 提交于
      When we call define_method with non-english chars like ¿por qué? it
      errors out on JRuby as of 1.7.4 & would leave out the following error
      
      invalid byte sequence in US-ASCII
      
      To work around this issue, I have switched to define_test method call
      define method with fixed string & the index of the hash. the index was
      added because otherwise, ruby will raise method redefined warning.
      
      As far as I can see there are no side-effect of this change for
      other implementations. For readbility I have added a message to
      asssert_equal informing for which word/phase the test has passed.
      
      Before this Change:
      JRuby:
      Tests terminated suddenly with an error. no reported of Failues
      or errors
      MRI:
      All Green.
      
      After this Change,
      JRuby:
      the `ActiveSupport` TestsSuite gracefully fails with report at the end which test failed & why.
      MRI:
      All Green(no change)
      ab5e99ed
  7. 30 7月, 2013 1 次提交
  8. 10 4月, 2013 2 次提交
  9. 18 3月, 2013 1 次提交
  10. 17 3月, 2013 1 次提交
  11. 16 3月, 2013 1 次提交
  12. 11 3月, 2013 1 次提交
  13. 04 1月, 2013 1 次提交
  14. 02 12月, 2012 2 次提交
  15. 24 8月, 2012 1 次提交
  16. 31 7月, 2012 1 次提交
    • D
      Make ActiveSupport::Inflector locale aware and multilingual · 7db0b073
      David Celis 提交于
      The Inflector is currently not very supportive of internationalized
      websites. If a user wants to singularize and/or pluralize words based on
      any locale other than English, they must define each case in locale
      files. Rather than create large locale files with mappings between
      singular and plural words, why not allow the Inflector to accept a
      locale?
      
      This patch makes ActiveSupport::Inflector locale aware and uses `:en`` unless
      otherwise specified. Users will still be provided a list of English (:en)
      inflections, but they may additionally define inflection rules for other
      locales. Each list is kept separately and permanently. There is no reason to
      limit users to one list of inflections:
      
          ActiveSupport::Inflector.inflections(:es) do |inflect|
            inflect.plural(/$/, 's')
            inflect.plural(/([^aeéiou])$/i, '\1es')
            inflect.plural(/([aeiou]s)$/i, '\1')
            inflect.plural(/z$/i, 'ces')
            inflect.plural(/á([sn])$/i, 'a\1es')
            inflect.plural(/é([sn])$/i, 'e\1es')
            inflect.plural(/í([sn])$/i, 'i\1es')
            inflect.plural(/ó([sn])$/i, 'o\1es')
            inflect.plural(/ú([sn])$/i, 'u\1es')
      
            inflect.singular(/s$/, '')
            inflect.singular(/es$/, '')
      
            inflect.irregular('el', 'los')
          end
      
          'ley'.pluralize(:es)   # => "leyes"
          'ley'.pluralize(:en)   # => "leys"
          'avión'.pluralize(:es) # => "aviones"
          'avión'.pluralize(:en) # => "avións"
      
      A multilingual Inflector should be of use to anybody that is tasked with
      internationalizing their Rails application.
      Signed-off-by: NDavid Celis <david@davidcelis.com>
      7db0b073
  17. 21 6月, 2012 1 次提交
    • G
      Adds missing inflector tests to ensure idempotency · fe933be5
      Godfrey Chan 提交于
      This is a follow up to #4719. It appears that singularize and pluralize
      are supposed to be idempotent - i.e. when you call singularize or
      pluralize multiple times on the same string, you should get the same
      result. (At least for the "officially supported" cases that the stock
      inflector is designed to handle.) #4719 added the missing tests for
      regular cases, and this commit added the missing tests for the
      irregularities.
      
      While I'm at that, I also synced up the irregularity test cases with
      the current set of irregularity cases that we ship out-of-the-box.
      fe933be5
  18. 25 2月, 2012 1 次提交
  19. 04 2月, 2012 1 次提交
  20. 27 1月, 2012 1 次提交
  21. 06 1月, 2012 1 次提交
  22. 30 10月, 2011 1 次提交
    • X
      defines Module#qualified_const_(defined?|get|set) and String#deconstantize · 11f6795b
      Xavier Noria 提交于
      This commit also implements a faster version of #demodulize I was unable
      to isolate with git add --patch.
      
      Not a big fan of the name #deconstantize. It complements #demodulize
      getting rid of the rightmost constant, hence the name, but it is
      unrelated to the well-known #constantize. So unsure. Could not come
      with anything better, please feel free to rename.
      11f6795b
  23. 29 10月, 2011 1 次提交
  24. 23 9月, 2011 1 次提交
  25. 09 9月, 2011 1 次提交
  26. 08 9月, 2011 1 次提交
  27. 11 6月, 2011 2 次提交
  28. 25 4月, 2011 1 次提交
  29. 01 3月, 2011 1 次提交
  30. 17 2月, 2011 1 次提交
  31. 22 12月, 2010 2 次提交
  32. 20 5月, 2010 1 次提交
  33. 10 8月, 2009 1 次提交
  34. 02 7月, 2009 1 次提交
  35. 23 4月, 2009 1 次提交
  36. 11 3月, 2009 1 次提交