rabbitt-githooks 1.3.2 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTORS.txt +2 -0
- data/Gemfile.lock +3 -3
- data/bin/githooks +2 -4
- data/bin/githooks-runner +9 -13
- data/lib/githooks/action.rb +21 -10
- data/lib/githooks/{commands → cli}/config.rb +4 -4
- data/lib/githooks/cli.rb +18 -9
- data/lib/githooks/core_ext/array/extract_options.rb +18 -0
- data/lib/githooks/core_ext/array/select_with_index.rb +18 -0
- data/lib/githooks/core_ext/array.rb +18 -0
- data/lib/githooks/core_ext/numbers.rb +18 -0
- data/lib/githooks/core_ext/object.rb +18 -0
- data/lib/githooks/core_ext/ostruct.rb +44 -0
- data/lib/githooks/core_ext/pathname.rb +28 -0
- data/lib/githooks/core_ext/rainbow.rb +40 -0
- data/lib/githooks/core_ext/string/git_option_path_split.rb +18 -0
- data/lib/githooks/core_ext/string/inflections.rb +18 -0
- data/lib/githooks/core_ext/string/sanitize.rb +18 -0
- data/lib/githooks/core_ext/string.rb +18 -0
- data/lib/githooks/core_ext.rb +2 -1
- data/lib/githooks/hook.rb +36 -13
- data/lib/githooks/repository/config.rb +1 -1
- data/lib/githooks/repository/diff_index_entry.rb +2 -2
- data/lib/githooks/repository.rb +10 -5
- data/lib/githooks/runner.rb +100 -94
- data/lib/githooks/section.rb +34 -8
- data/lib/githooks/system_utils.rb +36 -19
- data/lib/githooks/version.rb +1 -1
- data/lib/githooks.rb +5 -6
- data/rabbitt-githooks.gemspec +34 -33
- metadata +10 -8
- data/lib/githooks/core_ext/colorize.rb +0 -30
data/lib/githooks.rb
CHANGED
@@ -20,15 +20,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|
20
20
|
require 'pathname'
|
21
21
|
require 'githooks/error'
|
22
22
|
require 'githooks/core_ext'
|
23
|
-
require 'githooks/core_ext/colorize'
|
24
23
|
require 'githooks/version'
|
25
24
|
|
26
25
|
module GitHooks
|
27
|
-
AUTHOR = 'Carl P. Corliss <rabbitt@gmail.com>'
|
28
|
-
|
29
26
|
autoload :Config, 'githooks/config'
|
30
|
-
autoload :CommandRunner, 'githooks/command'
|
31
|
-
autoload :Command, 'githooks/command'
|
32
27
|
autoload :CLI, 'githooks/cli'
|
33
28
|
autoload :Hook, 'githooks/hook'
|
34
29
|
autoload :Section, 'githooks/section'
|
@@ -38,7 +33,7 @@ module GitHooks
|
|
38
33
|
autoload :SystemUtils, 'githooks/system_utils'
|
39
34
|
|
40
35
|
class << self
|
41
|
-
attr_reader :debug, :verbose, :ignore_script
|
36
|
+
attr_reader :debug, :verbose, :ignore_script, :hooks_root
|
42
37
|
|
43
38
|
def debug?
|
44
39
|
return true if ENV['GITHOOKS_DEBUG']
|
@@ -72,6 +67,10 @@ module GitHooks
|
|
72
67
|
else GitHooks::HOOK_NAME
|
73
68
|
end
|
74
69
|
end
|
70
|
+
|
71
|
+
def hooks_root=(value)
|
72
|
+
@hooks_root = Pathname.new(value)
|
73
|
+
end
|
75
74
|
end
|
76
75
|
|
77
76
|
SUCCESS_SYMBOL = '✓'.success! unless defined? SUCCESS_SYMBOL
|
data/rabbitt-githooks.gemspec
CHANGED
@@ -17,37 +17,38 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|
17
17
|
=end
|
18
18
|
|
19
19
|
# coding: utf-8
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
Gem::Specification.new do |spec|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
20
|
+
|
21
|
+
load File.expand_path('../lib/githooks/version.rb', __FILE__)
|
22
|
+
|
23
|
+
begin
|
24
|
+
Gem::Specification.new do |spec|
|
25
|
+
spec.name = 'rabbitt-githooks'
|
26
|
+
spec.version = GitHooks::VERSION
|
27
|
+
spec.authors = ['Carl P. Corliss']
|
28
|
+
spec.email = ['rabbitt@gmail.com']
|
29
|
+
spec.description = 'GitHooks provides a framework for building tests that can be used with git hooks'
|
30
|
+
spec.homepage = 'http://github.com/rabbitt/githooks'
|
31
|
+
spec.summary = 'framework for building git hooks tests'
|
32
|
+
spec.license = 'GPLv2'
|
33
|
+
spec.rubygems_version = '2.0.14'
|
34
|
+
|
35
|
+
spec.files = %x{ git ls-files }.split($/).grep(%r{^([A-Z]+|lib|bin|.+\.gemspec)})
|
36
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
37
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
38
|
+
spec.require_paths = ['lib']
|
39
|
+
spec.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
40
|
+
|
41
|
+
spec.add_dependency 'rainbow', '~> 2.0.0'
|
42
|
+
spec.add_dependency 'thor', '~> 0.18'
|
43
|
+
|
44
|
+
spec.add_development_dependency 'rake', '~> 10.1'
|
45
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
46
|
+
|
47
|
+
spec.add_development_dependency 'yard', '~> 0.7'
|
48
|
+
spec.add_development_dependency 'rspec', '~> 2.14'
|
49
|
+
spec.add_development_dependency 'simplecov', '~> 0.9'
|
50
|
+
|
51
|
+
spec.add_development_dependency 'rubocop', '~> 0.18'
|
52
|
+
spec.add_development_dependency 'ruby-lint', '~> 2.0'
|
53
|
+
end
|
53
54
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbitt-githooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl P. Corliss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rainbow
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 2.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 2.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,6 +148,7 @@ extra_rdoc_files:
|
|
148
148
|
- README.md
|
149
149
|
- LICENSE.txt
|
150
150
|
files:
|
151
|
+
- CONTRIBUTORS.txt
|
151
152
|
- Gemfile
|
152
153
|
- Gemfile.lock
|
153
154
|
- LICENSE.txt
|
@@ -158,17 +159,18 @@ files:
|
|
158
159
|
- lib/githooks.rb
|
159
160
|
- lib/githooks/action.rb
|
160
161
|
- lib/githooks/cli.rb
|
161
|
-
- lib/githooks/
|
162
|
+
- lib/githooks/cli/config.rb
|
162
163
|
- lib/githooks/core_ext.rb
|
163
164
|
- lib/githooks/core_ext/array.rb
|
164
165
|
- lib/githooks/core_ext/array/extract_options.rb
|
165
166
|
- lib/githooks/core_ext/array/min_max.rb
|
166
167
|
- lib/githooks/core_ext/array/select_with_index.rb
|
167
|
-
- lib/githooks/core_ext/colorize.rb
|
168
168
|
- lib/githooks/core_ext/numbers.rb
|
169
169
|
- lib/githooks/core_ext/numbers/infinity.rb
|
170
170
|
- lib/githooks/core_ext/object.rb
|
171
|
+
- lib/githooks/core_ext/ostruct.rb
|
171
172
|
- lib/githooks/core_ext/pathname.rb
|
173
|
+
- lib/githooks/core_ext/rainbow.rb
|
172
174
|
- lib/githooks/core_ext/string.rb
|
173
175
|
- lib/githooks/core_ext/string/git_option_path_split.rb
|
174
176
|
- lib/githooks/core_ext/string/inflections.rb
|
@@ -206,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
208
|
version: '0'
|
207
209
|
requirements: []
|
208
210
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.
|
211
|
+
rubygems_version: 2.4.3
|
210
212
|
signing_key:
|
211
213
|
specification_version: 4
|
212
214
|
summary: framework for building git hooks tests
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'colorize'
|
2
|
-
|
3
|
-
module Colorize
|
4
|
-
module ClassMethods
|
5
|
-
unless respond_to? :disable_colorization_without_tty_detection
|
6
|
-
alias_method :disable_colorization_without_tty_detection, :disable_colorization
|
7
|
-
end
|
8
|
-
|
9
|
-
def disable_colorization(value = nil)
|
10
|
-
# disable colorization when we don't have a tty on STDOUT
|
11
|
-
return true unless value || STDOUT.tty?
|
12
|
-
disable_colorization_without_tty_detection(value)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
module InstanceMethods
|
17
|
-
def success!
|
18
|
-
light_green
|
19
|
-
end
|
20
|
-
|
21
|
-
def failure!
|
22
|
-
light_red
|
23
|
-
end
|
24
|
-
|
25
|
-
def unknown!
|
26
|
-
light_yellow
|
27
|
-
end
|
28
|
-
alias_method :warning!, :unknown!
|
29
|
-
end
|
30
|
-
end
|