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 CHANGED
@@ -1 +1 @@
1
- 0.2.11
1
+ 0.2.12
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "githooker"
8
- s.version = "0.2.11"
8
+ s.version = "0.2.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Carl P. Corliss"]
@@ -77,12 +77,18 @@ module GitHooker
77
77
  # DSL Methods
78
78
  def args() ARGV.dup; end
79
79
 
80
- def on(options = {}, &block)
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|
@@ -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", ( action.success? ? bright_green(MARK_SUCCESS) : bright_yellow(MARK_UNKNOWN) ), warning
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: githooker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: