hoe-debugging 1.5.0 → 2.0.0

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: d39769e054a2227a063051c68b0599af45f585371f75cccd36410f573d512923
4
- data.tar.gz: 47c2207158e4ed4968d7c221c8536bfe29f962506e7c7705830bfd765d6bfbdf
3
+ metadata.gz: 710365d2aec2b10a796ca148b55d1a5cde267ca71fa586d309d7bca22cea425c
4
+ data.tar.gz: 638fbb729911666cf26fb2254b2d9a9881c6f61a9c5964fc21ef3e6b37a573f4
5
5
  SHA512:
6
- metadata.gz: 29f3d8e7cf2944169832cb7f7189baf525c16790b2dc77a49916ba36117ee50d0a5d2c726c40c9cb6ec6a3d41154e4fa704cb7465b02f8503e3fa2da35b1762d
7
- data.tar.gz: 22f26dd9e758470f71f891d0cf719e173c1bec60e5c7e56709d46b46a8f645daa70483cc83ecd1fc4cb2f73a60caf765ea8081b8563be06d595f105a4a5c40c2
6
+ metadata.gz: d7b861f1dbe2c194c02ecbf543e950ba30742e733c3600b8318f6336aad9a49124e8f198cc097361434aac72440ddaf906df33a105f79f9a072c8f12b1b5f3e0
7
+ data.tar.gz: dcda2861f6bc1b9fff1f5a63e61c28a636687bdabbaaaf3095defa28a091dd55624de5507ed16621769325251f3dee7ecdc67c05c6941eefc195602e7761c445
@@ -1,6 +1,16 @@
1
- == Changelog for `hoe-debugging`
1
+ ## Changelog for `hoe-debugging`
2
2
 
3
- === 1.5.0 / 2018-11-02
3
+ ### 2.0.0 / 2018-11-04
4
+
5
+ Features:
6
+
7
+ * Allow multiple suppression files to be active at once. Pull in all
8
+ suppression files that match a part of the ruby version. Along with
9
+ this change, the helper method `matching_suppression_file` is
10
+ renamed to `matching_suppression_files`.
11
+
12
+
13
+ ### 1.5.0 / 2018-11-02
4
14
 
5
15
  Features:
6
16
 
@@ -8,21 +18,21 @@ Features:
8
18
  * Rake task `valgrind:suppression` can generate a suppression file from a previous run's log file. Great for when CI finds things that are hard to reproduce!
9
19
 
10
20
 
11
- === 1.4.2 / 2017-06-19
21
+ ### 1.4.2 / 2017-06-19
12
22
 
13
23
  Features:
14
24
 
15
25
  * Allow matching suppression file on major Ruby version.
16
26
 
17
27
 
18
- === 1.4.1 / 2017-06-19
28
+ ### 1.4.1 / 2017-06-19
19
29
 
20
30
  Features:
21
31
 
22
32
  * Support frozen string constants.
23
33
 
24
34
 
25
- === 1.4.0 / 2017-06-19
35
+ ### 1.4.0 / 2017-06-19
26
36
 
27
37
  Features:
28
38
 
@@ -34,19 +44,19 @@ Bugfixes:
34
44
  * Fixed generation of suppression files.
35
45
 
36
46
 
37
- === 1.3.0 / 2017-01-20
47
+ ### 1.3.0 / 2017-01-20
38
48
 
39
49
  * The rake task now fails if valgrind detects any errors during the run.
40
50
 
41
51
 
42
- === 1.2.1 / 2015-12-16
52
+ ### 1.2.1 / 2015-12-16
43
53
 
44
54
  Features:
45
55
 
46
56
  * Set larger stack size (via `ulimit -s`) to properly support Ruby 2.1 and later
47
57
 
48
58
 
49
- === 1.2.0 / 2015-01-22
59
+ ### 1.2.0 / 2015-01-22
50
60
 
51
61
  Features:
52
62
 
@@ -58,40 +68,40 @@ Bugfixes:
58
68
  * Replace references to `Config` with `RbConfig`, for Ruby 2.2 support.
59
69
 
60
70
 
61
- === 1.1.1 / 2012-11-26
71
+ ### 1.1.1 / 2012-11-26
62
72
 
63
73
  Bugfixes:
64
74
 
65
75
  * Correctly name suppression files for REE.
66
76
 
67
77
 
68
- === 1.1.0 / 2012-09-26
78
+ ### 1.1.0 / 2012-09-26
69
79
 
70
80
  * Valgrind suppressions can be generated with `rake test:valgrind:suppression`
71
81
  * If present, valgrind suppressions will be used when valgrinding.
72
82
 
73
- === 1.0.5 / 2012-06-19
83
+ ### 1.0.5 / 2012-06-19
74
84
 
75
85
  * RSpec support now works with TESTOPTS.
76
86
 
77
- === 1.0.4 / 2012-06-19
87
+ ### 1.0.4 / 2012-06-19
78
88
 
79
89
  * Adding support for RSpec.
