Class: GitHook::Rspec

Inherits:
Hook
  • Object
show all
Defined in:
lib/git_hook-rspec.rb,
lib/git_hook-rspec/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#binstabsObject


15
16
17
18
19
20
21
# File 'lib/git_hook-rspec.rb', line 15

def binstabs
  if options.binstabs === true
    'bin'
  else
    options.binstabs
  end
end

#invokeObject


6
7
8
9
10
11
12
13
# File 'lib/git_hook-rspec.rb', line 6

def invoke
  rspec = 'rspec'
  rspec = "#{binstabs}/rspec" if options.binstabs?
  rspec = "bundle exec #{rspec}" unless options.bundler === false
  `#{rspec} #{options.cli || ''}`

  return $? === 0
end