Class: MetricFu::RCovTestCoverageClient
- Inherits:
-
Object
- Object
- MetricFu::RCovTestCoverageClient
- Defined in:
- lib/metric_fu/metrics/rcov/external_client.rb
Instance Method Summary collapse
- #dump(payload) ⇒ Object
-
#initialize(coverage_file) ⇒ RCovTestCoverageClient
constructor
A new instance of RCovTestCoverageClient.
- #load ⇒ Object
- #post_results(payload) ⇒ Object
Constructor Details
#initialize(coverage_file) ⇒ RCovTestCoverageClient
Returns a new instance of RCovTestCoverageClient.
4 5 6 7 |
# File 'lib/metric_fu/metrics/rcov/external_client.rb', line 4 def initialize(coverage_file) @file_path = Pathname(coverage_file) @file_path.dirname.mkpath end |
Instance Method Details
#dump(payload) ⇒ Object
18 19 20 |
# File 'lib/metric_fu/metrics/rcov/external_client.rb', line 18 def dump(payload) File.open(@file_path, "wb") { |file| file.write(payload) } end |
#load ⇒ Object
14 15 16 |
# File 'lib/metric_fu/metrics/rcov/external_client.rb', line 14 def load File.binread(@file_path) end |
#post_results(payload) ⇒ Object
9 10 11 12 |
# File 'lib/metric_fu/metrics/rcov/external_client.rb', line 9 def post_results(payload) mf_log "Saving coverage payload to #{@file_path}" dump(payload) end |