woolen_common 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/woolen_common/logger.rb +9 -5
- data/lib/woolen_common/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bfcc3f0af04c4a4230d16193e1d818c0c41413e
|
4
|
+
data.tar.gz: aa47e53628f6b73da3d28c891b3a7c0b63684cac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1bf4e00f194ec67ec1e437c6ab401fa3178a95c6e90d4b78cc5283e294ca65a320d03947aab0aba0041d85c87b48bd09072a466cafd926f756c9a8b6f984483
|
7
|
+
data.tar.gz: 52fef77f9c5c1ac560c0fb93efc7646edd77435248d2cd0fd7563d682e1eda7af82f96655d90109b4a129aaa5a59487d32c581083e3b49b0828710af9d14c61d
|
data/lib/woolen_common/logger.rb
CHANGED
@@ -78,10 +78,12 @@ module WoolenCommon
|
|
78
78
|
else
|
79
79
|
the_color_mod = WIN32_FOREGROUND_COLOR_MOD[WIN32COLORS.index(color)]
|
80
80
|
end
|
81
|
+
Win32Kernel32.setConsoleTextAttribute the_out_handle, 0x00ff & the_color_mod
|
82
|
+
print "#{message}\n"
|
83
|
+
Win32Kernel32.setConsoleTextAttribute the_out_handle, 0x00ff & (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
|
84
|
+
else
|
85
|
+
print "#{message}\n"
|
81
86
|
end
|
82
|
-
Win32Kernel32.setConsoleTextAttribute the_out_handle, 0x00ff & the_color_mod
|
83
|
-
printf "#{message}\n"
|
84
|
-
Win32Kernel32.setConsoleTextAttribute the_out_handle, 0x00ff & (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
|
85
87
|
end
|
86
88
|
|
87
89
|
def my_puts(message, color = nil)
|
@@ -161,12 +163,14 @@ module WoolenCommon
|
|
161
163
|
log_patten = File.join(File.dirname(the_path), '*.log')
|
162
164
|
# puts "need clean #{the_path}"
|
163
165
|
FileUtils.rm_f(the_path)
|
164
|
-
sort_time_files = Dir[log_patten].sort_by { |file|
|
166
|
+
sort_time_files = Dir[log_patten].sort_by { |file|
|
167
|
+
test(?M, file) if File.exists?(file)
|
168
|
+
}
|
165
169
|
# puts "sort_time_files #{sort_time_files}"
|
166
170
|
if @max_log_cnt && @max_log_cnt > 0 && sort_time_files.length > @max_log_cnt
|
167
171
|
(sort_time_files.length - @max_log_cnt).times do |cnt|
|
168
172
|
puts "need to del #{sort_time_files[cnt]} cnt #{cnt}"
|
169
|
-
FileUtils.rm_f sort_time_files[cnt]
|
173
|
+
FileUtils.rm_f sort_time_files[cnt] if File.exists?(sort_time_files[cnt])
|
170
174
|
end
|
171
175
|
end
|
172
176
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: woolen_common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- just_woolen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|