rabbitt-githooks 1.5.2 → 1.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc92115463443ffe80792a5f569a4242e905d21b
4
- data.tar.gz: 466abff7748a7204939a894cc8adfda9ec927b50
3
+ metadata.gz: fb31ed1dec8235280845f3b79a0903d99a6aa83a
4
+ data.tar.gz: 8476c63b4dddc57ca1715d235c4b4be3b2581366
5
5
  SHA512:
6
- metadata.gz: 9390cef0e16c4574f9908f47ca1de0e4ceb842fa0dafaeed923e57568be96b09e73db566ed292df66a439b057a9ad5107ad3ccb5d4b8e86c342679262bfa6d62
7
- data.tar.gz: 601aa784254ca0c9b1c3831c724ef90cfaa9a000e80fdc022d76c16e157aefe58d08323c97fbfdd84304dcf60e9d369914f8223be40ae5360dbdba27d8ae2d4b
6
+ metadata.gz: 053d3879bd2ba1a74b78b268e05c7b234bab3cd683e3ee34009409b8bf2ff7bf8d0151ef88e5bd250f2f162dd8c018be493ee4867a4ec5471a585cb8a765de2f
7
+ data.tar.gz: ae10de10f024a5023dba124539d642640f5c67cefefd462efb4577931091f622a5da761892a971116ed143eed51741ca3793b56188236d97c9d51c64400485c7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rabbitt-githooks (1.5.2)
4
+ rabbitt-githooks (1.5.3)
5
5
  rainbow (~> 2.0.0)
6
6
  thor (~> 0.18)
7
7
 
@@ -60,3 +60,6 @@ DEPENDENCIES
60
60
  ruby-lint (~> 2.0)
61
61
  simplecov (~> 0.9)
62
62
  yard (~> 0.7)
63
+
64
+ BUNDLED WITH
65
+ 1.10.6
@@ -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
  }
@@ -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 # rubocop:disable AssignmentInCondition
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 # rubocop:disable AssignmentInCondition
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
- $stderr.puts 'Commit failed due to errors listed above.'
255
- $stderr.puts 'Please fix and attempt your commit again.'
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 # rubocop:disable SignalException
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 # rubocop:disable SignalException
303
+ raise
299
304
  end
300
305
  end
301
306
 
@@ -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 finished? && completed?
80
- success? ? title.color_success! : title.color_failure!
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
- catch(:skip) do
93
- @success &= action.run
94
- end
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
@@ -18,5 +18,5 @@ with this program; if not, write to the Free Software Foundation, Inc.,
18
18
  =end
19
19
 
20
20
  module GitHooks
21
- VERSION = '1.5.2' unless defined? VERSION
21
+ VERSION = '1.5.3' unless defined? VERSION
22
22
  end
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.2
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.2.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