80
90
 
81
- === 1.0.3 / 2012-02-06
91
+ ### 1.0.3 / 2012-02-06
82
92
 
83
93
  * Fixing compatibility with latter-day versions of rake. #1
84
94
 
85
- === 1.0.2 / 2011-11-13
95
+ ### 1.0.2 / 2011-11-13
86
96
 
87
97
  * Fixing reference to ::RUBY with rbconfig-based construction of the ruby interpreter path.
88
98
 
89
- === 1.0.1 / 2009-06-26
99
+ ### 1.0.1 / 2009-06-26
90
100
 
91
101
  * Fix Hoe dependency version.
92
102
  * Activate the hoe-git plugin.
93
103
  * Fix docs, give Mike some well-deserved credit!
94
104
 
95
- === 1.0.0 / 2009-06-22
105
+ ### 1.0.0 / 2009-06-22
96
106
 
97
107
  * Birthday!
@@ -1,5 +1,5 @@
1
1
  .rspec
2
- CHANGELOG.rdoc
2
+ CHANGELOG.md
3
3
  LICENSE
4
4
  Manifest.txt
5
5
  README.md
data/README.md CHANGED
@@ -60,6 +60,35 @@ rake test:valgrind # when this runs, the errors from that log file will be suppr
60
60
  ```
61
61
 
62
62
 
63
+ ## Suppression files
64
+
65
+ Suppression files can be added to the `suppressions` subdirectory of your project.
66
+
67
+ As of v2.0.0, `hoe-debugging` will use all suppression files that match any part of your Ruby's version. It uses the Hoe project name and the ruby version name, with an optional trailing `/_.*/`.
68
+
69
+ For example, if:
70
+
71
+ * my Hoe project was named `myproject`
72
+ * and my Ruby version was `2.5.1.57` (the `57` is `RUBY_PATCHLEVEL`)
73
+
74
+ then the following would be found and used:
75
+
76
+ * `suppressions/myproject_ruby-2.5.1.57.supp`
77
+ * `suppressions/myproject_ruby-2.5.1.57_namespace_deref.supp`
78
+ * `suppressions/myproject_ruby-2.5.1.supp`
79
+ * `suppressions/myproject_ruby-2.5.supp`
80
+ * `suppressions/myproject_ruby-2.supp`
81
+ * `suppressions/myproject_ruby-2_exit_frees.supp`
82
+
83
+ and the following would **not** be used:
84
+
85
+ * `suppressions/otherproject_ruby-2.5.1.57.supp` because the project name is wrong
86
+ * `suppressions/myproject_ruby-2.5.1.58.supp` because the patchlevel is wrong
87
+ * `suppressions/myproject_ruby-2.5.2.supp` because the patch is wrong
88
+ * `suppressions/myproject_ruby-2.4.supp` because the minor is wrong
89
+ * `suppressions/myproject_ruby-1.supp` because the major is wrong
90
+
91
+
63
92
  ## Installation
64
93
 
65
94
  ```
data/Rakefile CHANGED
@@ -10,8 +10,7 @@ Hoe.spec "hoe-debugging" do
10
10
  developer "John Barnette", "jbarnette@rubyforge.org"
11
11
  developer "Mike Dalessio", "mike.dalessio@gmail.com"
12
12
 
13
- self.extra_rdoc_files = FileList["*.rdoc"]
14
- self.history_file = "CHANGELOG.rdoc"
13
+ self.history_file = "CHANGELOG.md"
15
14
  self.readme_file = "README.md"
16
15
 
17
16
  license "MIT"
@@ -11,7 +11,7 @@ class Hoe #:nodoc:
11
11
  # * <tt>test:valgrind:mem0</tt>
12
12
 
13
13
  module Debugging
14
- VERSION = "1.5.0" #:nodoc:
14
+ VERSION = "2.0.0" #:nodoc:
15
15
 
16
16
  ##
17
17
  # The exit code of valgrind when it detects an error.
@@ -66,7 +66,8 @@ class Hoe #:nodoc:
66
66
  end
67
67
 
68
68
  def hoe_debugging_check_for_suppression_file options
69
- if suppression_file = hoe_debugging_valgrind_helper.matching_suppression_file
69
+ suppression_files = hoe_debugging_valgrind_helper.matching_suppression_files
70
+ suppression_files.each do |suppression_file|
70
71
  puts "NOTICE: using valgrind suppressions in #{suppression_file.inspect}"
71
72
  options << "--suppressions=#{suppression_file}"
72
73
  end
@@ -150,10 +151,10 @@ class Hoe #:nodoc:
150
151
  end
151
152
 
152
153
  def version_matches
