lib/respec/app.rb in respec-0.3.0 vs lib/respec/app.rb in respec-0.4.0
- old
+ new
@@ -14,49 +14,35 @@
@update_failures = true
process_args
end
def command
- @command ||= bundler_args + ['rspec'] + formatter_args + default_formatter_args + generated_args + raw_args
+ @command ||= bundler_args + ['rspec'] + generated_args + raw_args + formatter_args
end
def bundler_args
if File.exist?(ENV['BUNDLE_GEMFILE'] || 'Gemfile')
['bundle', 'exec']
else
[]
end
end
+ attr_reader :generated_args, :raw_args
+
def formatter_args
if @update_failures
- formatter_path = File.expand_path('formatter.rb', File.dirname(__FILE__))
- ['--require', formatter_path, '--format', 'Respec::Formatter', '--out', failures_path]
+ [File.expand_path('formatter.rb', File.dirname(__FILE__))]
else
[]
end
end
- def default_formatter_args
- args = @generated_args + @raw_args + dotfile_args
- if args.include?('-f') || args.include?('--format') || args.include?('--formatter')
- []
- else
- ['--format', 'progress']
- end
- end
-
- attr_reader :generated_args, :raw_args
-
class << self
attr_accessor :failures_path
- attr_accessor :local_rspec_config_path
- attr_accessor :global_rspec_config_path
end
self.failures_path = ENV['RESPEC_FAILURES'] || File.expand_path(".respec_failures")
- self.local_rspec_config_path = '.rspec'
- self.global_rspec_config_path = File.expand_path('~/.rspec')
def help_only?
@help_only
end
@@ -129,15 +115,9 @@
end
# If we selected individual failures to rerun, don't give the files to
# rspec, as those files will be run in their entirety.
@generated_args = args
@generated_args.concat(files) unless @selected_failures
- end
-
- def dotfile_args
- [self.class.local_rspec_config_path, self.class.global_rspec_config_path].map do |path|
- File.exist?(path) ? File.read(path) : ''
- end.join(' ').split
end
def failures_path
self.class.failures_path
end