guard-rspec 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,14 +62,16 @@ module Guard
62
62
  end
63
63
  end
64
64
 
65
- def default_formatter
66
- @default_formatter ||= unless @options[:cli] =~ formatter_regex
65
+ def parsed_or_default_formatter
66
+ @parsed_or_default_formatter ||= begin
67
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(' ')
68
+ parsed_formatter = if File.exist?(file_name)
69
+ formatters = File.read(file_name).scan(formatter_regex).flatten
70
+ formatters.map { |formatter| "-f #{formatter}" }.join(' ')
71
71
  end
72
- end || '-f progress'
72
+
73
+ parsed_formatter.nil? || parsed_formatter.empty? ? '-f progress' : parsed_formatter
74
+ end
73
75
  end
74
76
 
75
77
  private
@@ -77,8 +79,8 @@ module Guard
77
79
  def rspec_arguments(paths, options)
78
80
  arg_parts = []
79
81
  arg_parts << options[:cli]
82
+ arg_parts << parsed_or_default_formatter unless options[:cli] =~ formatter_regex
80
83
  if @options[:notification]
81
- arg_parts << default_formatter unless options[:cli] =~ formatter_regex
82
84
  arg_parts << "-r #{File.dirname(__FILE__)}/formatters/notification_#{rspec_class.downcase}.rb"
83
85
  arg_parts << "-f Guard::RSpec::Formatter::Notification#{rspec_class}#{rspec_version == 1 ? ":" : " --out "}/dev/null"
84
86
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module RSpecVersion
3
- VERSION = "0.7.1"
3
+ VERSION = "0.7.2"
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.1
4
+ version: 0.7.2
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-05-12 00:00:00.000000000 Z
12
+ date: 2012-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  segments:
92
92
  - 0
93
- hash: -4256658235828143634
93
+ hash: -3238188495715962331
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements: