githooker 0.2.11 → 0.2.12
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/githooker.gemspec +1 -1
- data/lib/githooker/action.rb +7 -1
- data/lib/githooker/runner.rb +8 -2
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.12
|
data/githooker.gemspec
CHANGED
data/lib/githooker/action.rb
CHANGED
@@ -77,12 +77,18 @@ module GitHooker
|
|
77
77
|
# DSL Methods
|
78
78
|
def args() ARGV.dup; end
|
79
79
|
|
80
|
-
def
|
80
|
+
def on_each(options = {}, &block)
|
81
81
|
block = block || options.delete(:call)
|
82
82
|
Repo.match_files_on(options).collect { |file|
|
83
83
|
block.call(file)
|
84
84
|
}.all? # test that they all returned true
|
85
85
|
end
|
86
|
+
alias :on :on_each
|
87
|
+
|
88
|
+
def on_all(options = {}, &block)
|
89
|
+
block = block || options.delete(:call)
|
90
|
+
block.call(Repo.match_files_on(options))
|
91
|
+
end
|
86
92
|
|
87
93
|
def execute(cmd, output_line_prefix=nil)
|
88
94
|
Open3.popen3(cmd) { |i, o, e, t|
|
data/lib/githooker/runner.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'githooker/terminal_colors'
|
2
|
+
|
1
3
|
module GitHooker
|
2
4
|
module Runner
|
3
5
|
extend TerminalColors
|
@@ -24,11 +26,15 @@ module GitHooker
|
|
24
26
|
printf " %d. [ %s ] %s\n", (index + 1), action.state_symbol, action.colored_title
|
25
27
|
|
26
28
|
action.errors.each do |error|
|
27
|
-
printf " %s %s\n", bright_red(MARK_FAILURE), error
|
29
|
+
printf " %s %s\n", bright_red(TerminalColors::MARK_FAILURE), error
|
28
30
|
end unless action.errors.empty?
|
29
31
|
|
30
32
|
action.warnings.each do |warning|
|
31
|
-
printf " %s %s\n",
|
33
|
+
printf " %s %s\n",
|
34
|
+
( action.success? ?
|
35
|
+
bright_green(TerminalColors::MARK_SUCCESS) :
|
36
|
+
bright_yellow(TerminalColors::MARK_UNKNOWN)
|
37
|
+
), warning
|
32
38
|
end unless action.warnings.empty?
|
33
39
|
end
|
34
40
|
puts
|