Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 9015

Show
Ignore:
Timestamp:
03/13/08 02:25:10 (2 months ago)
Author:
david
Message:

Applied the faster squish version (closes #11123) [jordi]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/lib/active_support/core_ext/string/filters.rb

    r8878 r9015  
    1212        #   " foo   bar    \n   \t   boo".squish # => "foo bar boo" 
    1313        def squish 
    14           strip.gsub(/\s+/, ' ') 
     14          dup.squish! 
    1515        end 
    1616 
    1717        # Performs a destructive squish. See String#squish. 
    1818        def squish! 
    19           replace(squish) 
     19          strip! 
     20          gsub!(/\s+/, ' ') 
     21          self 
    2022        end 
    2123      end 
  • trunk/railties/lib/initializer.rb

    r8806 r9015  
    256256            logger.set_non_blocking_io 
    257257          end 
    258         rescue StandardError =>
     258        rescue StandardError =>
    259259          logger = ActiveSupport::BufferedLogger.new(STDERR) 
    260260          logger.level = ActiveSupport::BufferedLogger::WARN