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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 662b6d271e9f5b47465b7acc6f6d8bfc92df5720
4
- data.tar.gz: e95a24c60cf9028955027caa738141e5285f572e
3
+ metadata.gz: 9bfcc3f0af04c4a4230d16193e1d818c0c41413e
4
+ data.tar.gz: aa47e53628f6b73da3d28c891b3a7c0b63684cac
5
5
  SHA512:
6
- metadata.gz: c5df46c8ff4475b790be9e79a779f58c976a9aea7fb06a0a748d62565105f2dbf3951a66d10f6da5e15e86c6679d9c61efd2a89673aeb6ec9c7249a2b49de4ad
7
- data.tar.gz: 73b71f744b1a530c4ec6a713b707f74a9df24d03c6a39f99ce0c8b06f0df5c65747c80dec226d772f7a7cafb22dc494632d9b8a748ea49b10b4186f76ee0102f
6
+ metadata.gz: e1bf4e00f194ec67ec1e437c6ab401fa3178a95c6e90d4b78cc5283e294ca65a320d03947aab0aba0041d85c87b48bd09072a466cafd926f756c9a8b6f984483
7
+ data.tar.gz: 52fef77f9c5c1ac560c0fb93efc7646edd77435248d2cd0fd7563d682e1eda7af82f96655d90109b4a129aaa5a59487d32c581083e3b49b0828710af9d14c61d
@@ -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| test(?M, 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
@@ -1,3 +1,3 @@
1
1
  module WoolenCommon
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  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.5
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-06-14 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler