overcommit 0.19.0 → 0.20.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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/config/default.yml +2 -1
  3. data/lib/overcommit/cli.rb +41 -1
  4. data/lib/overcommit/configuration_validator.rb +1 -2
  5. data/lib/overcommit/exceptions.rb +3 -0
  6. data/lib/overcommit/git_repo.rb +9 -1
  7. data/lib/overcommit/hook/base.rb +54 -32
  8. data/lib/overcommit/hook/commit_msg/text_width.rb +23 -16
  9. data/lib/overcommit/hook/pre_commit/base.rb +61 -1
  10. data/lib/overcommit/hook/pre_commit/haml_lint.rb +9 -13
  11. data/lib/overcommit/hook/pre_commit/image_optim.rb +3 -3
  12. data/lib/overcommit/hook/pre_commit/jscs.rb +5 -13
  13. data/lib/overcommit/hook/pre_commit/jsxcs.rb +5 -13
  14. data/lib/overcommit/hook/pre_commit/reek.rb +8 -15
  15. data/lib/overcommit/hook/pre_commit/rubocop.rb +9 -15
  16. data/lib/overcommit/hook/pre_commit/scss_lint.rb +9 -13
  17. data/lib/overcommit/hook_context/base.rb +3 -2
  18. data/lib/overcommit/hook_context/pre_commit.rb +11 -3
  19. data/lib/overcommit/hook_context/run_all.rb +39 -0
  20. data/lib/overcommit/hook_context.rb +2 -2
  21. data/lib/overcommit/hook_loader/base.rb +1 -3
  22. data/lib/overcommit/hook_loader/plugin_hook_loader.rb +26 -16
  23. data/lib/overcommit/hook_runner.rb +19 -9
  24. data/lib/overcommit/installer.rb +9 -5
  25. data/lib/overcommit/logger.rb +27 -0
  26. data/lib/overcommit/message_processor.rb +132 -0
  27. data/lib/overcommit/printer.rb +21 -27
  28. data/lib/overcommit/subprocess.rb +25 -16
  29. data/lib/overcommit/utils.rb +20 -0
  30. data/lib/overcommit/version.rb +1 -1
  31. data/lib/overcommit.rb +0 -1
  32. data/template-dir/hooks/commit-msg +9 -38
  33. data/template-dir/hooks/overcommit-hook +9 -38
  34. data/template-dir/hooks/post-checkout +9 -38
  35. data/template-dir/hooks/pre-commit +9 -38
  36. metadata +63 -76
  37. data/lib/overcommit/user_input.rb +0 -26
@@ -18,11 +18,6 @@ if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
18
18
  exit
19
19
  end
20
20
 
21
- # Required for Ruby 1.8 compatibility (for older OSX versions)
22
- if RUBY_VERSION.split('.')[0..1] == %w[1 8]
23
- require 'rubygems'
24
- end
25
-
26
21
  hook_type = File.basename($0)
27
22
  if hook_type == 'overcommit-hook'
28
23
  puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
@@ -33,34 +28,10 @@ end
33
28
  begin
34
29
  require 'overcommit'
35
30
  rescue LoadError
36
- puts 'Overcommit is not installed. Install it to manage git hooks for ' \
37
- 'this repository? (y/n)'
38
-
39
- # If the hook isn't interactive, we need to map STDIN to keyboard manually
40
- STDIN.reopen('/dev/tty') if STDIN.eof?
41
-
42
- if (answer = gets) && answer.strip.downcase.start_with?('y')
43
- puts 'Installing...'
44
- if system('gem install overcommit')
45
- Gem.clear_paths # Reset load paths so newly installed gem is found
46
- require 'overcommit'
47
- else
48
- puts 'Unable to install Overcommit -- try running `gem install overcommit`'
49
- exit 69 # EX_UNAVAILABLE
50
- end
51
- else
52
- puts 'You chose not to install Overcommit'
53
- puts "No hooks were run for '#{hook_type}'"
54
- exit
55
- end
56
- end
57
-
58
- if Gem::Version.new(Overcommit::VERSION) < Gem::Version.new('0.6.0')
59
- puts "Installed version of Overcommit (#{Overcommit::VERSION}) is " \
60
- "incompatible with the installed hooks.\n" \
61
- 'Run `gem install overcommit && overcommit --install` to ensure ' \
62
- "you're up-to-date."
63
- exit 64 # EX_USAGE
31
+ puts 'This repository contains hooks installed by Overcommit, but the ' \
32
+ "overcommit gem is not installed.\n" \
33
+ 'Install it with `gem install overcommit`.'
34
+ exit
64
35
  end
