[DRE-commits] [ruby-aruba] 55/98: Fixed offenses
Hideki Yamane
henrich at moszumanska.debian.org
Tue Mar 22 12:20:39 UTC 2016
This is an automated email from the git hooks/post-receive script.
henrich pushed a commit to branch debian/sid
in repository ruby-aruba.
commit 4a558e63ebfa9e35e1d615ca83ae2082f4176536
Author: Dennis Günnewig <dg1 at ratiodata.de>
Date: Mon Jan 4 12:24:19 2016 +0100
Fixed offenses
---
lib/aruba/colorizer.rb | 37 ++++++++++++++++----------------
lib/aruba/platforms/announcer.rb | 2 +-
lib/aruba/platforms/filesystem_status.rb | 2 +-
3 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/lib/aruba/colorizer.rb b/lib/aruba/colorizer.rb
index 327d1ef..b922fff 100644
--- a/lib/aruba/colorizer.rb
+++ b/lib/aruba/colorizer.rb
@@ -31,7 +31,7 @@ module Aruba
[ :on_blue , 44 ],
[ :on_magenta , 45 ],
[ :on_cyan , 46 ],
- [ :on_white , 47 ],
+ [ :on_white , 47 ]
]
ATTRIBUTE_NAMES = ATTRIBUTES.transpose.first
@@ -53,27 +53,28 @@ module Aruba
ATTRIBUTES.each do |c, v|
define_method(c) do |string|
- result = ''
- result << "\e[#{v}m" if Aruba::AnsiColor.coloring?
- if block_given?
- result << yield
- elsif string
- result << string
- elsif respond_to?(:to_str)
- result << to_str
- else
- return result #only switch on
- end
- result << "\e[0m" if Aruba::AnsiColor.coloring?
- result
+ result = ''
+ result << "\e[#{v}m" if Aruba::AnsiColor.coloring?
+ if block_given?
+ result << yield
+ elsif string
+ result << string
+ elsif respond_to?(:to_str)
+ result << to_str
+ else
+ return result #only switch on
+ end
+ result << "\e[0m" if Aruba::AnsiColor.coloring?
+ result
end
+
+ module_function c
end
# Regular expression that is used to scan for ANSI-sequences while
# uncoloring strings.
COLORED_REGEXP = /\e\[(?:[34][0-7]|[0-9])?m/
-
def self.included(klass)
if klass == String
ATTRIBUTES.delete(:clear)
@@ -95,13 +96,13 @@ module Aruba
end
end
- module_function
-
# Returns an array of all Aruba::Platforms::AnsiColor attributes as symbols.
def attributes
ATTRIBUTE_NAMES
end
- extend self
+
+ # extend self
+ module_function :attributes, :uncolored
end
end
diff --git a/lib/aruba/platforms/announcer.rb b/lib/aruba/platforms/announcer.rb
index daa1d8a..af94b0f 100644
--- a/lib/aruba/platforms/announcer.rb
+++ b/lib/aruba/platforms/announcer.rb
@@ -1,7 +1,7 @@
require 'shellwords'
require 'aruba/colorizer'
-Aruba::AnsiColor.coloring = false if !STDOUT.tty? && !ENV.has_key?("AUTOTEST")
+Aruba::AnsiColor.coloring = false if !STDOUT.tty? && !ENV.key?("AUTOTEST")
# Aruba
module Aruba
diff --git a/lib/aruba/platforms/filesystem_status.rb b/lib/aruba/platforms/filesystem_status.rb
index c4b5c0a..fd17338 100644
--- a/lib/aruba/platforms/filesystem_status.rb
+++ b/lib/aruba/platforms/filesystem_status.rb
@@ -60,7 +60,7 @@ module Aruba
:ctime => ctime,
:atime => atime,
:mtime => mtime,
- :size => size,
+ :size => size
}
end
end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-aruba.git
More information about the Pkg-ruby-extras-commits
mailing list