153
- matches = [formatted_ruby_version]
154
- matches << formatted_ruby_version.split(".")[0,3].join(".")
155
- matches << formatted_ruby_version.split(".")[0,2].join(".")
156
- matches << formatted_ruby_version.split(".")[0,1].join(".")
154
+ matches = [formatted_ruby_version] # e.g. "ruby-2.5.1.57"
155
+ matches << formatted_ruby_version.split(".")[0,3].join(".") # e.g. "ruby-2.5.1"
156
+ matches << formatted_ruby_version.split(".")[0,2].join(".") # e.g. "ruby-2.5"
157
+ matches << formatted_ruby_version.split(".")[0,1].join(".") # e.g. "ruby-2"
157
158
  matches
158
159
  end
159
160
 
@@ -188,12 +189,13 @@ class Hoe #:nodoc:
188
189
  filename
189
190
  end
190
191
 
191
- def matching_suppression_file
192
+ def matching_suppression_files
193
+ matching_files = []
192
194
  version_matches.each do |version_string|
193
- matches = Dir[File.join(directory, "#{project_name}_#{version_string}*.supp")]
194
- return matches[0] if matches[0]
195
+ matching_files += Dir[File.join(directory, "#{project_name}_#{version_string}.supp")]
196
+ matching_files += Dir[File.join(directory, "#{project_name}_#{version_string}_*.supp")]
195
197
  end
196
- nil
198
+ matching_files
197
199
  end
198
200
 
199
201
  def valgrind
@@ -54,44 +54,41 @@ describe Hoe::Debugging::ValgrindHelper do
54
54
  end
55
55
  end
56
56
 
57
- describe "#matching_suppression_file" do
57
+ describe "#matching_suppression_files" do
58
58
  context "there are multiple matches" do
59
- it "returns the best match" do
59
+ it "returns all matches" do
60
60
  helper = klass.new "myproj", :directory => suppressions_directory
61
- exact_match = File.join(suppressions_directory, "myproj_#{helper.formatted_ruby_version}.supp")
62
- inexact_match = File.join(suppressions_directory, "myproj_#{helper.version_matches[1]}.999999999.supp")
63
- FileUtils.mkdir_p suppressions_directory
64
- FileUtils.touch inexact_match
65
- FileUtils.touch exact_match
66
- expect(helper.matching_suppression_file).to eq exact_match
67
- end
68
- end
61
+ matching_files = helper.version_matches.map do |version_match|
62
+ File.join(suppressions_directory, "myproj_#{version_match}.supp")
63
+ end
64
+ inexact_match = File.join(suppressions_directory, "myproj_#{helper.version_matches[1]}.99999.supp")
65
+ all_files = matching_files + [inexact_match]
69
66
 
70
-
71
- context "there is one inexact match" do
72
- it "returns it" do
73
- helper = klass.new "myproj", :directory => suppressions_directory
74
- inexact_match = File.join(suppressions_directory, "myproj_#{helper.version_matches[1]}.999999999.supp")
75
67
  FileUtils.mkdir_p suppressions_directory
76
- FileUtils.touch inexact_match
77
- expect(helper.matching_suppression_file).to eq inexact_match
68
+ all_files.each { |f| FileUtils.touch f }
69
+
70
+ expect(helper.matching_suppression_files).to eq(matching_files)
78
71
  end
79
- end
80
72
 
81
- context "there is one exact match" do
82
- it "returns it" do
73
+ it "returns all matches even with trailing desc" do
83
74
  helper = klass.new "myproj", :directory => suppressions_directory
84
- exact_match = File.join(suppressions_directory, "myproj_#{helper.formatted_ruby_version}.supp")
75
+ matching_files = helper.version_matches.map do |version_match|
76
+ File.join(suppressions_directory, "myproj_#{version_match}_foo.supp")
77
+ end
78
+ inexact_match = File.join(suppressions_directory, "myproj_#{helper.version_matches[1]}.99999_foo.supp")
79
+ all_files = matching_files + [inexact_match]
80
+
85
81
  FileUtils.mkdir_p suppressions_directory
86
- FileUtils.touch exact_match
87
- expect(helper.matching_suppression_file).to eq exact_match
82
+ all_files.each { |f| FileUtils.touch f }
83
+
84
+ expect(helper.matching_suppression_files).to eq(matching_files)
88
85
  end
89
86
  end
90
87
 
91
88
  context "there are zero matches" do
92
89
  it "returns nil" do
93
90
  helper = klass.new "myproj", :directory => suppressions_directory
94
- expect(helper.matching_suppression_file).to be_nil
91
+ expect(helper.matching_suppression_files).to eq([])
95
92
  end
96
93
  end
97
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe-debugging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Barnette
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-11-02 00:00:00.000000000 Z
12
+ date: 2018-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -149,12 +149,12 @@ email:
149
149
  executables: []
150
150
  extensions: []
151
151
  extra_rdoc_files:
152
- - CHANGELOG.rdoc
152
+ - CHANGELOG.md
153
153
  - Manifest.txt
154
154
  - README.md
155
155
  files:
156
156
  - ".rspec"
157
- - CHANGELOG.rdoc
157
+ - CHANGELOG.md
158
158
  - LICENSE
159
159
  - Manifest.txt
160
160
  - README.md