65
36
 
66
37
  begin
@@ -68,19 +39,17 @@ begin
68
39
 
69
40
  # Ensure master hook is up-to-date
70
41
  installer = Overcommit::Installer.new(logger)
71
- if installer.run(Overcommit::Utils.repo_root, :action => :update)
42
+ if installer.run(Overcommit::Utils.repo_root, action: :update)
72
43
  exec($0, *ARGV) # Execute the updated hook with all original arguments
73
44
  end
74
45
 
75
46
  config = Overcommit::ConfigurationLoader.load_repo_config
76
47
 
77
- context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
48
+ context = Overcommit::HookContext.create(hook_type, config, ARGV)
78
49
  config.apply_environment!(context, ENV)
79
50
 
80
- input = Overcommit::UserInput.new(STDIN)
81
-
82
51
  printer = Overcommit::Printer.new(logger, context)
83
- runner = Overcommit::HookRunner.new(config, logger, context, input, printer)
52
+ runner = Overcommit::HookRunner.new(config, logger, context, printer)
84
53
 
85
54
  status = runner.run
86
55
 
@@ -102,6 +71,8 @@ rescue Overcommit::Exceptions::HookCancelled
102
71
  rescue Overcommit::Exceptions::InvalidGitRepo => error
103
72
  puts error
104
73
  exit 64 # EX_USAGE
74
+ rescue Overcommit::Exceptions::InvalidHookSignature
75
+ exit 1
105
76
  rescue => error
106
77
  puts error.message
107
78
  puts error.backtrace
@@ -18,11 +18,6 @@ if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
18
18
  exit
19
19
  end
20
20
 
21
- # Required for Ruby 1.8 compatibility (for older OSX versions)
22
- if RUBY_VERSION.split('.')[0..1] == %w[1 8]
23
- require 'rubygems'
24
- end
25
-
26
21
  hook_type = File.basename($0)
27
22
  if hook_type == 'overcommit-hook'
28
23
  puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
@@ -33,34 +28,10 @@ end
33
28
  begin
34
29
  require 'overcommit'
35
30
  rescue LoadError
36
- puts 'Overcommit is not installed. Install it to manage git hooks for ' \
37
- 'this repository? (y/n)'
38
-
39
- # If the hook isn't interactive, we need to map STDIN to keyboard manually
40
- STDIN.reopen('/dev/tty') if STDIN.eof?
41
-
42
- if (answer = gets) && answer.strip.downcase.start_with?('y')
43
- puts 'Installing...'
44
- if system('gem install overcommit')
45
- Gem.clear_paths # Reset load paths so newly installed gem is found
46
- require 'overcommit'
47
- else
48
- puts 'Unable to install Overcommit -- try running `gem install overcommit`'
49
- exit 69 # EX_UNAVAILABLE
50
- end
51
- else
52
- puts 'You chose not to install Overcommit'
53
- puts "No hooks were run for '#{hook_type}'"
54
- exit
55
- end
56
- end
57
-
58
- if Gem::Version.new(Overcommit::VERSION) < Gem::Version.new('0.6.0')
59
- puts "Installed version of Overcommit (#{Overcommit::VERSION}) is " \
60
- "incompatible with the installed hooks.\n" \
61
- 'Run `gem install overcommit && overcommit --install` to ensure ' \
62
- "you're up-to-date."
63
- exit 64 # EX_USAGE
31
+ puts 'This repository contains hooks installed by Overcommit, but the ' \
32
+ "overcommit gem is not installed.\n" \
33
+ 'Install it with `gem install overcommit`.'
34
+ exit
64
35
  end
