guard-rspec 1.1.0 → 1.2.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/README.md CHANGED
@@ -111,8 +111,8 @@ Former `:color`, `:drb`, `:fail_fast` and `:formatter` options are deprecated an
111
111
  ``` ruby
112
112
  :version => 1 # force use RSpec version 1, default: 2
113
113
  :cli => "-c -f doc" # pass arbitrary RSpec CLI arguments, default: "-f progress"
114
- :bundler => false # don't use "bundle exec" to run the RSpec command, default: true
115
- :binstubs => true # use "bin/rspec" to run the RSpec command (implies :bundler => true), default: false
114
+ :bundler => false # use "bundle exec" to run the RSpec command, default: true
115
+ :binstubs => true # use "bin/rspec" to run the RSpec command (takes precedence over :bundle), default: false
116
116
  :rvm => ['1.8.7', '1.9.2'] # directly run your specs on multiple Rubies, default: nil
117
117
  :notification => false # display Growl (or Libnotify) notification after the specs are done running, default: true
118
118
  :all_after_pass => false # run all specs after changed specs pass, default: true
@@ -123,6 +123,8 @@ Former `:color`, `:drb`, `:fail_fast` and `:formatter` options are deprecated an
123
123
  :turnip => true # enable turnip support; default: false
124
124
  ```
125
125
 
126
+ You can also use a custom binstubs directory using `:binstubs => 'some-dir'`.
127
+
126
128
  ### DRb mode
127
129
 
128
130
  When you specify `--drb` within `:cli`, guard-rspec will circumvent the `rspec` command line tool by
@@ -40,14 +40,14 @@ module Guard
40
40
  def rspec_executable
41
41
  @rspec_executable ||= begin
42
42
  exec = rspec_class.downcase
43
- binstubs? ? "bin/#{exec}" : exec
43
+ binstubs? ? "#{binstubs}/#{exec}" : exec
44
44
  end
45
45
  end
46
46
 
47
47
  def failure_exit_code_supported?
48
48
  @failure_exit_code_supported ||= begin
49
49
  cmd_parts = []
50
- cmd_parts << "bundle exec" if bundler?
50
+ cmd_parts << "bundle exec" if bundle_exec?
51
51
  cmd_parts << rspec_executable
52
52
  cmd_parts << "--help"
53
53
  `#{cmd_parts.join(' ')}`.include? "--failure-exit-code"
@@ -95,7 +95,7 @@ module Guard
95
95
  def rspec_command(paths, options)
96
96
  cmd_parts = []
97
97
  cmd_parts << "rvm #{@options[:rvm].join(',')} exec" if @options[:rvm].respond_to?(:join)
98
- cmd_parts << "bundle exec" if bundler?
98
+ cmd_parts << "bundle exec" if bundle_exec?
99
99
  cmd_parts << rspec_executable
100
100
  cmd_parts << rspec_arguments(paths, options)
101
101
  cmd_parts.compact.join(' ')
@@ -185,12 +185,24 @@ module Guard
185
185
 
186
186
  def binstubs?
187
187
  if @binstubs.nil?
188
- @binstubs = bundler? && @options[:binstubs]
188
+ @binstubs = !!@options[:binstubs]
189
189
  else
190
190
  @binstubs
191
191
  end
192
192
  end
193
193
 
194
+ def binstubs
195
+ if @options[:binstubs] == true
196
+ "bin"
197
+ else
198
+ @options[:binstubs]
199
+ end
200
+ end
201
+
202
+ def bundle_exec?
203
+ bundler? && !binstubs?
204
+ end
205
+
194
206
  def determine_rspec_version
195
207
  if File.exist?("#{Dir.pwd}/spec/spec_helper.rb")
196
208
  File.new("#{Dir.pwd}/spec/spec_helper.rb").read.include?("Spec::Runner") ? 1 : 2
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module RSpecVersion
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-18 00:00:00.000000000 Z
12
+ date: 2012-07-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '2.10'
53
+ version: '2.11'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '2.10'
61
+ version: '2.11'
62
62
  description: Guard::RSpec automatically run your specs (much like autotest).
63
63
  email:
64
64
  - thibaud@thibaud.me
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  segments:
92
92
  - 0
93
- hash: 2822986214998298860
93
+ hash: -112407457923736045
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements: