cap-util 0.1.2 → 0.2.0
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.
- data/lib/cap-util/run.rb +4 -4
- data/lib/cap-util/say.rb +7 -12
- data/lib/cap-util/time.rb +1 -1
- data/lib/cap-util/version.rb +1 -1
- data/test/cap_util_tests.rb +3 -3
- metadata +3 -3
data/lib/cap-util/run.rb
CHANGED
@@ -5,9 +5,9 @@ module CapUtil
|
|
5
5
|
def self.run_locally(cmd_str)
|
6
6
|
cmd = Scmd.new(cmd_str)
|
7
7
|
|
8
|
-
|
8
|
+
say " * running `#{cmd}'"
|
9
9
|
cmd.run
|
10
|
-
|
10
|
+
say_error(cmd.stderr) if !cmd.success?
|
11
11
|
|
12
12
|
cmd
|
13
13
|
end
|
@@ -15,9 +15,9 @@ module CapUtil
|
|
15
15
|
def self.run_locally_with_stdin(cmd_str, input)
|
16
16
|
cmd = Scmd.new(cmd_str)
|
17
17
|
|
18
|
-
|
18
|
+
say " * running `#{cmd}'"
|
19
19
|
cmd.run(input)
|
20
|
-
|
20
|
+
say_error(cmd.stderr) if !cmd.success?
|
21
21
|
|
22
22
|
cmd
|
23
23
|
end
|
data/lib/cap-util/say.rb
CHANGED
@@ -7,19 +7,15 @@ module CapUtil
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.say(msg, *args)
|
10
|
-
Capistrano::CLI.ui.say(
|
10
|
+
Capistrano::CLI.ui.say(msg, *args)
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.
|
14
|
-
say("
|
13
|
+
def self.say_error(msg, *args)
|
14
|
+
say(" #{color "[ERROR]", :bold, :red} #{msg}", *args)
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.
|
18
|
-
say("
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.log_warning(msg, *args)
|
22
|
-
say(" #{color "[WARN]", :bold, :yellow} #{msg}", *args)
|
17
|
+
def self.say_warning(msg, *args)
|
18
|
+
say(" #{color "[WARN]", :bold, :yellow} #{msg}", *args)
|
23
19
|
end
|
24
20
|
|
25
21
|
module Say
|
@@ -32,9 +28,8 @@ module CapUtil
|
|
32
28
|
module SayMethods
|
33
29
|
def color(*args); CapUtil.color(*args); end
|
34
30
|
def say(*args); CapUtil.say(*args); end
|
35
|
-
def
|
36
|
-
def
|
37
|
-
def log_warning(*args); CapUtil.log_warning(*args); end
|
31
|
+
def say_error(*args); CapUtil.say_error(*args); end
|
32
|
+
def say_warning(*args); CapUtil.say_warning(*args); end
|
38
33
|
end
|
39
34
|
|
40
35
|
end
|
data/lib/cap-util/time.rb
CHANGED
data/lib/cap-util/version.rb
CHANGED
data/test/cap_util_tests.rb
CHANGED
@@ -10,7 +10,7 @@ module CapUtil
|
|
10
10
|
subject { @mod }
|
11
11
|
|
12
12
|
should have_imeth :halt, :time
|
13
|
-
should have_imeths :color, :say, :
|
13
|
+
should have_imeths :color, :say, :say_error, :say_warning
|
14
14
|
should have_imeths :run_locally, :run_locally_with_stdin
|
15
15
|
|
16
16
|
end
|
@@ -35,8 +35,8 @@ module CapUtil
|
|
35
35
|
should have_cmeth :halt
|
36
36
|
should have_imeth :halt
|
37
37
|
|
38
|
-
should have_cmeths :color, :say, :
|
39
|
-
should have_imeths :color, :say, :
|
38
|
+
should have_cmeths :color, :say, :say_error, :say_warning
|
39
|
+
should have_imeths :color, :say, :say_error, :say_warning
|
40
40
|
|
41
41
|
should have_cmeths :run_locally, :run_locally_with_stdin
|
42
42
|
should have_imeths :run_locally, :run_locally_with_stdin
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cap-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
- 1
|
9
8
|
- 2
|
10
|
-
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|