ruby_memcheck 1.0.0 → 1.0.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
  SHA256:
3
- metadata.gz: 751718a23aee213973e93656dba653e4e253fd3f83618007c39e809827273ac5
4
- data.tar.gz: 55d6196fb48e0c18fabb5c87536c2c4114d7a1c1a2b04128ec2c707389934de0
3
+ metadata.gz: 6afc968d17cd1fabb39f254c3f2373534773e42b094345765c058538cc05b208
4
+ data.tar.gz: fe3603ae51113b37d9e07b38e981c0ddab8e9b5059c8c8a797dbc21f5dd31b30
5
5
  SHA512:
6
- metadata.gz: 861d0639b3d06d124f4020cb372472954018ad113ba4864b9367be6c6d167a338297d18c7c4adbcae767ba4a30e8925402bd7faa5a97841a513914ce41e10997
7
- data.tar.gz: e0dc1e236947746baef93281f00ec8129f651b7e560e56d2dffc5c188f14e5b32b39adc204ecea2da51c1e9ed341f1c00ff55b4b82521bb2b7b54085d5bfddfc
6
+ metadata.gz: c4402ac65e791413b6e46abf296d21ca1bcd6277469a743a9f00fbadb3802993746ccdd89064de7171c1a4609c8162c245ef8d08d4314e0d598abb1a7f287585
7
+ data.tar.gz: '08dfe5c75b6502f563b739d98c8821b3c199fe37dae0f1078158ffc4e43933d18bd508efd7901320c4ad254c4703cbf78ba1de7afe734122acf368d99503e7f7'
@@ -10,8 +10,9 @@ module RubyMemcheck
10
10
 
11
11
  def report_valgrind_errors
12
12
  if configuration.valgrind_xml_dir
13
- parse_valgrind_output
14
- remove_valgrind_xml_files
13
+ xml_files = valgrind_xml_files
14
+ parse_valgrind_output(xml_files)
15
+ remove_valgrind_xml_files(xml_files)
15
16
 
16
17
  unless errors.empty?
17
18
  output_valgrind_errors
@@ -20,12 +21,16 @@ module RubyMemcheck
20
21
  end
21
22
  end
22
23
 
23
- def parse_valgrind_output
24
+ def valgrind_xml_files
25
+ Dir[File.join(configuration.valgrind_xml_dir, "*")]
26
+ end
27
+
28
+ def parse_valgrind_output(xml_files)
24
29
  require "nokogiri"
25
30
 
26
31
  @errors = []
27
32
 
28
- Dir[File.join(configuration.valgrind_xml_dir, "*")].each do |file|
33
+ xml_files.each do |file|
29
34
  Nokogiri::XML::Reader(File.open(file)).each do |node|
30
35
  next unless node.name == "error" && node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
31
36
  error_xml = Nokogiri::XML::Document.parse(node.outer_xml).root
@@ -36,15 +41,17 @@ module RubyMemcheck
36
41
  end
37
42
  end
38
43
 
44
+ def remove_valgrind_xml_files(xml_files)
45
+ xml_files.each do |file|
46
+ File.delete(file)
47
+ end
48
+ end
49
+
39
50
  def output_valgrind_errors
40
51
  @errors.each do |error|
41
52
  configuration.output_io.puts error
42
53
  configuration.output_io.puts
43
54
  end
44
55
  end
45
-
46
- def remove_valgrind_xml_files
47
- FileUtils.rm_rf(configuration.valgrind_xml_dir)
48
- end
49
56
  end
50
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyMemcheck
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_memcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Zhu