simplecov-parallel 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e92642ff81ef2e617345126a45380f06cc55a23a
4
- data.tar.gz: 4eda4cf6cc80c3dbd4e2a22f603fe6e97d2d7e80
3
+ metadata.gz: 4fdc5794fb5634ad9c97afcdf6783daf7d1220cd
4
+ data.tar.gz: 055eb756b87784b13681d0fc9bcf54bc3558f30b
5
5
  SHA512:
6
- metadata.gz: 4563472ac7358a32d559f0ebeada789dbcf0424558bd96931948f4ef86619967a4f27e104c058be4565cc8a9f338a661a2d3459699bfc7ebb35a133ba74592e9
7
- data.tar.gz: ee2d6183d9213721c54fbfa849453364f1778ce1085af9932b4fc212f401dd63ac84ffd83019c966fd8e71ce1295184c55b6069c21c20b002ed6c9d7bce6b353
6
+ metadata.gz: ca8662037eed8bce87500d0c9958506b76599d291cb9098e03fb7c7c770f5ac6e9193d72d02bf96d0f342ba308a2b223e0546d2ac29a72af9163dfb8b8a4c8d6
7
+ data.tar.gz: 4bd82d8cb9c78f9ef55d7f4a115bb795ef14313c330fa8a7f4a9b6ec8f19b52ead689a58e654f98f34d75d505bcd1893d6b104ede5c7d0fcd999c05e1e9e0b49
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## Development
4
+
5
+ ## v0.1.1
6
+
7
+ * Fix a bug in method stashing of `SimpleCov::ResultMerger#resultset_path`.
8
+
9
+ ## v0.1.0
10
+
11
+ * Initial release.
data/Gemfile CHANGED
@@ -11,3 +11,7 @@ group :development, :test do
11
11
  gem 'rspec', '~> 3.5'
12
12
  gem 'rubocop', '~> 0.42'
13
13
  end
14
+
15
+ group :test do
16
+ gem 'codeclimate-test-reporter', '~> 0.6'
17
+ end
data/README.md CHANGED
@@ -1,6 +1,11 @@
1
+ [![Gem Version](http://img.shields.io/gem/v/simplecov-parallel.svg?style=flat)](http://badge.fury.io/rb/simplecov-parallel)
2
+ [![Dependency Status](http://img.shields.io/gemnasium/increments/simplecov-parallel.svg?style=flat)](https://gemnasium.com/increments/simplecov-parallel)
3
+ [![CircleCI](https://circleci.com/gh/increments/simplecov-parallel.svg?style=shield)](https://circleci.com/gh/increments/simplecov-parallel)
4
+ [![Code Climate](https://img.shields.io/codeclimate/github/increments/simplecov-parallel.svg?style=flat)](https://codeclimate.com/github/increments/simplecov-parallel)
5
+
1
6
  # SimpleCov::Parallel
2
7
 
3
- **SimpleCov::Parallel** is a SimpleCov extension for parallelism support.
8
+ **SimpleCov::Parallel** is a [SimpleCov](https://github.com/colszowka/simplecov) extension for parallelism support.
4
9
  Currently only [CircleCI parallelism](https://circleci.com/docs/parallelism/) is supported.
5
10
 
6
11
  ## Installation
@@ -59,7 +59,7 @@ module SimpleCov
59
59
  def merge_slave_node_results
60
60
  Dir.glob('node*') do |node_dir|
61
61
  results = load_results_from_dir(node_dir)
62
- merge_and_save_results_to_dir(results, SimpleCov.coverage_path)
62
+ merge_and_save_results(results)
63
63
  end
64
64
  end
65
65
 
@@ -69,10 +69,8 @@ module SimpleCov
69
69
  end
70
70
  end
71
71
 
72
- def merge_and_save_results_to_dir(results, dir)
73
- with_changing_resultset_path(dir) do
74
- results.each { |result| SimpleCov::ResultMerger.store_result(result) }
75
- end
72
+ def merge_and_save_results(results)
73
+ results.each { |result| SimpleCov::ResultMerger.store_result(result) }
76
74
  end
77
75
 
78
76
  def with_changing_resultset_path(dir)
@@ -80,15 +78,19 @@ module SimpleCov
80
78
  # SimpleCov.root and SimpleCov.coverage_dir does not work well because .root is used in
81
79
  # the root filter, which is invoked from SimpleCov::Result#initialize.
82
80
  # https://github.com/colszowka/simplecov/blob/v0.12.0/lib/simplecov/defaults.rb#L9
83
- unbound_method = SimpleCov::ResultMerger.method(:resultset_path).unbind
84
-
85
- SimpleCov::ResultMerger.define_singleton_method(:resultset_path) do
86
- File.join(dir, '.resultset.json')
81
+ method_name = :resultset_path
82
+ original_method = SimpleCov::ResultMerger.method(method_name)
83
+ singleton_class = SimpleCov::ResultMerger.singleton_class
84
+
85
+ singleton_class.__send__(:undef_method, method_name)
86
+ singleton_class.__send__(:define_method, method_name) { File.join(dir, '.resultset.json') }
87
+
88
+ begin
89
+ yield
90
+ ensure
91
+ singleton_class.__send__(:undef_method, method_name)
92
+ singleton_class.__send__(:define_method, method_name, original_method)
87
93
  end
88
-
89
- yield
90
- ensure
91
- unbound_method.bind(SimpleCov::ResultMerger)
92
94
  end
93
95
 
94
96
  def current_node
@@ -3,7 +3,7 @@ module SimpleCov
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 0
6
+ PATCH = 1
7
7
 
8
8
  def self.to_s
9
9
  [MAJOR, MINOR, PATCH].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov-parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Nakayama
@@ -62,6 +62,7 @@ files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
64
  - ".rubocop.yml"
65
+ - CHANGELOG.md
65
66
  - Gemfile
66
67
  - LICENSE.txt
67
68
  - README.md