mirror of
https://github.com/github/rails.git
synced 2026-01-29 16:28:09 -05:00
Applied the faster squish version (closes #11123) [jordi]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9015 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -11,12 +11,14 @@ module ActiveSupport #:nodoc:
|
||||
# string }.squish # => "Multi-line string"
|
||||
# " foo bar \n \t boo".squish # => "foo bar boo"
|
||||
def squish
|
||||
strip.gsub(/\s+/, ' ')
|
||||
dup.squish!
|
||||
end
|
||||
|
||||
# Performs a destructive squish. See String#squish.
|
||||
def squish!
|
||||
replace(squish)
|
||||
strip!
|
||||
gsub!(/\s+/, ' ')
|
||||
self
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -255,7 +255,7 @@ module Rails
|
||||
logger.auto_flushing = false
|
||||
logger.set_non_blocking_io
|
||||
end
|
||||
rescue StandardError =>e
|
||||
rescue StandardError => e
|
||||
logger = ActiveSupport::BufferedLogger.new(STDERR)
|
||||
logger.level = ActiveSupport::BufferedLogger::WARN
|
||||
logger.warn(
|
||||
|
||||
Reference in New Issue
Block a user