65
36
 
66
37
  begin
@@ -68,19 +39,17 @@ begin
68
39
 
69
40
  # Ensure master hook is up-to-date
70
41
  installer = Overcommit::Installer.new(logger)
71
- if installer.run(Overcommit::Utils.repo_root, :action => :update)
42
+ if installer.run(Overcommit::Utils.repo_root, action: :update)
72
43
  exec($0, *ARGV) # Execute the updated hook with all original arguments
73
44
  end
74
45
 
75
46
  config = Overcommit::ConfigurationLoader.load_repo_config
76
47
 
77
- context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
48
+ context = Overcommit::HookContext.create(hook_type, config, ARGV)
78
49
  config.apply_environment!(context, ENV)
79
50
 
80
- input = Overcommit::UserInput.new(STDIN)
81
-
82
51
  printer = Overcommit::Printer.new(logger, context)
83
- runner = Overcommit::HookRunner.new(config, logger, context, input, printer)
52
+ runner = Overcommit::HookRunner.new(config, logger, context, printer)
84
53
 
85
54
  status = runner.run
86
55
 
@@ -102,6 +71,8 @@ rescue Overcommit::Exceptions::HookCancelled
102
71
  rescue Overcommit::Exceptions::InvalidGitRepo => error
103
72
  puts error
104
73
  exit 64 # EX_USAGE
74
+ rescue Overcommit::Exceptions::InvalidHookSignature
75
+ exit 1
105
76
  rescue => error
106
77
  puts error.message
107
78
  puts error.backtrace
@@ -18,11 +18,6 @@ if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
18
18
  exit
19
19
  end
20
20
 
21
- # Required for Ruby 1.8 compatibility (for older OSX versions)
22
- if RUBY_VERSION.split('.')[0..1] == %w[1 8]
23
- require 'rubygems'
24
- end
25
-
26
21
  hook_type = File.basename($0)
27
22
  if hook_type == 'overcommit-hook'
28
23
  puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
@@ -33,34 +28,10 @@ end
33
28
  begin
34
29
  require 'overcommit'
35
30
  rescue LoadError
36
- puts 'Overcommit is not installed. Install it to manage git hooks for ' \
37
- 'this repository? (y/n)'
38
-
39
- # If the hook isn't interactive, we need to map STDIN to keyboard manually
40
- STDIN.reopen('/dev/tty') if STDIN.eof?
41
-
42
- if (answer = gets) && answer.strip.downcase.start_with?('y')
43
- puts 'Installing...'
44
- if system('gem install overcommit')
45
- Gem.clear_paths # Reset load paths so newly installed gem is found
46
- require 'overcommit'
47
- else
48
- puts 'Unable to install Overcommit -- try running `gem install overcommit`'
49
- exit 69 # EX_UNAVAILABLE
50
- end
51
- else
52
- puts 'You chose not to install Overcommit'
53
- puts "No hooks were run for '#{hook_type}'"
54
- exit
55
- end
56
- end
57
-
58
- if Gem::Version.new(Overcommit::VERSION) < Gem::Version.new('0.6.0')
59
- puts "Installed version of Overcommit (#{Overcommit::VERSION}) is " \
60
- "incompatible with the installed hooks.\n" \
61
- 'Run `gem install overcommit && overcommit --install` to ensure ' \
62
- "you're up-to-date."
63
- exit 64 # EX_USAGE
31
+ puts 'This repository contains hooks installed by Overcommit, but the ' \
32
+ "overcommit gem is not installed.\n" \
33
+ 'Install it with `gem install overcommit`.'
34
+ exit
64
35
  end
