git-precommit 1.0.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.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ pkg
data/README.rdoc ADDED
@@ -0,0 +1,22 @@
1
+ = Git Pre-Commit
2
+
3
+ Rake Commit[http://github.com/pgr0ss/rake_commit_tasks] is a great tool for
4
+ helping make sure our check-ins don't break the build. However, in Git we
5
+ don't need all that stuff. Running our tests before check-in is easy with a
6
+ Git pre-commit hook.
7
+
8
+ This Rails[http://rubyonrails.org/] plug-in ensures that such a hook is
9
+ installed on the developer's repository. If no such hook is installed, one
10
+ will be installed that calls `<tt>rake precommit</tt>`
11
+
12
+ == Installation
13
+
14
+ script/plugin install git://github.com/tobytripp/git-pre-commit
15
+
16
+ or
17
+
18
+ git clone git://github.com/tobytripp/git-pre-commit.git vendor/plugins/git_pre_commit
19
+
20
+ _or_
21
+
22
+ git submodule add git://github.com/tobytripp/git-pre-commit.git vendor/plugins/git_pre_commit
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ begin
2
+ require 'jeweler'
3
+ Jeweler::Tasks.new do |gemspec|
4
+ gemspec.name = "git-precommit"
5
+ gemspec.summary = "Fail commits if the tests fail."
6
+ gemspec.description = <<-EOS
7
+ A set of rake tasks that install git pre-commit hooks to call your build.
8
+ If your build fails, the commit will not proceed.
9
+ EOS
10
+ gemspec.email = "toby.tripp+git@gmail.com"
11
+ gemspec.homepage = "http://github.com/tobytripp/git-pre-commit"
12
+ gemspec.authors = ["Toby Tripp"]
13
+ end
14
+ Jeweler::GemcutterTasks.new
15
+ rescue LoadError
16
+ puts "Jeweler not available. Install it with: gem install jeweler"
17
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+
3
+ git pull --rebase
4
+ git push
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env sh
2
+
3
+ # Add all local changes to the index and delete removed files.
4
+ git add -A .
5
+
6
+ rake precommit
@@ -0,0 +1,48 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{git-precommit}
8
+ s.version = "1.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Toby Tripp"]
12
+ s.date = %q{2010-01-23}
13
+ s.description = %q{ A set of rake tasks that install git pre-commit hooks to call your build.
14
+ If your build fails, the commit will not proceed.
15
+ }
16
+ s.email = %q{toby.tripp+git@gmail.com}
17
+ s.extra_rdoc_files = [
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".gitignore",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "git-hooks/post-commit",
26
+ "git-hooks/pre-commit",
27
+ "git-precommit.gemspec",
28
+ "lib/git-precommit/precommit_tasks.rb",
29
+ "lib/git_precommit.rb",
30
+ "tasks/git.rake"
31
+ ]
32
+ s.homepage = %q{http://github.com/tobytripp/git-pre-commit}
33
+ s.rdoc_options = ["--charset=UTF-8"]
34
+ s.require_paths = ["lib"]
35
+ s.rubygems_version = %q{1.3.5}
36
+ s.summary = %q{Fail commits if the tests fail.}
37
+
38
+ if s.respond_to? :specification_version then
39
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
40
+ s.specification_version = 3
41
+
42
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
43
+ else
44
+ end
45
+ else
46
+ end
47
+ end
48
+
@@ -0,0 +1,28 @@
1
+ require "rake"
2
+ require "rake/tasklib"
3
+
4
+ module GitPrecommit
5
+ class PrecommitTasks < ::Rake::TaskLib
6
+ TEMPLATE_PATH = File.expand_path File.join( File.dirname(__FILE__), '..', '..' )
7
+
8
+ def initialize()
9
+ yield self if block_given?
10
+ define
11
+ end
12
+
13
+ def define()
14
+ desc "Install the pre-commit hook"
15
+ file ".git/hooks/pre-commit" => "#{TEMPLATE_PATH}/git-hooks/pre-commit" do |t|
16
+ warn "Git pre-commit hook missing, setting up…"
17
+ copy t.prerequisites.first, t.name
18
+ chmod 0755, t.name
19
+ end
20
+
21
+ desc "Install the post-commit hook"
22
+ file ".git/hooks/post-commit" => "#{TEMPLATE_PATH}/git-hooks/post-commit" do |t|
23
+ copy t.prerequisites.first, t.name
24
+ chmod 0755, t.name
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1 @@
1
+ require "git-precommit/precommit_tasks.rb"
data/tasks/git.rake ADDED
@@ -0,0 +1,7 @@
1
+ if RAILS_ENV == 'development' || RAILS_ENV == 'test'
2
+ $LOAD_PATH.unshift( File.join( File.dirname( __FILE__ ), '..', 'lib' ) )
3
+ require "git_precommit"
4
+
5
+ GitPrecommit::PrecommitTasks.new
6
+ task :environment => ".git/hooks/pre-commit"
7
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: git-precommit
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Toby Tripp
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-01-23 00:00:00 -06:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: " A set of rake tasks that install git pre-commit hooks to call your build.\n If your build fails, the commit will not proceed.\n"
17
+ email: toby.tripp+git@gmail.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.rdoc
24
+ files:
25
+ - .gitignore
26
+ - README.rdoc
27
+ - Rakefile
28
+ - VERSION
29
+ - git-hooks/post-commit
30
+ - git-hooks/pre-commit
31
+ - git-precommit.gemspec
32
+ - lib/git-precommit/precommit_tasks.rb
33
+ - lib/git_precommit.rb
34
+ - tasks/git.rake
35
+ has_rdoc: true
36
+ homepage: http://github.com/tobytripp/git-pre-commit
37
+ licenses: []
38
+
39
+ post_install_message:
40
+ rdoc_options:
41
+ - --charset=UTF-8
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: "0"
49
+ version:
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: "0"
55
+ version:
56
+ requirements: []
57
+
58
+ rubyforge_project:
59
+ rubygems_version: 1.3.5
60
+ signing_key:
61
+ specification_version: 3
62
+ summary: Fail commits if the tests fail.
63
+ test_files: []
64
+