color_echo 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e03c82c73008a98fc0daa0e8d2a8da08f85fb696
4
- data.tar.gz: 3178951912dfeaadf75a2b0d19f23dbbb0a37817
3
+ metadata.gz: 564664ae1cadd7fb61bf2cf2fc4b1655ca698218
4
+ data.tar.gz: f3f0e8a464982373e29b32ad656d0532316dc40b
5
5
  SHA512:
6
- metadata.gz: 5e4d8511962670bb346d3838c2d6713fcae884730ca55f8ff0aed15045e633ec402ac8d57574a86dd405f367a932d0333dd68a0daec58caeac48289ef28b9bf5
7
- data.tar.gz: 550071bdb3785ad5b7c4bacbeb23b07773f5bc37bd3fa577116cb18e84860ba49691781fef67ff8fe1c68a01273fe249508c83ad54bd9d524e6a4f5a0bc37145
6
+ metadata.gz: d2a472a0aa86d6ddfe53c2f51d5fa704be094b07b01f26f4fd42ea38df348a7c0c96f12546512cb9a44cd74652cb7c69f8dc5ef6249bb3913550d621c06fe264
7
+ data.tar.gz: c661bbda3f75c0ceced991791c5f8327a4a351a4d0697e037697261ca1969280c97451b8623f73082ed9fa1d49ed9631cf41e611ac421a8235b83bf264bfdaff
@@ -1,7 +1,7 @@
1
1
  # color_echo
2
2
  color_echo はコマンドライン出力に色をつけるライブラリです。
3
3
 
4
- Version: 2.0.0
4
+ Version: 2.0.1
5
5
  Compliant Rubys Version: 2.0.0, 2.1.0 (for Linux)
6
6
  License: MIT
7
7
  Gems repository: http://rubygems.org/gems/color_echo
@@ -201,20 +201,6 @@ ex.) CE.reset [:fg. :tx] #=> foreground color and ext attribute will be reset.
201
201
  - Parameter cnt -> integer
202
202
  - Return -> self
203
203
 
204
-
205
- #### CE.enable_refresh(scope=:all)
206
- 与えられた入力に対して可能な限りシーケンスコードを取り除きます。
207
- - Parameter scope -> symbol
208
- - :all: いかなる時もシーケンスコードを取り除きます。
209
- - :prematch: CE.pickupで指定したパターンにマッチした時だけシーケンスコードを取り除きます。
210
- - Return -> self
211
-
212
-
213
- #### CE.disable_refresh
214
- 与えられた入力に対してシーケンスコードを取り除きません。デフォルトはこの挙動です。
215
- - Return -> self
216
-
217
-
218
204
  ```ruby
219
205
  CE.once.ch :h_yellow, :h_red, :underscore
220
206
  puts "decorated"
@@ -230,6 +216,20 @@ puts "switch off"
230
216
  ```
231
217
  ![screen shot](/images/result_off.png)
232
218
 
219
+
220
+ #### CE.enable_refresh(scope=:all)
221
+ 与えられた入力に対して可能な限りシーケンスコードを取り除きます。
222
+ - Parameter scope -> symbol
223
+ - :all: いかなる時もシーケンスコードを取り除きます。
224
+ - :prematch: CE.pickupで指定したパターンにマッチした時だけシーケンスコードを取り除きます。
225
+ - Return -> self
226
+
227
+
228
+ #### CE.disable_refresh
229
+ 与えられた入力に対してシーケンスコードを取り除きません。デフォルトはこの挙動です。
230
+ - Return -> self
231
+
232
+
233
233
  #### CE.unuse
234
234
  このメソッドがコールされた時点で color_echo の機能を無効にします。
235
235
 
@@ -331,7 +331,10 @@ puts "Disable rainbow mode."
331
331
  ![screen shot](/images/screenshot.png)
332
332
 
333
333
  ## Release Note
334
- * v2.0.0, 2014-05-20
334
+ * v2.0.1, 2015-08-21
335
+ * コマンドラインインターフェースで複数行の入力を与えられたときマッチした行のハイライトが正しくつかない問題を修正しました。
336
+
337
+ * v2.0.0, 2015-05-20
335
338
  * 次の新しいメソッドを追加しました -> CE::hitline, CE.enable_refresh, CE.disable_refresh
336
339
  * CE.reset のスコープに CE.pickupで指定したパターンとマッチした行に適用するシーケンスコードをリセットする ':hitline' を追加しました。
337
340
  * tailfコマンドと colorechoコマンドを複数パイプで渡すと出力がバッファに溜まりリアルタイムで出力されない問題を解消しました。
@@ -339,7 +342,7 @@ puts "Disable rainbow mode."
339
342
  * 対話モードを ctl + c で終了した時の WARNINGを表示しないようにしました。
340
343
  * コマンドラインインターフェースのデフォルトの文字色をいかなる時も 'yellow' になるようにしました。
341
344
 
342
- * v1.3.0, 2014-02-06
345
+ * v1.3.0, 2015-02-06
343
346
  * Change some options help messages.
344
347
  * You can call 'colorecho' as 'color_echo' in command line interface.
345
348
 
data/README.md CHANGED
@@ -200,21 +200,6 @@ Reset automatically after cnt times output.
200
200
  - Parameter cnt -> integer
201
201
  - Return -> self
202
202
 
