Class: Corundum::RSpecReportTask

Inherits:
RSpecTask
  • Object
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_optionsObject



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

Returns:

  • (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

Returns:

  • (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_configurationObject



91
92
93
94
# File 'lib/corundum/rspec-task.rb', line 91

def resolve_configuration
  super
  resolve_paths
end

#timestampObject



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 + extra_products).map do |path|
    if File.exist?(path.to_s)
      File.mtime(path.to_s)
    else
      Rake::EARLY
    end
  end.min
end