git_hook-rspec 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in git_hook-rspec.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Sho Kusano
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # GitHook::Rspec
2
+
3
+ git pre-commit hook. run all rspec.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'git_hook-rspec'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install git_hook-rspec
18
+
19
+ And Add this line to your application's .githooks:
20
+
21
+ pre_commit 'GitHook::Rspec', :require => 'git_hook-rspec'
22
+
23
+ And then execute:
24
+
25
+ $ git hook apply
26
+
27
+ ## Usage
28
+
29
+ git hook gem.
30
+
31
+ write your .githooks:
32
+
33
+ pre_commit 'GitHook::Rspec',
34
+ :require => 'git_hook-rspec,
35
+ :bundler => true, # using bundler. execute rspec comamnd with `bundle exec`
36
+ :binstabs => false, # rspec inside `binstabs` folder. true is 'bin'. false is not inside binstabs folder.
37
+ :cli => '' # rspec cli options. example: "--color --format d"
38
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/git_hook-rspec/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Sho Kusano"]
6
+ gem.email = ["rosylilly@aduca.org"]
7
+ gem.description = %q{git pre-commit hook. run all rspec.}
8
+ gem.summary = %q{git pre-commit hook. run all rspec.}
9
+ gem.homepage = "https://github.com/rosylilly/git_hook-rspec"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "git_hook-rspec"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = GitHook::Rspec::VERSION
17
+
18
+ gem.add_dependency 'git_hook'
19
+ end
@@ -0,0 +1,23 @@
1
+ require "git_hook/hook"
2
+ require "git_hook-rspec/version"
3
+
4
+ module GitHook
5
+ class Rspec < GitHook::Hook
6
+ def invoke
7
+ rspec = 'rspec'
8
+ rspec = "#{binstabs}/rspec" if options.binstabs?
9
+ rspec = "bundle exec #{rspec}" unless options.bundler === false
10
+ `#{rspec} #{options.cli || ''}`
11
+
12
+ return $? === 0
13
+ end
14
+
15
+ def binstabs
16
+ if options.binstabs === true
17
+ 'bin'
18
+ else
19
+ options.binstabs
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ module GitHook
2
+ class Rspec
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: git_hook-rspec
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sho Kusano
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: git_hook
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: git pre-commit hook. run all rspec.
31
+ email:
32
+ - rosylilly@aduca.org
33
+ executables: []
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - .gitignore
38
+ - Gemfile
39
+ - LICENSE
40
+ - README.md
41
+ - Rakefile
42
+ - git_hook-rspec.gemspec
43
+ - lib/git_hook-rspec.rb
44
+ - lib/git_hook-rspec/version.rb
45
+ homepage: https://github.com/rosylilly/git_hook-rspec
46
+ licenses: []
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 1.8.23
66
+ signing_key:
67
+ specification_version: 3
68
+ summary: git pre-commit hook. run all rspec.
69
+ test_files: []