1. 03 7月, 2014 1 次提交
  2. 01 7月, 2014 1 次提交
  3. 25 6月, 2014 1 次提交
    • G
      Deal with regex match groups in excerpt · 124f88ea
      Gareth Rees 提交于
      Original implementation has bugs if the regex contains a match group.
      
      Example:
      
          excerpt('This is a beautiful? morning', /\b(beau\w*)\b/i, :radius => 5)
          Expected: "...is a beautiful? mor..."
          Actual: "...is a beautifulbeaut..."
      
      The original phrase was being converted to a regex and returning the text
      either side of the phrase as expected:
      
          'This is a beautiful? morning'.split(/beautiful/i, 2)
          # => ["This is a ", "? morning"]
      
      When we have a match with groups the match is returned in the array.
      
      Quoting the ruby docs: "If pattern is a Regexp, str is divided where the
      pattern matches. [...] If pattern contains groups, the respective matches will
      be returned in the array as well."
      
          'This is a beautiful? morning'.split(/\b(beau\w*)\b/iu, 2)
          # => ["This is a ", "beautiful", "? morning"]
      
      If we assume we want to split on the first match – this fix makes that
      assumption – we can pass the already assigned `phrase` variable as the place
      to split (because we already know that a match exists from line 168).
      
      Originally spotted by Louise Crow (@crowbot) at
      https://github.com/mysociety/alaveteli/pull/1557
      124f88ea
  4. 20 6月, 2014 3 次提交
  5. 15 6月, 2014 1 次提交
  6. 14 6月, 2014 5 次提交
  7. 13 6月, 2014 1 次提交
  8. 12 6月, 2014 1 次提交
  9. 05 6月, 2014 1 次提交
  10. 01 6月, 2014 1 次提交
    • J
      Fix AS::NumberHelper results with rationals · 60062cf3
      Juanjo Bazán 提交于
      :precision was incorrectly being applied to Rationals
      
      before:
        ActiveSupport::NumberHelper.number_to_rounded Rational(10, 3), precision: 2
        => "3.3"
      after:
        ActiveSupport::NumberHelper.number_to_rounded Rational(10, 3), precision: 2
        => "3.33"
      60062cf3
  11. 15 5月, 2014 1 次提交
  12. 14 5月, 2014 1 次提交
  13. 13 5月, 2014 8 次提交
  14. 12 5月, 2014 1 次提交
  15. 09 5月, 2014 5 次提交
  16. 08 5月, 2014 3 次提交
  17. 07 5月, 2014 5 次提交