Class: Corundum::RSpecReportTask
- Inherits:
-
RSpecTask
- Object
- Mattock::Rake::CommandTask
- RSpecTask
- Corundum::RSpecReportTask
show all
- Defined in:
- lib/corundum/rspec-task.rb
Instance Method Summary
collapse
Methods inherited from RSpecTask
#resolve_runtime_configuration
Instance Method Details
#all_rspec_options ⇒ Object
85
86
87
88
89
|
# File 'lib/corundum/rspec-task.rb', line 85
def all_rspec_options
super + formats.inject([]) do |list, (format, target)|
list + ["--format", format, "--out", target]
end
end
|
#default_configuration(rspec) ⇒ Object
81
82
83
|
# File 'lib/corundum/rspec-task.rb', line 81
def default_configuration(rspec)
super
end
|
#needed? ⇒ Boolean
77
78
79
|
# File 'lib/corundum/rspec-task.rb', line 77
def needed?
! File.exist?(doc_path.abspath) || out_of_date?(timestamp)
end
|
#out_of_date?(stamp) ⇒ Boolean
71
72
73
74
75
|
# File 'lib/corundum/rspec-task.rb', line 71
def out_of_date?(stamp)
prerequisites.any? { |n|
application[n, @scope].timestamp > stamp
}
end
|
#resolve_configuration ⇒ Object
91
92
93
94
|
# File 'lib/corundum/rspec-task.rb', line 91
def resolve_configuration
super
resolve_paths
end
|
#timestamp ⇒ Object
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/corundum/rspec-task.rb', line 60
def timestamp
return Rake::EARLY if formats.empty?
(formats.values + ).map do |path|
if File.exist?(path.to_s)
File.mtime(path.to_s)
else
Rake::EARLY
end
end.min
end
|