rabbitt-githooks 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -1
- data/lib/githooks/action.rb +5 -0
- data/lib/githooks/runner.rb +11 -6
- data/lib/githooks/section.rb +7 -7
- data/lib/githooks/version.rb +1 -1
- 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: fb31ed1dec8235280845f3b79a0903d99a6aa83a
|
4
|
+
data.tar.gz: 8476c63b4dddc57ca1715d235c4b4be3b2581366
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 053d3879bd2ba1a74b78b268e05c7b234bab3cd683e3ee34009409b8bf2ff7bf8d0151ef88e5bd250f2f162dd8c018be493ee4867a4ec5471a585cb8a765de2f
|
7
|
+
data.tar.gz: ae10de10f024a5023dba124539d642640f5c67cefefd462efb4577931091f622a5da761892a971116ed143eed51741ca3793b56188236d97c9d51c64400485c7
|
data/Gemfile.lock
CHANGED
data/lib/githooks/action.rb
CHANGED
@@ -73,7 +73,11 @@ module GitHooks
|
|
73
73
|
begin
|
74
74
|
was_skipped = catch(:skip) do
|
75
75
|
@success &= @on.call
|
76
|
+
# was_skipped gets set to the return value of the block
|
77
|
+
# which we want to be false unless `throw :skip` is called
|
78
|
+
false
|
76
79
|
end
|
80
|
+
return @success
|
77
81
|
rescue StandardError => e
|
78
82
|
$stderr.puts "Exception thrown during action call: #{e.class.name}: #{e.message}"
|
79
83
|
if GitHooks.debug?
|
@@ -85,6 +89,7 @@ module GitHooks
|
|
85
89
|
end
|
86
90
|
@success = false
|
87
91
|
ensure
|
92
|
+
STDERR.puts "WAS_SKIPPED? -> #{was_skipped.inspect} (#{@status.inspect})" if GitHooks.debug?
|
88
93
|
was_skipped ? skipped! : finished!
|
89
94
|
end
|
90
95
|
}
|
data/lib/githooks/runner.rb
CHANGED
@@ -81,12 +81,12 @@ module GitHooks
|
|
81
81
|
bootstrapper = Pathname.new(options.bootstrap).realpath if options.bootstrap
|
82
82
|
|
83
83
|
if entry_path.directory?
|
84
|
-
if repository.hooks_path
|
84
|
+
if repository.hooks_path
|
85
85
|
fail Error::AlreadyAttached, "Repository [#{repo_path}] already attached to hook path #{repository.hooks_path} - Detach to continue."
|
86
86
|
end
|
87
87
|
repository.config.set('hooks-path', entry_path)
|
88
88
|
elsif entry_path.executable?
|
89
|
-
if repository.hooks_script
|
89
|
+
if repository.hooks_script
|
90
90
|
fail Error::AlreadyAttached, "Repository [#{repo_path}] already attached to script #{repository.hooks_script}. Detach to continue."
|
91
91
|
end
|
92
92
|
repository.config.set('script', entry_path)
|
@@ -251,8 +251,13 @@ module GitHooks
|
|
251
251
|
success = false if ENV['GITHOOKS_FORCE_FAIL']
|
252
252
|
|
253
253
|
unless success
|
254
|
-
|
255
|
-
|
254
|
+
command = case phase
|
255
|
+
when /commit/i then 'commit'
|
256
|
+
when /push/i then 'push'
|
257
|
+
else phase
|
258
|
+
end
|
259
|
+
$stderr.puts "#{command.capitalize} failed due to errors listed above."
|
260
|
+
$stderr.puts "Please fix and attempt your #{command} again."
|
256
261
|
end
|
257
262
|
|
258
263
|
exit(success ? 0 : 1)
|
@@ -291,11 +296,11 @@ module GitHooks
|
|
291
296
|
::Bundler.require(:default)
|
292
297
|
rescue LoadError
|
293
298
|
puts %q"Unable to load bundler - please make sure it's installed."
|
294
|
-
raise
|
299
|
+
raise
|
295
300
|
rescue ::Bundler::GemNotFound => e
|
296
301
|
puts "Error: #{e.message}"
|
297
302
|
puts 'Did you bundle install your Gemfile?'
|
298
|
-
raise
|
303
|
+
raise
|
299
304
|
end
|
300
305
|
end
|
301
306
|
|
data/lib/githooks/section.rb
CHANGED
@@ -62,7 +62,7 @@ module GitHooks
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def completed?
|
65
|
-
@actions.all?(&:finished?)
|
65
|
+
finished? && @actions.all?(&:finished?)
|
66
66
|
end
|
67
67
|
|
68
68
|
def wait_count
|
@@ -76,8 +76,9 @@ module GitHooks
|
|
76
76
|
def colored_name(phase = GitHooks::HOOK_NAME)
|
77
77
|
title = name(phase)
|
78
78
|
return title.color_skipped! if @actions.all?(&:skipped?)
|
79
|
-
return title.color_unknown! unless
|
80
|
-
|
79
|
+
return title.color_unknown! unless completed?
|
80
|
+
return title.color_failure! unless success?
|
81
|
+
title.color_success!
|
81
82
|
end
|
82
83
|
|
83
84
|
def key_name
|
@@ -89,10 +90,9 @@ module GitHooks
|
|
89
90
|
begin
|
90
91
|
time_start = Time.now
|
91
92
|
actions.collect { |action|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
@success
|
93
|
+
@success &= action.run.tap { |r|
|
94
|
+
STDERR.puts "#{action.title} -> #{r.inspect}" if GitHooks.debug?
|
95
|
+
}
|
96
96
|
}.all?
|
97
97
|
ensure
|
98
98
|
@benchmark = Time.now - time_start
|
data/lib/githooks/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbitt-githooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl P. Corliss
|
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
211
|
rubyforge_project:
|
212
|
-
rubygems_version: 2.
|
212
|
+
rubygems_version: 2.4.8
|
213
213
|
signing_key:
|
214
214
|
specification_version: 4
|
215
215
|
summary: framework for building git hooks tests
|