coverband 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,14 +15,16 @@ module Coverband
15
15
  File.open('./tmp/coverband_baseline.json', 'w') {|f| f.write(results.to_json) }
16
16
  end
17
17
 
18
- def self.report
18
+ def self.report(options = {})
19
19
  redis = Coverband.configuration.redis
20
20
  roots = Coverband.configuration.root_paths
21
21
  existing_coverage = Coverband.configuration.coverage_baseline
22
+ open_report = options.fetch(:open_report){ true }
23
+
22
24
  roots << "#{current_root}/"
23
25
  puts "fixing root: #{roots.join(', ')}"
24
26
  if Coverband.configuration.reporter=='scov'
25
- report_scov(redis, existing_coverage, roots)
27
+ report_scov(redis, existing_coverage, roots, open_report)
26
28
  else
27
29
  lines = redis.smembers('coverband').map{|key| report_line(redis, key) }
28
30
  puts lines.join("\n")
@@ -49,7 +51,7 @@ module Coverband
49
51
  fixed_report
50
52
  end
51
53
 
52
- def self.report_scov(redis, existing_coverage, roots)
54
+ def self.report_scov(redis, existing_coverage, roots, open_report)
53
55
  scov_style_report = {}
54
56
  redis.smembers('coverband').each{|key| line_data = line_hash(redis, key, roots); scov_style_report.merge!(line_data) if line_data }
55
57
  scov_style_report = fix_file_names(scov_style_report, roots)
@@ -58,7 +60,11 @@ module Coverband
58
60
  puts "report: "
59
61
  puts scov_style_report.inspect
60
62
  SimpleCov::Result.new(scov_style_report).format!
61
- `open coverage/index.html`
63
+ if open_report
64
+ `open #{SimpleCov.coverage_dir}/index.html`
65
+ else
66
+ puts "report is ready and viewable: open #{SimpleCov.coverage_dir}/index.html"
67
+ end
62
68
  end
63
69
 
64
70
  def self.merge_existing_coverage(scov_style_report, existing_coverage)
@@ -1,3 +1,3 @@
1
1
  module Coverband
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coverband
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
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: 2014-03-08 00:00:00.000000000 Z
12
+ date: 2014-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -182,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  segments:
184
184
  - 0
185
- hash: -2201223091774651170
185
+ hash: -2542793412293765317
186
186
  required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  none: false
188
188
  requirements:
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: -2201223091774651170
194
+ hash: -2542793412293765317
195
195
  requirements: []
196
196
  rubyforge_project:
197
197
  rubygems_version: 1.8.23