65
36
 
66
37
  begin
@@ -68,19 +39,17 @@ begin
68
39
 
69
40
  # Ensure master hook is up-to-date
70
41
  installer = Overcommit::Installer.new(logger)
71
- if installer.run(Overcommit::Utils.repo_root, :action => :update)
42
+ if installer.run(Overcommit::Utils.repo_root, action: :update)
72
43
  exec($0, *ARGV) # Execute the updated hook with all original arguments
73
44
  end
74
45
 
75
46
  config = Overcommit::ConfigurationLoader.load_repo_config
76
47
 
77
- context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
48
+ context = Overcommit::HookContext.create(hook_type, config, ARGV)
78
49
  config.apply_environment!(context, ENV)
79
50
 
80
- input = Overcommit::UserInput.new(STDIN)
81
-
82
51
  printer = Overcommit::Printer.new(logger, context)
83
- runner = Overcommit::HookRunner.new(config, logger, context, input, printer)
52
+ runner = Overcommit::HookRunner.new(config, logger, context, printer)
84
53
 
85
54
  status = runner.run
86
55
 
@@ -102,6 +71,8 @@ rescue Overcommit::Exceptions::HookCancelled
102
71
  rescue Overcommit::Exceptions::InvalidGitRepo => error
103
72
  puts error
104
73
  exit 64 # EX_USAGE
74
+ rescue Overcommit::Exceptions::InvalidHookSignature
75
+ exit 1
105
76
  rescue => error
106
77
  puts error.message
107
78
  puts error.backtrace
@@ -18,11 +18,6 @@ if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
18
18
  exit
19
19
  end
20
20
 
21
- # Required for Ruby 1.8 compatibility (for older OSX versions)
22
- if RUBY_VERSION.split('.')[0..1] == %w[1 8]
23
- require 'rubygems'
24
- end
25
-
26
21
  hook_type = File.basename($0)
27
22
  if hook_type == 'overcommit-hook'
28
23
  puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
@@ -33,34 +28,10 @@ end
33
28
  begin
34
29
  require 'overcommit'
35
30
  rescue LoadError
36
- puts 'Overcommit is not installed. Install it to manage git hooks for ' \
37
- 'this repository? (y/n)'
38
-
39
- # If the hook isn't interactive, we need to map STDIN to keyboard manually
40
- STDIN.reopen('/dev/tty') if STDIN.eof?
41
-
42
- if (answer = gets) && answer.strip.downcase.start_with?('y')
43
- puts 'Installing...'
44
- if system('gem install overcommit')
45
- Gem.clear_paths # Reset load paths so newly installed gem is found
46
- require 'overcommit'
47
- else
48
- puts 'Unable to install Overcommit -- try running `gem install overcommit`'
49
- exit 69 # EX_UNAVAILABLE
50
- end
51
- else
52
- puts 'You chose not to install Overcommit'
53
- puts "No hooks were run for '#{hook_type}'"
54
- exit
55
- end
56
- end
57
-
58
- if Gem::Version.new(Overcommit::VERSION) < Gem::Version.new('0.6.0')
59
- puts "Installed version of Overcommit (#{Overcommit::VERSION}) is " \
60
- "incompatible with the installed hooks.\n" \
61
- 'Run `gem install overcommit && overcommit --install` to ensure ' \
62
- "you're up-to-date."
63
- exit 64 # EX_USAGE
31
+ puts 'This repository contains hooks installed by Overcommit, but the ' \
32
+ "overcommit gem is not installed.\n" \
33
+ 'Install it with `gem install overcommit`.'
34
+ exit
64
35
  end
65
36
 
66
37
  begin
@@ -68,19 +39,17 @@ begin
68
39
 
69
40
  # Ensure master hook is up-to-date
70
41
  installer = Overcommit::Installer.new(logger)
71
- if installer.run(Overcommit::Utils.repo_root, :action => :update)
42
+ if installer.run(Overcommit::Utils.repo_root, action: :update)
72
43
  exec($0, *ARGV) # Execute the updated hook with all original arguments
73
44
  end
74
45
 
75
46
  config = Overcommit::ConfigurationLoader.load_repo_config
76
47
 
77
- context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
48
+ context = Overcommit::HookContext.create(hook_type, config, ARGV)
78
49
  config.apply_environment!(context, ENV)
79
50
 
80
- input = Overcommit::UserInput.new(STDIN)
81
-
82
51
  printer = Overcommit::Printer.new(logger, context)
83
- runner = Overcommit::HookRunner.new(config, logger, context, input, printer)
52
+ runner = Overcommit::HookRunner.new(config, logger, context, printer)
84
53
 
85
54
  status = runner.run
86
55
 
@@ -102,6 +71,8 @@ rescue Overcommit::Exceptions::HookCancelled
102
71
  rescue Overcommit::Exceptions::InvalidGitRepo => error
103
72
  puts error
104
73
  exit 64 # EX_USAGE
74
+ rescue Overcommit::Exceptions::InvalidHookSignature
75
+ exit 1
105
76
  rescue => error
106
77
  puts error.message
107
78
  puts error.backtrace
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: overcommit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Causes Engineering
@@ -9,64 +9,50 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-07 00:00:00.000000000 Z
12
+ date: 2014-12-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: childprocess
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: 0.5.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 0.5.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: image_optim
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.15.0
34
+ version: 0.18.0
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 0.15.0
41
+ version: 0.18.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ~>
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
48
  version: '3.0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ~>
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
55
  version: '3.0'
56
- - !ruby/object:Gem::Dependency
57
- name: rubocop
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - '='
61
- - !ruby/object:Gem::Version
62
- version: 0.26.0
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - '='
68
- - !ruby/object:Gem::Version
69
- version: 0.26.0
70
56
  description: Utility to install, configure, and extend Git hooks
71
57
  email:
72
58
  - eng@causes.com
@@ -80,76 +66,77 @@ files:
80
66
  - config/default.yml
81
67
  - config/starter.yml
82
68
  - lib/overcommit.rb
83
- - lib/overcommit/version.rb
84
- - lib/overcommit/hook_context.rb
69
+ - lib/overcommit/cli.rb
70
+ - lib/overcommit/configuration.rb
71
+ - lib/overcommit/configuration_loader.rb
72
+ - lib/overcommit/configuration_validator.rb
85
73
  - lib/overcommit/constants.rb
86
- - lib/overcommit/utils.rb
87
- - lib/overcommit/hook_runner.rb
88
- - lib/overcommit/user_input.rb
89
- - lib/overcommit/subprocess.rb
90
- - lib/overcommit/hook/commit_msg/trailing_period.rb
74
+ - lib/overcommit/exceptions.rb
75
+ - lib/overcommit/git_repo.rb
76
+ - lib/overcommit/hook/base.rb
77
+ - lib/overcommit/hook/commit_msg/base.rb
91
78
  - lib/overcommit/hook/commit_msg/gerrit_change_id.rb
92
- - lib/overcommit/hook/commit_msg/single_line_subject.rb
93
- - lib/overcommit/hook/commit_msg/russian_novel.rb
94
79
  - lib/overcommit/hook/commit_msg/hard_tabs.rb
80
+ - lib/overcommit/hook/commit_msg/russian_novel.rb
81
+ - lib/overcommit/hook/commit_msg/single_line_subject.rb
95
82
  - lib/overcommit/hook/commit_msg/text_width.rb
96
- - lib/overcommit/hook/commit_msg/base.rb
97
- - lib/overcommit/hook/post_checkout/index_tags.rb
83
+ - lib/overcommit/hook/commit_msg/trailing_period.rb
98
84
  - lib/overcommit/hook/post_checkout/base.rb
99
- - lib/overcommit/hook/base.rb
85
+ - lib/overcommit/hook/post_checkout/index_tags.rb
100
86
  - lib/overcommit/hook/pre_commit/author_email.rb
