summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2011-10-26 18:46:25 +0500
committerNihad Abbasov <narkoz.2008@gmail.com>2011-10-26 18:46:25 +0500
commitd62200cad430565bd9f80befaf329297120330b5 (patch)
tree6217dd41e6f86e657513b509ed7a3f2bfdfa70ab /lib
parentf6a67fbad5119e3d95e33cfd4f4e4992707d5ba0 (diff)
downloadgitlab-ce-d62200cad430565bd9f80befaf329297120330b5.tar.gz
clean-up code
* Remove trailing whitespace * Converts hard-tabs into two-space soft-tabs * Remove consecutive blank lines
Diffstat (limited to 'lib')
-rw-r--r--lib/color.rb2
-rw-r--r--lib/commit_ext.rb8
-rw-r--r--lib/file_size_validator.rb4
-rw-r--r--lib/utils.rb4
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