guard-rspec 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,13 +62,23 @@ module Guard
62
62
  end
63
63
  end
64
64
 
65
+ def default_formatter
66
+ @default_formatter ||= unless @options[:cli] =~ formatter_regex
67
+ file_name = "#{Dir.pwd}/.rspec"
68
+ if File.exist?(file_name)
69
+ s = File.read(file_name)
70
+ s.scan(formatter_regex).flatten.map{|i| "-f #{i}"}.join(' ')
71
+ end
72
+ end || '-f progress'
73
+ end
74
+
65
75
  private
66
76
 
67
77
  def rspec_arguments(paths, options)
68
78
  arg_parts = []
69
79
  arg_parts << options[:cli]
70
- arg_parts << "-f progress" if !options[:cli] || options[:cli].split(/[\s=]/).none? { |w| %w[-f --format].include?(w) }
71
80
  if @options[:notification]
81
+ arg_parts << default_formatter unless options[:cli] =~ formatter_regex
72
82
  arg_parts << "-r #{File.dirname(__FILE__)}/formatters/notification_#{rspec_class.downcase}.rb"
73
83
  arg_parts << "-f Guard::RSpec::Formatter::Notification#{rspec_class}#{rspec_version == 1 ? ":" : " --out "}/dev/null"
74
84
  end
@@ -84,7 +94,6 @@ module Guard
84
94
  cmd_parts << "bundle exec" if bundler?
85
95
  cmd_parts << rspec_executable
86
96
  cmd_parts << rspec_arguments(paths, options)
87
-
88
97
  cmd_parts.compact.join(' ')
89
98
  end
90
99
 
@@ -199,6 +208,10 @@ module Guard
199
208
  end
200
209
  end
201
210
 
211
+ def formatter_regex
212
+ @formatter_regex ||= /(?:^|\s)(?:-f\s*|--format(?:=|\s+))(\w+)/
213
+ end
214
+
202
215
  end
203
216
  end
204
217
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module RSpecVersion
3
- VERSION = "0.7.0"
3
+ VERSION = "0.7.1"
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: 0.7.0
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-27 00:00:00.000000000 Z
12
+ date: 2012-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
16
- requirement: &70179267450520 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: 0.10.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70179267450520
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.10.0
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: bundler
27
- requirement: &70179267449820 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '1.0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70179267449820
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rspec
38
- requirement: &70179267449300 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,7 +53,12 @@ dependencies:
43
53
  version: '2.7'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70179267449300
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.7'
47
62
  description: Guard::RSpec automatically run your specs (much like autotest).
48
63
  email:
49
64
  - thibaud@thibaud.me
@@ -73,6 +88,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
88
  - - ! '>='
74
89
  - !ruby/object:Gem::Version
75
90
  version: '0'
91
+ segments:
92
+ - 0
93
+ hash: -4256658235828143634
76
94
  required_rubygems_version: !ruby/object:Gem::Requirement
77
95
  none: false
78
96
  requirements:
@@ -81,9 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
99
  version: 1.3.6
82
100
  requirements: []
83
101
  rubyforge_project: guard-rspec
84
- rubygems_version: 1.8.16
102
+ rubygems_version: 1.8.24
85
103
  signing_key:
86
104
  specification_version: 3
87
105
  summary: Guard gem for RSpec
88
106
  test_files: []
89
- has_rdoc: