quick-rspec 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 609d25aae264835c84b20e216eafe15649f39f2b
4
- data.tar.gz: c61ab6e0fc46726ff4ae2bf1e4fe2741a3905e3d
3
+ metadata.gz: 9f366e943008af63b4db06903d875417c58a775a
4
+ data.tar.gz: fa3ce88a4981f14822e430f08d2f627f410ef324
5
5
  SHA512:
6
- metadata.gz: bea679b2683a499a81e56b5206d529bcd68bd97e903d5ace6cd638af7749c93a697a25f0dd56ed3df9ba1ee91c05bc5fba09ebd8ef5083415a69c3df36490e89
7
- data.tar.gz: 59f96b486bcf2d9200e1fe19923917265db38a9f5ac8a894002e4a29266d3219fd308fce7fddf428e4385f491bd41b836289ca367d4981f6e35b70becbc81688
6
+ metadata.gz: a202100554ef2fd30fbbe2aae700d229cfd2527e37d043ce4a063273e488db8da6c82c9bef07a870d6acf8935a5e8e4d6bcef2d0e40a7ccdbc1bf2ebdd88a49a
7
+ data.tar.gz: fd54bb7ff97dfe1769137c488258d2078b5d16fd6d6155683ca36eb03bf38000e0afbcb3c2ffda2075d08d4d53a90b2232ceeca6864696aaa75a7d5fa9ac81dc
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'quick-rspec', require: false, group: [:test, :development]
10
+ gem 'quick-rspec', require: false
11
11
  ```
12
12
 
13
13
  Add this line at the end of your `config/application.rb`
@@ -8,10 +8,8 @@ class QuickRspec < Rails::Railtie
8
8
  end
9
9
 
10
10
  class << self
11
- @@threads = []
12
11
  @@coverage = {}
13
12
  @@last_cover = {}
14
- @@mutex = Mutex.new
15
13
 
16
14
  def start
17
15
  Coverage.start
@@ -22,24 +20,19 @@ class QuickRspec < Rails::Railtie
22
20
  root = Rails.root.to_s
23
21
  result = {}
24
22
  cover = Coverage.peek_result
25
- prev_cover = @@last_cover
26
- @@last_cover = cover
27
- @@threads << Thread.new do
28
- cover.each do |path, coverage|
29
- next unless path =~ %r{^#{Regexp.escape(root)}\/(app|lib|config)\/.*\.rb}i
30
- last_cover = prev_cover[path]
31
- path = QuickRspec.relevant_path(path)
32
- coverage = coverage.each_with_index.map.map do |count, index|
33
- index unless last_cover.present? && count == last_cover[index]
34
- end
35
- coverage.compact!
36
- next unless coverage.any?
37
- result[path] = coverage
38
- end
39
- @@mutex.synchronize do
40
- @@coverage[spec] = result
41
- end
23
+ cover.each do |path, coverage|
24
+ next unless path =~ %r{^#{Regexp.escape(root)}\/(app|lib|config)\/.*\.rb}i
25
+ last_cover = @@last_cover[path]
26
+ next if coverage == last_cover
27
+ coverage = coverage.each_with_index.map.map do |count, index|
28
+ index unless last_cover.present? && count == last_cover[index]
29
+ end.compact
30
+ next unless coverage.any?
31
+ path = QuickRspec.relevant_path(path)
32
+ result[path] = coverage
42
33
  end
34
+ @@coverage[spec] = result
35
+ @@last_cover = cover
43
36
  end
44
37
 
45
38
  def relevant_path(path)
@@ -89,7 +82,6 @@ class QuickRspec < Rails::Railtie
89
82
  end
90
83
 
91
84
  def on_exit
92
- @@threads.map(&:join)
93
85
  QuickRspec.save_stats
94
86
  end
95
87
  end
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  Gem::Specification.new do |spec|
6
6
  spec.required_ruby_version = '>= 2.3'
7
7
  spec.name = "quick-rspec"
8
- spec.version = "0.1.8"
8
+ spec.version = "0.1.9"
9
9
  spec.authors = ["Dmitry Silchenko"]
10
10
  spec.email = ["dmitry@desofto.com"]
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quick-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Silchenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-10 00:00:00.000000000 Z
11
+ date: 2017-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler