oyencov 0.0.10 → 0.0.12

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
  SHA256:
3
- metadata.gz: 9a4f51c426c0d097999e548f0ba5920105655e1fbb04b731055573889239fb85
4
- data.tar.gz: 57eee19f6e39579159c9175ee78faf3b8b7e6e40d8f1adb15fe85d325ee0c652
3
+ metadata.gz: ff6218062a4304c064bd18b563304049fae93dbb3e1a17abc4eaaf5cf3bf4745
4
+ data.tar.gz: 78e2fcd58b5bd068f18a8b41b2bee65d03e2ca83df60d5b829591408980d57f8
5
5
  SHA512:
6
- metadata.gz: cf0d4fd53946d6fe3e43155a3dd9aa3dca94d81054a8b8b0789e29a3241cb26589f25e565fb0b31e4874ae5ec91f8e69c47defc275a4d2272259f4c8823ec7bf
7
- data.tar.gz: 106e34406d36a110d79f21b536c0deaa304ff3ed927b100c7343917b5a6c4dbe0d05c70a400d84e69d2e97d5a7a918e3d1fa712474ca896a506c13d84f35dc45
6
+ metadata.gz: 8aa056eaf6620a3fa79aa1abfab6d0bd8710726ebb6e5c6adbd86127759ab056e5a56dfedddd0e3c08abdaa01c609ebe3a67f8d79cb7177a29086628a4f96d1c
7
+ data.tar.gz: cbbace7739cc6a26223c16a3a3bc31cba672e78f68af41249e2763d7c458fa7bf241d010beea1a42d61ab19434dd86083515d6e8fe9c5bd33a6744b4e1fdb466
@@ -52,8 +52,8 @@ module OyenCov
52
52
  filtered.each_pair do |fpath, line_hits|
53
53
  MethodRangeParser[fpath]&.each_pair do |method_name, line_num|
54
54
  # puts [method_name, line_num, line_hits[line_num]]
55
- next if line_num.nil? || line_hits[line_num].nil?
56
- current_method_hits[method_name] = line_hits[line_num]
55
+ next if line_num.nil? || line_hits[line_num - 1].nil?
56
+ current_method_hits[method_name] = line_hits[line_num - 1]
57
57
  end
58
58
  end
59
59
 
@@ -25,6 +25,7 @@ module OyenCov
25
25
  # @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
26
  private_class_method def self.parse_file(filepath)
27
27
  traverse_ast(Parser::CurrentRuby.parse(File.read(filepath)))
28
+ .reverse
28
29
  .to_h
29
30
  .select do |k, v|
30
31
  /\.|\#/.match?(k)
@@ -78,11 +79,10 @@ module OyenCov
78
79
 
79
80
  node_children = node.children.find do |i|
80
81
  Parser::AST::Node === i && i.type == :begin
81
- end&.children || [node.children[-1]]
82
+ end&.children || node.children
82
83
 
83
84
  ownself_name = declaration_name(node)
84
85
  ownself_range = definition_line_num(node)
85
-
86
86
  children_name_range = []
87
87
 
88
88
  node_children&.each do |cnode|
@@ -1,3 +1,3 @@
1
1
  module OyenCov
2
- VERSION = "0.0.10".freeze
2
+ VERSION = "0.0.12".freeze
3
3
  end
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.10
4
+ version: 0.0.12
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-05-16 00:00:00.000000000 Z
11
+ date: 2024-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday