quick-rspec 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/quick-rspec.rb +12 -20
- data/quick-rspec.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f366e943008af63b4db06903d875417c58a775a
|
4
|
+
data.tar.gz: fa3ce88a4981f14822e430f08d2f627f410ef324
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a202100554ef2fd30fbbe2aae700d229cfd2527e37d043ce4a063273e488db8da6c82c9bef07a870d6acf8935a5e8e4d6bcef2d0e40a7ccdbc1bf2ebdd88a49a
|
7
|
+
data.tar.gz: fd54bb7ff97dfe1769137c488258d2078b5d16fd6d6155683ca36eb03bf38000e0afbcb3c2ffda2075d08d4d53a90b2232ceeca6864696aaa75a7d5fa9ac81dc
|
data/README.md
CHANGED
data/lib/quick-rspec.rb
CHANGED
@@ -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
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
last_cover
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
data/quick-rspec.gemspec
CHANGED
@@ -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
|
+
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.
|
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-
|
11
|
+
date: 2017-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|