203
-
204
- #### CE.enable_refresh(scope=:all)
205
- Try to remove the sequence code from the given.
206
- - Parameter scope -> symbol
207
- - :all: Try to remove the sequence code from the given always.
208
- - :prematch: If given matches, Try to remove sequence code from it.
209
- - Return -> self
210
-
211
-
212
- #### CE.disable_refresh
213
- Not try to remove the sequence code from the given.
214
- Default is this.
215
- - Return -> self
216
-
217
-
218
203
  ```ruby
219
204
  CE.once.ch :h_yellow, :h_red, :underscore
220
205
  puts "decorated"
@@ -230,6 +215,21 @@ puts "switch off"
230
215
  ```
231
216
  ![screen shot](/images/result_off.png)
232
217
 
218
+
219
+ #### CE.enable_refresh(scope=:all)
220
+ Try to remove the sequence code from the given.
221
+ - Parameter scope -> symbol
222
+ - :all: Try to remove the sequence code from the given always.
223
+ - :prematch: If given matches, Try to remove sequence code from it.
224
+ - Return -> self
225
+
226
+
227
+ #### CE.disable_refresh
228
+ Not try to remove the sequence code from the given.
229
+ Default is this.
230
+ - Return -> self
231
+
232
+
233
233
  #### CE.unuse
234
234
  Force ignore the function of this library.
235
235
 
@@ -332,7 +332,10 @@ puts "Disable rainbow mode."
332
332
  ![screen shot](/images/screenshot.png)
333
333
 
334
334
  ## Release Note
335
- * v2.0.0, 2014-05-20
335
+ * v2.0.1, 2015-08-21
336
+ * Fixed bug that highlight of line is incorrect in commandline interface.
337
+
338
+ * v2.0.0, 2015-05-20
336
339
  * Add new method -> CE::hitline, CE.enable_refresh, CE.disable_refresh, Please check the reference.
337
340
  * Can to select new parameter ':hitline' in CE.reset.
338
341
  * Flushes any buffered data when output data to STDOUT.
@@ -340,7 +343,7 @@ puts "Disable rainbow mode."
340
343
  * Fixed not to be output the interruptted message, When you pressed ctl + C.
341
344
  * Fixed default foreground color to yellow in command line interface.
342
345
 
343
- * v1.3.0, 2014-02-06
346
+ * v1.3.0, 2015-02-06
344
347
  * Change some options help messages.
345
348
  * You can call 'colorecho' as 'color_echo' in command line interface.
346
349
 
@@ -1,17 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  require_relative "./lib/display"
3
- def dump(target)
4
- require "pp"
5
- require "stringio"
6
-
7
- File.open("/tmp/ruby.log", "a+") do |f|
8
- $stdout = StringIO.new
9
- pp target
10
- strio = $stdout
11
- $stdout = STDOUT
12
- f.print strio.string
13
- end
14
- end
15
4
 
16
5
  #
17
6
  # Load color_echo
@@ -76,11 +65,24 @@ end
76
65
  def output(target)
77
66
  output_stripe(target) if @is_stripe
78
67
 
79
- eval(@code_decorate)
80
- begin
81
- print CE.get(target)
82
- rescue Errno::EPIPE
68
+ # performance down when it read line by line..?
69
+ targets = target.split($/)
70
+ total = targets.count
71
+ cnt = 0
72
+ targets.each do |record|
73
+ cnt += 1
74
+ eval(@code_decorate)
75
+
76
+ begin
77
+ if !@last_lb && cnt == total
78
+ print CE.get(record)
79
+ else
80
+ puts CE.get(record)
81
+ end
82
+ rescue Errno::EPIPE
83
+ end
83
84
  end
85
+
84
86
  exit 0
85
87
  end
86
88
 
@@ -1,17 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  require_relative "./lib/display"
3
- def dump(target)
4
- require "pp"
5
- require "stringio"
6
-
7
- File.open("/tmp/ruby.log", "a+") do |f|
8
- $stdout = StringIO.new
9
- pp target
10
- strio = $stdout
11
- $stdout = STDOUT
12
- f.print strio.string
13
- end
14
- end
15
4
 
16
5
  #
17
6
  # Load color_echo
@@ -76,11 +65,24 @@ end
76
65
  def output(target)
77
66
  output_stripe(target) if @is_stripe
78
67
 
79
- eval(@code_decorate)
80
- begin
81
- print CE.get(target)
82
- rescue Errno::EPIPE
68
+ # performance down when it read line by line..?
69
+ targets = target.split($/)
70
+ total = targets.count
71
+ cnt = 0
72
+ targets.each do |record|
73
+ cnt += 1
74
+ eval(@code_decorate)
75
+
76
+ begin
77
+ if !@last_lb && cnt == total
78
+ print CE.get(record)
79
+ else
80
+ puts CE.get(record)
81
+ end
82
+ rescue Errno::EPIPE
83
+ end
83
84
  end
85
+
84
86
  exit 0
85
87
  end
86
88
 
@@ -1,6 +1,6 @@
1
1
  module CE
2
2
  LIBS_NAME = "color_echo"
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  SUMMARY = "Decorate the command line output with ANSI escape sequence."
5
5
  DOCS_PAGE = "https://github.com/khotta/color_echo"
6
6
  DESCRIPTION = <<EOS
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: color_echo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - khotta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-08-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Decorate the command line output with ANSI escape sequence.