git-precommit 1.2.6 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -1
- data/Gemfile.lock +16 -1
- data/Guardfile +8 -0
- data/Rakefile +1 -1
- data/features/local-hook-path.feature +35 -0
- data/git-precommit.gemspec +2 -0
- data/lib/git-precommit/LICENSE +7 -0
- data/lib/git-precommit/precommit_tasks.rb +16 -12
- data/lib/git-precommit/version.rb +1 -1
- data/project.gems +1 -1
- metadata +85 -63
data/.rvmrc
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
rvm --create @git-precommit
|
2
|
-
rvm gemset import project.gems
|
2
|
+
rvm gemset import project.gems
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
git-precommit (1.
|
4
|
+
git-precommit (1.3.0)
|
5
5
|
rake
|
6
6
|
|
7
7
|
GEM
|
@@ -12,6 +12,7 @@ GEM
|
|
12
12
|
cucumber (~> 0.9.0)
|
13
13
|
background_process (1.2)
|
14
14
|
builder (2.1.2)
|
15
|
+
configuration (1.3.1)
|
15
16
|
cucumber (0.9.2)
|
16
17
|
builder (~> 2.1.2)
|
17
18
|
diff-lcs (~> 1.1.2)
|
@@ -22,7 +23,18 @@ GEM
|
|
22
23
|
gherkin (2.2.9)
|
23
24
|
json (~> 1.4.6)
|
24
25
|
term-ansicolor (~> 1.0.5)
|
26
|
+
guard (0.2.2)
|
27
|
+
open_gem (~> 1.4.2)
|
28
|
+
thor (~> 0.14.3)
|
29
|
+
guard-cucumber (0.2.0)
|
30
|
+
cucumber (~> 0.9.2)
|
31
|
+
guard (~> 0.2.2)
|
25
32
|
json (1.4.6)
|
33
|
+
launchy (0.3.7)
|
34
|
+
configuration (>= 0.0.5)
|
35
|
+
rake (>= 0.8.1)
|
36
|
+
open_gem (1.4.2)
|
37
|
+
launchy (~> 0.3.5)
|
26
38
|
rake (0.8.7)
|
27
39
|
rspec (2.0.0)
|
28
40
|
rspec-core (= 2.0.0)
|
@@ -36,6 +48,7 @@ GEM
|
|
36
48
|
rspec-expectations (= 2.0.0)
|
37
49
|
syntax (1.0.0)
|
38
50
|
term-ansicolor (1.0.5)
|
51
|
+
thor (0.14.6)
|
39
52
|
|
40
53
|
PLATFORMS
|
41
54
|
ruby
|
@@ -44,5 +57,7 @@ DEPENDENCIES
|
|
44
57
|
aruba
|
45
58
|
cucumber (~> 0.9.0)
|
46
59
|
git-precommit!
|
60
|
+
guard (~> 0.2.2)
|
61
|
+
guard-cucumber
|
47
62
|
rspec (~> 2.0.0)
|
48
63
|
syntax
|
data/Guardfile
ADDED
data/Rakefile
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env cucumber
|
2
|
+
Feature: Using repository local hook scripts
|
3
|
+
Background:
|
4
|
+
Given a directory named ".git/hooks"
|
5
|
+
And a file named "Rakefile" with:
|
6
|
+
"""
|
7
|
+
require "../../lib/git_precommit"
|
8
|
+
GitPrecommit::PrecommitTasks.new :path => "myhooks"
|
9
|
+
|
10
|
+
task :default => ".git/hooks/pre-commit"
|
11
|
+
"""
|
12
|
+
And a directory named "./myhooks"
|
13
|
+
And a file named "./myhooks/pre-commit" with:
|
14
|
+
"""
|
15
|
+
#!/usr/bin/env sh
|
16
|
+
# My Hook
|
17
|
+
"""
|
18
|
+
|
19
|
+
Scenario: No pre-commit hook is installed
|
20
|
+
When I successfully run "rake"
|
21
|
+
|
22
|
+
Then the following files should exist:
|
23
|
+
| .git/hooks/pre-commit |
|
24
|
+
|
25
|
+
And the file ".git/hooks/pre-commit" should contain "My Hook"
|
26
|
+
|
27
|
+
Scenario: The pre-commit hook is modified
|
28
|
+
When I append to ".git/hooks/pre-commit" with:
|
29
|
+
"""
|
30
|
+
echo "My new hook!"
|
31
|
+
"""
|
32
|
+
|
33
|
+
And I successfully run "rake"
|
34
|
+
|
35
|
+
Then the file ".git/hooks/pre-commit" should not contain "echo"
|
data/git-precommit.gemspec
CHANGED
@@ -34,4 +34,6 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.add_development_dependency "cucumber", "~> 0.9.0"
|
35
35
|
s.add_development_dependency "aruba"
|
36
36
|
s.add_development_dependency "syntax"
|
37
|
+
s.add_development_dependency "guard", "~> 0.2.2"
|
38
|
+
s.add_development_dependency "guard-cucumber"
|
37
39
|
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2012 Tobias Tripp
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -4,30 +4,34 @@ require "rake/tasklib"
|
|
4
4
|
|
5
5
|
module GitPrecommit
|
6
6
|
class PrecommitTasks < ::Rake::TaskLib
|
7
|
-
TEMPLATE_PATH =
|
8
|
-
File.
|
7
|
+
TEMPLATE_PATH = File.expand_path(
|
8
|
+
File.join( File.dirname(__FILE__), '..', '..', 'git-hooks' )
|
9
|
+
)
|
9
10
|
attr_accessor :template_path
|
10
|
-
|
11
|
+
|
11
12
|
def initialize( options={} )
|
12
13
|
@options = {
|
13
|
-
:draconian => false
|
14
|
+
:draconian => false,
|
15
|
+
:path => TEMPLATE_PATH
|
14
16
|
}.merge options
|
15
|
-
|
17
|
+
|
18
|
+
@options[:draconian] = true if options[:path]
|
19
|
+
|
16
20
|
yield self if block_given?
|
17
|
-
@template_path ||=
|
18
|
-
|
21
|
+
@template_path ||= @options[:path]
|
22
|
+
|
19
23
|
define
|
20
24
|
end
|
21
|
-
|
25
|
+
|
22
26
|
def define()
|
23
27
|
pre_commit = ".git/hooks/pre-commit"
|
24
28
|
pre_commit_src = "#{template_path}/pre-commit"
|
25
|
-
|
29
|
+
|
26
30
|
task :overwrite
|
27
31
|
|
28
32
|
deps = [pre_commit_src]
|
29
33
|
deps += [:overwrite] if @options[:draconian]
|
30
|
-
|
34
|
+
|
31
35
|
desc "Install the git pre-commit hook"
|
32
36
|
file pre_commit => deps do |t|
|
33
37
|
copy t.prerequisites.first, t.name
|
@@ -39,11 +43,11 @@ module GitPrecommit
|
|
39
43
|
copy t.prerequisites.first, t.name
|
40
44
|
chmod 0755, t.name
|
41
45
|
end
|
42
|
-
|
46
|
+
|
43
47
|
namespace :git do
|
44
48
|
desc "Install the git pre-commit hook"
|
45
49
|
task :precommit => pre_commit
|
46
|
-
|
50
|
+
|
47
51
|
desc "Install the git post-commit hook"
|
48
52
|
task :postcommit => ".git/hooks/post-commit"
|
49
53
|
end
|
data/project.gems
CHANGED
@@ -1 +1 @@
|
|
1
|
-
bundler -v1.0
|
1
|
+
bundler -v1.1.0
|
metadata
CHANGED
@@ -1,95 +1,120 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-precommit
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.3.0
|
4
5
|
prerelease:
|
5
|
-
version: 1.2.6
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Toby Tripp
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-03-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: rake
|
17
|
-
requirement: &
|
16
|
+
requirement: &70128842736440 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
|
-
requirements:
|
20
|
-
- -
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
26
|
-
- !ruby/object:Gem::Dependency
|
24
|
+
version_requirements: *70128842736440
|
25
|
+
- !ruby/object:Gem::Dependency
|
27
26
|
name: rspec
|
28
|
-
requirement: &
|
27
|
+
requirement: &70128842735240 !ruby/object:Gem::Requirement
|
29
28
|
none: false
|
30
|
-
requirements:
|
29
|
+
requirements:
|
31
30
|
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
31
|
+
- !ruby/object:Gem::Version
|
33
32
|
version: 2.0.0
|
34
33
|
type: :development
|
35
34
|
prerelease: false
|
36
|
-
version_requirements: *
|
37
|
-
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: *70128842735240
|
36
|
+
- !ruby/object:Gem::Dependency
|
38
37
|
name: cucumber
|
39
|
-
requirement: &
|
38
|
+
requirement: &70128842734460 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
|
-
requirements:
|
40
|
+
requirements:
|
42
41
|
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
42
|
+
- !ruby/object:Gem::Version
|
44
43
|
version: 0.9.0
|
45
44
|
type: :development
|
46
45
|
prerelease: false
|
47
|
-
version_requirements: *
|
48
|
-
- !ruby/object:Gem::Dependency
|
46
|
+
version_requirements: *70128842734460
|
47
|
+
- !ruby/object:Gem::Dependency
|
49
48
|
name: aruba
|
50
|
-
requirement: &
|
49
|
+
requirement: &70128842733960 !ruby/object:Gem::Requirement
|
51
50
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version:
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
56
55
|
type: :development
|
57
56
|
prerelease: false
|
58
|
-
version_requirements: *
|
59
|
-
- !ruby/object:Gem::Dependency
|
57
|
+
version_requirements: *70128842733960
|
58
|
+
- !ruby/object:Gem::Dependency
|
60
59
|
name: syntax
|
61
|
-
requirement: &
|
60
|
+
requirement: &70128842733260 !ruby/object:Gem::Requirement
|
62
61
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version:
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
67
66
|
type: :development
|
68
67
|
prerelease: false
|
69
|
-
version_requirements: *
|
70
|
-
|
68
|
+
version_requirements: *70128842733260
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard
|
71
|
+
requirement: &70128842732560 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.2.2
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70128842732560
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: guard-cucumber
|
82
|
+
requirement: &70128842732080 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70128842732080
|
91
|
+
description: ! "\n A set of rake tasks that install git pre-commit hooks to run
|
92
|
+
your tests.\n If your build fails, the commit will not proceed.\n\n Git-precommit
|
93
|
+
will call `rake precommit` to run your tests. Be sure to define this task.\n "
|
71
94
|
email: toby.tripp+git@gmail.com
|
72
|
-
executables:
|
95
|
+
executables:
|
73
96
|
- setpairs
|
74
97
|
extensions: []
|
75
|
-
|
76
|
-
extra_rdoc_files:
|
98
|
+
extra_rdoc_files:
|
77
99
|
- README.rdoc
|
78
|
-
files:
|
100
|
+
files:
|
79
101
|
- .gitignore
|
80
102
|
- .rvmrc
|
81
103
|
- Gemfile
|
82
104
|
- Gemfile.lock
|
105
|
+
- Guardfile
|
83
106
|
- README.rdoc
|
84
107
|
- Rakefile
|
85
108
|
- bin/setpairs
|
86
109
|
- config/cucumber.yml
|
87
110
|
- features/draconian.feature
|
111
|
+
- features/local-hook-path.feature
|
88
112
|
- features/pre-commit.feature
|
89
113
|
- features/support/setup.rb
|
90
114
|
- git-hooks/post-commit
|
91
115
|
- git-hooks/pre-commit
|
92
116
|
- git-precommit.gemspec
|
117
|
+
- lib/git-precommit/LICENSE
|
93
118
|
- lib/git-precommit/precommit_tasks.rb
|
94
119
|
- lib/git-precommit/tasks.rb
|
95
120
|
- lib/git-precommit/version.rb
|
@@ -98,36 +123,33 @@ files:
|
|
98
123
|
- tasks/cucumber.rake
|
99
124
|
homepage: http://github.com/tobytripp/git-pre-commit
|
100
125
|
licenses: []
|
101
|
-
|
102
126
|
post_install_message:
|
103
|
-
rdoc_options:
|
127
|
+
rdoc_options:
|
104
128
|
- --charset=UTF-8
|
105
|
-
require_paths:
|
129
|
+
require_paths:
|
106
130
|
- lib
|
107
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
132
|
none: false
|
109
|
-
requirements:
|
110
|
-
- -
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
|
113
|
-
segments:
|
133
|
+
requirements:
|
134
|
+
- - ! '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
segments:
|
114
138
|
- 0
|
115
|
-
|
116
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
|
+
hash: -431659157757392969
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
141
|
none: false
|
118
|
-
requirements:
|
119
|
-
- -
|
120
|
-
- !ruby/object:Gem::Version
|
121
|
-
|
122
|
-
segments:
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
segments:
|
123
147
|
- 0
|
124
|
-
|
148
|
+
hash: -431659157757392969
|
125
149
|
requirements: []
|
126
|
-
|
127
150
|
rubyforge_project: git-precommit
|
128
|
-
rubygems_version: 1.
|
151
|
+
rubygems_version: 1.8.17
|
129
152
|
signing_key:
|
130
153
|
specification_version: 3
|
131
154
|
summary: Abort git commit if the tests fail.
|
132
155
|
test_files: []
|
133
|
-
|