clean-up code

* Remove trailing whitespace
  * Converts hard-tabs into two-space soft-tabs
  * Remove consecutive blank lines
This commit is contained in:
Nihad Abbasov 2011-10-26 18:46:25 +05:00
parent f6a67fbad5
commit d62200cad4
112 changed files with 1408 additions and 1437 deletions

View file

@ -17,7 +17,7 @@ module Color
def command(string)
`#{string}`
if $?.to_i > 0
if $?.to_i > 0
puts red " == #{string} - FAIL"
puts red " == Error during configure"
exit

View file

@ -1,11 +1,11 @@
module CommitExt
def safe_message
message.encode("UTF-8",
:invalid => :replace,
:undef => :replace,
message.encode("UTF-8",
:invalid => :replace,
:undef => :replace,
:universal_newline => true,
:replace => "")
rescue
rescue
"-- invalid encoding for commit message"
end
end

View file

@ -33,7 +33,7 @@ class FileSizeValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.kind_of? CarrierWave::Uploader::Base
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
CHECKS.each do |key, validity_check|
@ -53,7 +53,7 @@ class FileSizeValidator < ActiveModel::EachValidator
record.errors.add(attribute, MESSAGES[key], errors_options)
end
end
def help
Helper.instance
end

View file

@ -1,8 +1,8 @@
module Utils
module FileHelper
def binary?(string)
def binary?(string)
string.each_byte do |x|
x.nonzero? or return true
x.nonzero? or return true
end
false
end