101
- - lib/overcommit/hook/pre_commit/pry_binding.rb
102
- - lib/overcommit/hook/pre_commit/jsxcs.rb
103
- - lib/overcommit/hook/pre_commit/image_optim.rb
87
+ - lib/overcommit/hook/pre_commit/author_name.rb
88
+ - lib/overcommit/hook/pre_commit/base.rb
89
+ - lib/overcommit/hook/pre_commit/berksfile_check.rb
90
+ - lib/overcommit/hook/pre_commit/brakeman.rb
91
+ - lib/overcommit/hook/pre_commit/broken_symlinks.rb
92
+ - lib/overcommit/hook/pre_commit/bundle_check.rb
93
+ - lib/overcommit/hook/pre_commit/chamber_security.rb
94
+ - lib/overcommit/hook/pre_commit/coffee_lint.rb
104
95
  - lib/overcommit/hook/pre_commit/css_lint.rb
96
+ - lib/overcommit/hook/pre_commit/go_lint.rb
97
+ - lib/overcommit/hook/pre_commit/haml_lint.rb
98
+ - lib/overcommit/hook/pre_commit/hard_tabs.rb
99
+ - lib/overcommit/hook/pre_commit/image_optim.rb
100
+ - lib/overcommit/hook/pre_commit/js_hint.rb
101
+ - lib/overcommit/hook/pre_commit/jscs.rb
102
+ - lib/overcommit/hook/pre_commit/json_syntax.rb
105
103
  - lib/overcommit/hook/pre_commit/jsx_hint.rb
104
+ - lib/overcommit/hook/pre_commit/jsxcs.rb
106
105
  - lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
107
- - lib/overcommit/hook/pre_commit/travis_lint.rb
108
- - lib/overcommit/hook/pre_commit/bundle_check.rb
109
- - lib/overcommit/hook/pre_commit/yaml_syntax.rb
110
- - lib/overcommit/hook/pre_commit/rails_schema_up_to_date.rb
111
- - lib/overcommit/hook/pre_commit/berksfile_check.rb
112
106
  - lib/overcommit/hook/pre_commit/merge_conflicts.rb
113
- - lib/overcommit/hook/pre_commit/trailing_whitespace.rb
114
- - lib/overcommit/hook/pre_commit/go_lint.rb
115
- - lib/overcommit/hook/pre_commit/author_name.rb
116
- - lib/overcommit/hook/pre_commit/rubocop.rb
107
+ - lib/overcommit/hook/pre_commit/pry_binding.rb
117
108
  - lib/overcommit/hook/pre_commit/python_flake8.rb
118
- - lib/overcommit/hook/pre_commit/js_hint.rb
119
- - lib/overcommit/hook/pre_commit/chamber_security.rb
120
- - lib/overcommit/hook/pre_commit/hard_tabs.rb
121
- - lib/overcommit/hook/pre_commit/haml_lint.rb
122
- - lib/overcommit/hook/pre_commit/coffee_lint.rb
123
- - lib/overcommit/hook/pre_commit/brakeman.rb
109
+ - lib/overcommit/hook/pre_commit/rails_schema_up_to_date.rb
124
110
  - lib/overcommit/hook/pre_commit/reek.rb
125
- - lib/overcommit/hook/pre_commit/jscs.rb
111
+ - lib/overcommit/hook/pre_commit/rubocop.rb
126
112
  - lib/overcommit/hook/pre_commit/scss_lint.rb
