lucie-cmd 0.0.14 → 0.0.15
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/lucie-cmd/commands.rb +12 -0
- data/test/functional/sh_test.rb +9 -4
- 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: c2eacc147d8e9dd05b70361955dea1b3c5eb4cda
|
4
|
+
data.tar.gz: b8c2a3285d43a198957c8d2a5b161b696c82effe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 485fc447676df60321d923531d388e49fab0d5896540cb7bb81427eb800f946347a262bb853397b3cc348983869d3b2062fd43ce7ad122e54100a18777a5a99f
|
7
|
+
data.tar.gz: d21e206dd56defd1057633ff1b7c96df2129d0ce4cecd37d2dbf3cb1162a5fb00479732201ba63d962e508e113736b70af67a226d393e9209060df4307899057
|
data/lib/lucie-cmd/commands.rb
CHANGED
@@ -34,6 +34,18 @@ module Lucie
|
|
34
34
|
@commands_helper.unset(Array(opts))
|
35
35
|
end
|
36
36
|
|
37
|
+
def error(text)
|
38
|
+
$stderr.puts colorize(text, 31)
|
39
|
+
end
|
40
|
+
|
41
|
+
def warn(text)
|
42
|
+
$stderr.puts colorize(text, 32)
|
43
|
+
end
|
44
|
+
|
45
|
+
def notice(text)
|
46
|
+
$stderr.puts colorize(text, 33)
|
47
|
+
end
|
48
|
+
|
37
49
|
def red(text)
|
38
50
|
puts colorize(text, 31)
|
39
51
|
end
|
data/test/functional/sh_test.rb
CHANGED
@@ -80,25 +80,30 @@ class ShTest < MiniTest::Spec
|
|
80
80
|
end
|
81
81
|
|
82
82
|
it "should be able to use green color for output" do
|
83
|
-
out,
|
83
|
+
out, err = capture_io do
|
84
84
|
green "Hello world"
|
85
|
+
warn "Hello world"
|
85
86
|
end
|
86
87
|
assert_equal "\e[32mHello world\e[0m\n", out
|
88
|
+
assert_equal "\e[32mHello world\e[0m\n", err
|
87
89
|
end
|
88
90
|
|
89
91
|
it "should be able to use red color for output" do
|
90
|
-
out,
|
92
|
+
out, err = capture_io do
|
91
93
|
red "Hello world"
|
94
|
+
error "Hello world"
|
92
95
|
end
|
93
96
|
assert_equal "\e[31mHello world\e[0m\n", out
|
97
|
+
assert_equal "\e[31mHello world\e[0m\n", err
|
94
98
|
end
|
95
99
|
|
96
100
|
it "should be able to use yellow color for output" do
|
97
|
-
out,
|
101
|
+
out, err = capture_io do
|
98
102
|
yellow "Hello world"
|
103
|
+
notice "Hello world"
|
99
104
|
end
|
100
105
|
assert_equal "\e[33mHello world\e[0m\n", out
|
106
|
+
assert_equal "\e[33mHello world\e[0m\n", err
|
101
107
|
end
|
102
108
|
|
103
|
-
|
104
109
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucie-cmd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nucc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|