oyencov 0.0.14 → 0.0.16
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 +4 -4
- data/lib/oyencov/method_range_parser.rb +5 -0
- data/lib/oyencov/puma/plugin/oyencov.rb +2 -2
- data/lib/oyencov/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86ccbaeab7bc98e4cf43170065e6440687011bc96d5053a208509d0039dc9b15
|
4
|
+
data.tar.gz: 98245151e9b61667a65ed8a5820d570d7afd8a39be1529d3ae2f479d252ce04f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d4a686bfb48925a2a2ec0444eb8aac159ee721773d6c2bf279f1cb6991cf54530682d01e442005a7269888ccf712068b590b403e798d6b8f9f4069004cece05
|
7
|
+
data.tar.gz: b5b696fc7c769ff01f1051de03fcb701e1e333b26697e318c01e53be91b4a06e8c6799b259d1dfeb3e37391ce6ca21cd4de6f830171c12b1bf3d64ad40ffd2ee
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "parser/current"
|
2
|
+
require_relative "logger"
|
2
3
|
|
3
4
|
# This module helps scanning source code files and get the definition line
|
4
5
|
# ranges, so we can count how many times a method has been executed.
|
@@ -24,6 +25,10 @@ module OyenCov
|
|
24
25
|
#
|
25
26
|
# @return [Hash<String, >] Hash of methods to their children starting line count. The line count can be used to read how often the method is executed from `Coverage.peek_result`
|
26
27
|
private_class_method def self.parse_file(filepath)
|
28
|
+
unless File.exist?(filepath)
|
29
|
+
return nil
|
30
|
+
end
|
31
|
+
|
27
32
|
ast = traverse_ast(Parser::CurrentRuby.parse(File.read(filepath))) || []
|
28
33
|
ast.reverse
|
29
34
|
.to_h
|
@@ -8,7 +8,7 @@ defined?(Puma::Plugin.create) && Puma::Plugin.create do
|
|
8
8
|
def config(c)
|
9
9
|
OyenCov::Logger.log("Puma::Plugin.create config(c) running...")
|
10
10
|
|
11
|
-
c.on_booted do
|
11
|
+
defined?(c.on_booted) && c.on_booted do
|
12
12
|
OyenCov::Logger.log("Puma::Plugin.create config on_booted called")
|
13
13
|
OyenCov::Background.start
|
14
14
|
if defined?(Rails::Railtie)
|
@@ -18,7 +18,7 @@ defined?(Puma::Plugin.create) && Puma::Plugin.create do
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
c.on_worker_boot do
|
21
|
+
defined?(c.on_worker_boot) && c.on_worker_boot do
|
22
22
|
OyenCov::Logger.log("Puma::Plugin.create config on_worker_boot called")
|
23
23
|
OyenCov::Background.start
|
24
24
|
if defined?(Rails::Railtie)
|
data/lib/oyencov/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oyencov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anonoz Chong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|