127
- - lib/overcommit/hook/pre_commit/base.rb
128
- - lib/overcommit/hook/pre_commit/broken_symlinks.rb
129
- - lib/overcommit/hook/pre_commit/json_syntax.rb
130
- - lib/overcommit/hook_signer.rb
131
- - lib/overcommit/git_repo.rb
132
- - lib/overcommit/configuration_validator.rb
133
- - lib/overcommit/hook_context/pre_commit.rb
134
- - lib/overcommit/hook_context/commit_msg.rb
113
+ - lib/overcommit/hook/pre_commit/trailing_whitespace.rb
114
+ - lib/overcommit/hook/pre_commit/travis_lint.rb
115
+ - lib/overcommit/hook/pre_commit/yaml_syntax.rb
116
+ - lib/overcommit/hook_context.rb
135
117
  - lib/overcommit/hook_context/base.rb
118
+ - lib/overcommit/hook_context/commit_msg.rb
136
119
  - lib/overcommit/hook_context/post_checkout.rb
137
- - lib/overcommit/installer.rb
138
- - lib/overcommit/configuration_loader.rb
139
- - lib/overcommit/interrupt_handler.rb
120
+ - lib/overcommit/hook_context/pre_commit.rb
121
+ - lib/overcommit/hook_context/run_all.rb
122
+ - lib/overcommit/hook_loader/base.rb
140
123
  - lib/overcommit/hook_loader/built_in_hook_loader.rb
141
124
  - lib/overcommit/hook_loader/plugin_hook_loader.rb
142
- - lib/overcommit/hook_loader/base.rb
143
- - lib/overcommit/exceptions.rb
144
- - lib/overcommit/configuration.rb
145
- - lib/overcommit/printer.rb
125
+ - lib/overcommit/hook_runner.rb
126
+ - lib/overcommit/hook_signer.rb
127
+ - lib/overcommit/installer.rb
128
+ - lib/overcommit/interrupt_handler.rb
146
129
  - lib/overcommit/logger.rb
147
- - lib/overcommit/cli.rb
148
- - libexec/index-tags
130
+ - lib/overcommit/message_processor.rb
131
+ - lib/overcommit/printer.rb
132
+ - lib/overcommit/subprocess.rb
133
+ - lib/overcommit/utils.rb
134
+ - lib/overcommit/version.rb
149
135
  - libexec/gerrit-change-id
136
+ - libexec/index-tags
150
137
  - template-dir/hooks/commit-msg
151
- - template-dir/hooks/post-checkout
152
138
  - template-dir/hooks/overcommit-hook
139
+ - template-dir/hooks/post-checkout
153
140
  - template-dir/hooks/pre-commit
154
141
  homepage: https://github.com/causes/overcommit
155
142
  licenses:
@@ -162,17 +149,17 @@ require_paths:
162
149
  - lib
163
150
  required_ruby_version: !ruby/object:Gem::Requirement
164
151
  requirements:
165
- - - '>='
152
+ - - ">="
166
153
  - !ruby/object:Gem::Version
167
154
  version: 1.9.3
168
155
  required_rubygems_version: !ruby/object:Gem::Requirement
169
156
  requirements:
170
- - - '>='
157
+ - - ">="
171
158
  - !ruby/object:Gem::Version
172
159
  version: '0'
173
160
  requirements: []
174
161
  rubyforge_project:
175
- rubygems_version: 2.0.14
162
+ rubygems_version: 2.2.2
176
163
  signing_key:
177
164
  specification_version: 4
178
165
  summary: Git hook manager
@@ -1,26 +0,0 @@
1
- module Overcommit
2
- # Encapsulates prompting for and fetching input from a user.
3
- class UserInput
4
- # @param io [IO] device to fetch input from
5
- def initialize(io)
6
- @io = io
7
-
8
- reopen_tty
9
- end
10
-
11
- # Get a string of input from the user (up to the next newline character).
12
- def get
13
- @io.gets
14
- end
15
-
16
- private
17
-
18
- # Git hooks are not interactive and will close STDIN by default.
19
- def reopen_tty
20
- # If the hook isn't interactive, we need to map STDIN to keyboard manually
21
- STDIN.reopen('/dev/tty') if STDIN.eof?
22
- rescue # rubocop:disable HandleExceptions
23
- # Happens in tests run with no console available
24
- end
25
- end
26
- end