color_echo 1.1.0 → 1.2.0

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: 955540738b14db7f9f1fd1bda47f1892cdd31f2d
4
- data.tar.gz: caa4d7f6549be7b4727de5e9cb7b8e4e1f3ef53a
3
+ metadata.gz: 9de36abdfab11068e2ed52e7907bedca5118b433
4
+ data.tar.gz: 1ee5d4784d0860e95d9f63ce7e0097cef525e908
5
5
  SHA512:
6
- metadata.gz: 1e99e1abe31a23a058cfe7c999a9893b8ad73d2d10b31e2a9e622d71b971b8fe3ada618e5b83ce4ed756bf41d80b97c41d8f9b67065ce45e08a780e65e3341b1
7
- data.tar.gz: a014dd348b0de49c1bf768b5305ec20c61594e9f5dcc0e894c9cdef8f7b6188c01722401d766ad4476646462e7db78579c63ec1e2b3adf3c6d2d2039cf817388
6
+ metadata.gz: a003cc5c7903d4e1feda4cafa81a4bab5e8ca1b5c19b0694e412a788da339ef7f2fc5cbaa88c0e9103a9bb5ca982bb9abf1dcbe39889986bea8a6468cdd46b72
7
+ data.tar.gz: 34567dec9ac2acafaba4d716d0603403668d20a9dcfd223d098e6789d1d3fc11760bfbdda3b740fc963331f088d5bebff4032e74945a9c5361c6150864f1b993
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # color_echo
2
2
  Decorate the command line output with ANSI escape sequence.
3
- Text that is output by "print, puts, p" method is decorated.
3
+ Text that output by "print, puts, p" method is decorated.
4
4
  It is also can to decorate only your specified words!
5
5
 
6
- Version: 1.1.0
6
+ Version: 1.2.0
7
7
  Compliant Rubys Version: 2.0.0, 2.1.0 (for Linux)
8
8
  License: MIT
9
9
  Gems repository: http://rubygems.org/gems/color_echo
@@ -308,6 +308,9 @@ puts "Disable rainbow mode."
308
308
  ![screen shot](/images/screenshot.png)
309
309
 
310
310
  ## Release Note
311
+ * v1.2.0, 2014-01-28
312
+ * Add -e option.
313
+
311
314
  * v1.1.0, 2014-01-27
312
315
  * Modified to output the argument when the standard input is hit.
313
316
  * Add --stripe option in the command line interface.
data/bin/color_echo CHANGED
@@ -62,6 +62,7 @@ def parse_options
62
62
  @pickups = []
63
63
  @is_watch = false
64
64
  @last_lb = true
65
+ @enable_lf = false
65
66
  @is_stripe = false
66
67
 
67
68
  require "optparse"
@@ -79,6 +80,7 @@ def parse_options
79
80
  opt.on("--pickup val", "-p val") { |val| @pickups << val }
80
81
  opt.on("-w", "--watch") { @is_watch = true }
81
82
  opt.on("-n") { @last_lb = false }
83
+ opt.on("-e") { @enable_lf = true }
82
84
  opt.on("--stripe") { @is_stripe = true }
83
85
 
84
86
  begin
@@ -149,5 +151,11 @@ else
149
151
  target += $/ if @last_lb
150
152
  end
151
153
 
154
+ if @enable_lf
155
+ target.gsub!("\\r\\n", $/)
156
+ target.gsub!("\\n", $/)
157
+ target.gsub!("\\r", $/)
158
+ end
159
+
152
160
  output(target)
153
161
  end
data/bin/lib/display.rb CHANGED
@@ -21,7 +21,7 @@ def usage
21
21
  headers = ["* Usage", "* Options", "* Example"]
22
22
  headers_op = [
23
23
  "-v:", "--symbol-list:", "--index-list:", "--pickup word [--pickup word ...]:", "--fg color_name:", "--bg color_name:",
24
- "--tx text_attribute[,...]:", "--watch:", "--stripe:", "-n:", "-h:"
24
+ "--tx text_attribute[,...]:", "--watch:", "--stripe:", "-n:", "-e:", "-h:"
25
25
  ]
26
26
  CE.pickup(headers, :h_green)
27
27
  CE.pickup(headers_op, :cyan)
@@ -73,12 +73,15 @@ def usage
73
73
  puts padding * 3 + "short option is -w." + $/ + $/
74
74
 
75
75
  puts padding * 2 + "--stripe:"
76
- puts padding * 3 + "Apply the decoration for each row."
76
+ puts padding * 3 + "Decorate on every other line."
77
77
  puts padding * 3 + "pickup option is ignored." + $/ + $/
78
78
 
79
79
  puts padding * 2 + "-n:"
80
80
  puts padding * 3 + "Do not output the trailing newline." + $/ + $/
81
81
 
82
+ puts padding * 2 + "-e:"
83
+ puts padding * 3 + "Enable interpretation of line feed." + $/ + $/
84
+
82
85
  puts padding * 2 + "-h:"
83
86
  puts padding * 3 + "Show this message." + $/ + $/
84
87
 
@@ -108,7 +111,7 @@ def usage
108
111
  puts padding * 3 + %(netstat -na | color_echo -p ":80" | color_echo -p "127.0.0.1" -f h_cyan) + $/ + $/
109
112
 
110
113
  CE.once.ch :h_magenta
111
- puts padding * 2 + %(* color_echo can to decorate for each row.)
114
+ puts padding * 2 + %(* color_echo can to decorate on every other line.)
112
115
  puts padding * 3 + %(color_echo -f gray -t bold --stripe < /path/to/file)
113
116
  puts padding * 3 + %(tailf /var/log/httpd/access_log | color_echo -w -f black -b index150 -t bold --stripe) + $/ + $/
114
117
 
data/lib/color_echo.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # color_echo
2
2
  # Decorate the command line output with ANSI escape sequence.
3
- # Text that is output by "print, puts, p" method is decorated.
3
+ # Text that output by "print, puts, p" method is decorated.
4
4
  # It is also can to decorate only your specified words!
5
5
 
6
6
  require_relative "color_echo/get"
@@ -1,11 +1,11 @@
1
1
  module CE
2
2
  LIBS_NAME = "color_echo"
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
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
7
7
  #{SUMMARY}
8
- Text that is output by "print, puts, p" method is decorated.
8
+ Text that output by "print, puts, p" method is decorated.
9
9
  It is also can to decorate only your specified words!
10
10
  EOS
11
11
  end
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: color_echo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - khotta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-27 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Decorate the command line output with ANSI escape sequence.
15
- Text that is output by "print, puts, p" method is decorated.
15
+ Text that output by "print, puts, p" method is decorated.
16
16
  It is also can to decorate only your specified words!
17
17
  email:
18
18
  executables: