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 CHANGED
@@ -1,2 +1,2 @@
1
1
  rvm --create @git-precommit
2
- rvm gemset import project.gems
2
+ rvm gemset import project.gems
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-precommit (1.2.6)
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
@@ -0,0 +1,8 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'cucumber' do
5
+ watch('^features/(.*).feature')
6
+ watch('^features/support') { 'features' }
7
+ watch('^features/step_definitions') { 'features' }
8
+ end
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require "rake"
2
- require "rake/rdoctask"
2
+ require "rdoc/task"
3
3
 
4
4
  begin
5
5
  require 'bundler/setup'
@@ -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"
@@ -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.expand_path File.join( File.dirname(__FILE__), '..', '..', 'git-hooks' )
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 ||= 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
@@ -1,3 +1,3 @@
1
1
  module GitPrecommit
2
- VERSION = "1.2.6"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -1 +1 @@
1
- bundler -v1.0.22
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
- date: 2012-02-23 00:00:00 Z
14
- dependencies:
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: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70128842736440 !ruby/object:Gem::Requirement
18
17
  none: false
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
24
+ version_requirements: *70128842736440
25
+ - !ruby/object:Gem::Dependency
27
26
  name: rspec
28
- requirement: &id002 !ruby/object:Gem::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: *id002
37
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *70128842735240
36
+ - !ruby/object:Gem::Dependency
38
37
  name: cucumber
39
- requirement: &id003 !ruby/object:Gem::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: *id003
48
- - !ruby/object:Gem::Dependency
46
+ version_requirements: *70128842734460
47
+ - !ruby/object:Gem::Dependency
49
48
  name: aruba
50
- requirement: &id004 !ruby/object:Gem::Requirement
49
+ requirement: &70128842733960 !ruby/object:Gem::Requirement
51
50
  none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
56
55
  type: :development
57
56
  prerelease: false
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
57
+ version_requirements: *70128842733960
58
+ - !ruby/object:Gem::Dependency
60
59
  name: syntax
61
- requirement: &id005 !ruby/object:Gem::Requirement
60
+ requirement: &70128842733260 !ruby/object:Gem::Requirement
62
61
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
67
66
  type: :development
68
67
  prerelease: false
69
- version_requirements: *id005
70
- description: "\n A set of rake tasks that install git pre-commit hooks to run your tests.\n If your build fails, the commit will not proceed.\n\n Git-precommit will call `rake precommit` to run your tests. Be sure to define this task.\n "
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
- hash: -1628910085885076969
113
- segments:
133
+ requirements:
134
+ - - ! '>='
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ segments:
114
138
  - 0
115
- version: "0"
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
- hash: -1628910085885076969
122
- segments:
142
+ requirements:
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ segments:
123
147
  - 0
124
- version: "0"
148
+ hash: -431659157757392969
125
149
  requirements: []
126
-
127
150
  rubyforge_project: git-precommit
128
- rubygems_version: 1.7.2
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
-