diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/color.rb | 2 | ||||
-rw-r--r-- | lib/commit_ext.rb | 8 | ||||
-rw-r--r-- | lib/file_size_validator.rb | 4 | ||||
-rw-r--r-- | lib/utils.rb | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/lib/color.rb b/lib/color.rb index 23feecf4071..4eabe249c18 100644 --- a/lib/color.rb +++ b/lib/color.rb @@ -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 diff --git a/lib/commit_ext.rb b/lib/commit_ext.rb index e09dbdaf8ef..411809f05ed 100644 --- a/lib/commit_ext.rb +++ b/lib/commit_ext.rb @@ -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 diff --git a/lib/file_size_validator.rb b/lib/file_size_validator.rb index 151e0ce53c0..611e584f14f 100644 --- a/lib/file_size_validator.rb +++ b/lib/file_size_validator.rb @@ -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 diff --git a/lib/utils.rb b/lib/utils.rb index e57121a3e2a..f43e2edd207 100644 --- a/lib/utils.rb +++ b/lib/utils.rb @@ -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 |