hoe 3.19.0 → 3.22.2

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: 60448a5d7c3bd1a47db43c58f5fc6df41be8d019f4cbd42ec0422f35adc9e65c
4
- data.tar.gz: c314ee93a2fb7ece4f45653b998992bb9290efdb9f48f801bf302598d27d339f
3
+ metadata.gz: 4967a1340b8eb2b55d288bee2557b2e578f2499db26fff69b94039024f58238b
4
+ data.tar.gz: e29e19572612d9faf06e1a4d05dfa23f0f22e5b8074756a3517a6231dce57eca
5
5
  SHA512:
6
- metadata.gz: 427f6587c04472d4f736c07c1a5350774ea7eacde7a391af49b7f279f06dd8927d40954655668a7bb15b6273f51c2fbd13fb8d8d90b8c20871ef9f5a42247fed
7
- data.tar.gz: 0a07b4c88ef15ec87eb7fe2c7be3c388aca7bf73f1e0292e6d69da7263a047b1bc30f6e468b1c3fd51225f4f7d41c578e92b8a8f1d86527351b92b332130fb33
6
+ metadata.gz: f478484bc6186cbebdfd4c739041254a66a235f5f6b49a1c4d6dc5ea82674a7587838ffe0c46400a38965134897e06e68245c4210619e203fcb4923897a3a6cc
7
+ data.tar.gz: bfa4732c2086479edaca5761f85924df6e3b377c9edaa37350273149a126f92151bef5508a46197489629f11ae2b058683a8a18e88cac88470db634ffc54eafe
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,51 @@
1
+ === 3.22.2 / 2020-08-31
2
+
3
+ * 1 bug fix:
4
+
5
+ * Bumped ruby version to include 3.0 (trunk).
6
+
7
+ === 3.22.1 / 2020-02-12
8
+
9
+ * 1 bug fix:
10
+
11
+ * Avoid calling parse_urls if URL metadata are already set. (flavorjones)
12
+
13
+ === 2.22.0 / 2020-02-09
14
+
15
+ * 4 minor enhancements:
16
+
17
+ * Added metadate mapping for 'docs'.
18
+ * Added rdoc extension to the history and readme file finder globs.
19
+ * Extended readme parsing to more intelligently deal with markup sections.
20
+ * Refactored intuit_values to take the file content as an arg.
21
+
22
+ * 2 bug fixes:
23
+
24
+ * Fixed ordering of test_prelude vs framework in Minitest::TestTask. (flavorjones)
25
+ * Fixed wiring of test_prelude into Minitest::TestTask.create. (flavorjones)
26
+
27
+ === 3.21.0 / 2020-01-11
28
+
29
+ * 2 minor enhancements:
30
+
31
+ * Added support for wiki_uri and mailing_list_uri. (JuanitoFatas)
32
+ * Load encrypted private key using ENV['GEM_PRIVATE_KEY_PASSPHRASE'] as passphrase. (larskanis)
33
+
34
+ * 5 bug fixes:
35
+
36
+ * Add require_ruby_version for 2.1+. (MSP-Greg)
37
+ * Fix a ruby 2.7 keyword arg deprecation. (anatol)
38
+ * Fix debug_gem task when you have a signing_key and broken rubygems (< 3.1.0).
39
+ * Fixed shadowed variable and json output for minitest's test:isolated task.
40
+ * Minor tweak to make hoe load when openssl isn't available.
41
+
42
+ === 3.20.0 / 2019-11-09
43
+
44
+ * 2 minor enhancements:
45
+
46
+ * Added <test>:isolated task that runs tests in parallel. Replaces <test>:dep task.
47
+ * Bumped rake dependency to be < 15.
48
+
1
49
  === 3.19.0 / 2019-10-29
2
50
 
3
51
  * 4 minor enhancements:
data/Rakefile CHANGED
@@ -18,8 +18,9 @@ Hoe.spec "hoe" do
18
18
 
19
19
  pluggable!
20
20
  require_rubygems_version ">= 1.4"
21
+ require_ruby_version [">= 2.1", "< 3.1"]
21
22
 
22
- dependency "rake", [">= 0.8", "< 13.0"] # FIX: to force it to exist pre-isolate
23
+ dependency "rake", [">= 0.8", "< 15.0"] # FIX: to force it to exist pre-isolate
23
24
  end
24
25
 
25
26
  task :plugins do
data/lib/hoe.rb CHANGED
@@ -1,7 +1,3 @@
1
- # -*- mode: ruby; coding: us-ascii; -*-
2
-
3
- require "rubygems"
4
-
5
1
  begin
6
2
  gem "rake"
7
3
  rescue Gem::LoadError
@@ -91,7 +87,7 @@ class Hoe
91
87
  include Rake::DSL if defined?(Rake::DSL)
92
88
 
93
89
  # duh
94
- VERSION = "3.19.0"
90
+ VERSION = "3.22.2"
95
91
 
96
92
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
97
93
  :publish, :gemcutter, :signing, :test]
@@ -119,8 +115,11 @@ class Hoe
119
115
  "bugs" => "bug_tracker_uri",
120
116
  "clog" => "changelog_uri",
121
117
  "doco" => "documentation_uri",
118
+ "docs" => "documentation_uri",
122
119
  "home" => "homepage_uri",
123
120
  "code" => "source_code_uri",
121
+ "wiki" => "wiki_uri",
122
+ "mail" => "mailing_list_uri",
124
123
  }
125
124
 
126
125
  ##
@@ -476,7 +475,7 @@ class Hoe
476
475
 
477
476
  case name
478
477
  when "hoe" then
479
- dependency "rake", [">= 0.8", "< 13.0"]
478
+ # do nothing? these deps are already in the hoe spec in the Rakefile
480
479
  else
481
480
  version = VERSION.split(/\./).first(2).join(".")
482
481
  dependency "hoe", "~> #{version}", :development
@@ -648,8 +647,8 @@ class Hoe
648
647
  self.history_file = manifest.grep(/^History\./).first
649
648
  end
650
649
 
651
- self.history_file ||= Dir.glob("History.{txt,md}").first || "History.txt"
652
- self.readme_file ||= Dir.glob("README.{txt,md}").first || "README.txt"
650
+ self.history_file ||= Dir.glob("History.{rdoc,txt,md}").first || "History.txt"
651
+ self.readme_file ||= Dir.glob("README.{rdoc,txt,md}").first || "README.txt"
653
652
 
654
653
  abort "Hoe.new {...} removed. Switch to Hoe.spec." if block_given?
655
654
  end
@@ -657,19 +656,24 @@ class Hoe
657
656
  ##
658
657
  # Intuit values from the readme and history files.
659
658
 
660
- def intuit_values
661
- header_re = /^((?:=+|#+) .*)$/
662
- readme = File.read_utf(readme_file).split(header_re)[1..-1] rescue ""
659
+ def intuit_values input
660
+ readme = input
661
+ .lines
662
+ .chunk { |l| l[/^(?:=+|#+)/] || "" }
663
+ .map(&:last)
664
+ .each_slice(2)
665
+ .map { |k, v|
666
+ kp = k.join
667
+ kp = kp.strip.chomp(":").split.last.downcase if k.size == 1
668
+ [kp, v.join.strip]
669
+ }
670
+ .to_h
663
671
 
664
672
  unless readme.empty? then
665
- sections = Hash[*readme.map { |s|
666
- s =~ /^[=#]/ ? s.strip.downcase.chomp(":").split.last : s.strip
667
- }]
668
- desc = sections.values_at(*description_sections).join("\n\n")
673
+ desc = readme.values_at(*description_sections).join("\n\n")
669
674
  summ = desc.split(/\.\s+/).first(summary_sentences).join(". ")
670
- urls = parse_urls(readme[1])
671
675
 
672
- self.urls ||= urls
676
+ self.urls ||= parse_urls(readme.values.first)
673
677
  self.description ||= desc
674
678
  self.summary ||= summ
675
679
  else
@@ -806,7 +810,7 @@ class Hoe
806
810
 
807
811
  def post_initialize
808
812
  activate_plugin_deps
809
- intuit_values
813
+ intuit_values File.read_utf readme_file if readme_file
810
814
  validate_fields
811
815
  define_spec
812
816
  load_plugin_tasks
@@ -91,8 +91,23 @@ module Hoe::Debug
91
91
  begin
92
92
  sh "#{DIFF} -du Manifest.txt #{f}", verbose
93
93
  ensure
94
- rm f, verbose
94
+ rm f, **verbose
95
95
  end
96
96
  end
97
97
  end
98
98
  end
99
+
100
+ class Gem::Specification < Gem::BasicSpecification
101
+ alias old_ruby_code ruby_code
102
+
103
+ def ruby_code(obj)
104
+ old_ruby_code obj
105
+ rescue Gem::Exception => e
106
+ case e.message
107
+ when /OpenSSL/
108
+ "nil"
109
+ else
110
+ raise
111
+ end
112
+ end
113
+ end unless Gem::VERSION >= "3.1.0"
@@ -145,7 +145,7 @@ module Hoe::Publish
145
145
 
146
146
  desc "Generate email announcement file."
147
147
  task :debug_email do
148
- puts generate_email
148
+ puts generate_email ENV["FULL"]
149
149
  end
150
150
 
151
151
  desc 'Post announcement to blog. Uses the "blogs" array in your hoerc.'
@@ -24,6 +24,9 @@
24
24
  #
25
25
  # Keep your private key secret! Keep your private key safe!
26
26
  #
27
+ # You can provide your private key passphrase via the
28
+ # GEM_PRIVATE_KEY_PASSPHRASE environment variable.
29
+ #
27
30
  # To make sure your gems are signed run:
28
31
  #
29
32
  # rake package; tar tf pkg/yourproject-1.2.3.gem
@@ -54,6 +57,8 @@ module Hoe::Signing
54
57
  task :check_key do
55
58
  check_key_task
56
59
  end
60
+ rescue NameError
61
+ warn "Couldn't set up signing (openssl error?). Skipping."
57
62
  end
58
63
 
59
64
  def set_up_signing # :nodoc:
@@ -70,7 +75,8 @@ module Hoe::Signing
70
75
  end
71
76
 
72
77
  if signing_key and cert_chain then
73
- spec.signing_key = OpenSSL::PKey::RSA.new File.read signing_key
78
+ passphrase = ENV['GEM_PRIVATE_KEY_PASSPHRASE']
79
+ spec.signing_key = OpenSSL::PKey::RSA.new(File.read(signing_key), passphrase)
74
80
  spec.cert_chain = cert_chain
75
81
  end
76
82
  end
@@ -80,8 +80,9 @@ module Hoe::Test
80
80
  when :minitest then
81
81
  require "minitest/test_task" # currently in hoe, but will move
82
82
 
83
+ test_prelude = self.test_prelude
83
84
  Minitest::TestTask.create :test do |t|
84
- t.test_prelude = self.test_prelude
85
+ t.test_prelude = test_prelude
85
86
  t.libs += Hoe.include_dirs.uniq
86
87
  end
87
88
  when :testunit then
@@ -19,20 +19,19 @@ module Minitest # :nodoc:
19
19
  #
20
20
  # The most basic and default setup.
21
21
  #
22
- # Minitest::TestTask.create :do_the_thing
22
+ # Minitest::TestTask.create :my_tests
23
23
  #
24
24
  # The most basic/default setup, but with a custom name
25
25
  #
26
- # Minitest::TestTask.create :spec do |t|
27
- # t.test_globs = ["spec/**/*_spec.rb"]
28
- # t.libs << "../dependency/lib"
26
+ # Minitest::TestTask.create :unit do |t|
27
+ # t.test_globs = ["test/unit/**/*_test.rb"]
28
+ # t.warning = false
29
29
  # end
30
30
  #
31
- # Customize the name, dependencies, and use a spec directory instead
32
- # of test.
31
+ # Customize the name and only run unit tests.
33
32
 
34
33
  class TestTask < Rake::TaskLib
35
- WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ # :nodoc: # TODO: verify
34
+ WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ # :nodoc:
36
35
 
37
36
  ##
38
37
  # Create several test-oriented tasks under +name+. Takes an
@@ -50,10 +49,11 @@ module Minitest # :nodoc:
50
49
  # Extra arguments to pass to the tests. Defaults empty but gets
51
50
  # populated by a number of enviroment variables:
52
51
  #
53
- # + N (-n flag) a string or regexp of tests to run.
54
- # + X (-e flag) a string or regexp of tests to exclude.
55
- # + TESTOPTS - extra stuff. For compatibility? I guess?
56
- # + A (arg) - quick way to inject an arbitrary argument (eg A=--help)
52
+ # N (-n flag) :: a string or regexp of tests to run.
53
+ # X (-e flag) :: a string or regexp of tests to exclude.
54
+ # A (arg) :: quick way to inject an arbitrary argument (eg A=--help).
55
+ #
56
+ # See #process_env
57
57
 
58
58
  attr_accessor :extra_args
59
59
 
@@ -94,11 +94,14 @@ module Minitest # :nodoc:
94
94
  attr_accessor :test_prelude
95
95
 
96
96
  ##
97
- # Print out commands as they run. Defaults to Rake's trace (-t
97
+ # Print out commands as they run. Defaults to Rake's +trace+ (-t
98
98
  # flag) option.
99
99
 
100
100
  attr_accessor :verbose
101
101
 
102
+ ##
103
+ # Use TestTask.create instead.
104
+
102
105
  def initialize name = :test # :nodoc:
103
106
  self.extra_args = []
104
107
  self.framework = %(require "minitest/autorun")
@@ -113,20 +116,20 @@ module Minitest # :nodoc:
113
116
 
114
117
  ##
115
118
  # Extract variables from the environment and convert them to
116
- # command line arguments. See +extra_args+.
119
+ # command line arguments. See #extra_args.
117
120
  #
118
121
  # Environment Variables:
119
122
  #
120
- # + MT_LIB_EXTRAS - Extra libs to dynamically override/inject for custom runs.
121
- # + N - Tests to run (string or /regexp/)
122
- # + X - Tests to exclude (string or /regexp/)
123
- # + A - Any extra arguments. Honors shell quoting.
123
+ # MT_LIB_EXTRAS :: Extra libs to dynamically override/inject for custom runs.
124
+ # N :: Tests to run (string or /regexp/).
125
+ # X :: Tests to exclude (string or /regexp/).
126
+ # A :: Any extra arguments. Honors shell quoting.
124
127
  #
125
128
  # Deprecated:
126
129
  #
127
- # + TESTOPTS - for argument passing, use A
128
- # + N - for parallel testing, use MT_CPU
129
- # + FILTER - same as TESTOPTS
130
+ # TESTOPTS :: For argument passing, use +A+.
131
+ # N :: For parallel testing, use +MT_CPU+.
132
+ # FILTER :: Same as +TESTOPTS+.
130
133
 
131
134
  def process_env
132
135
  warn "TESTOPTS is deprecated in Minitest::TestTask. Use A instead" if
@@ -153,10 +156,7 @@ module Minitest # :nodoc:
153
156
  extra_args.compact!
154
157
  end
155
158
 
156
- ##
157
- # Create the tasks.
158
-
159
- def define
159
+ def define # :nodoc:
160
160
  default_tasks = []
161
161
 
162
162
  desc "Run the test suite. Use N, X, A, and TESTOPTS to add flags/args."
@@ -169,24 +169,73 @@ module Minitest # :nodoc:
169
169
  puts "ruby #{make_test_cmd}"
170
170
  end
171
171
 
172
- desc "Show which test files fail when run alone."
173
- task "#{name}:deps" do
172
+ desc "Show which test files fail when run in isolation."
173
+ task "#{name}:isolated" do
174
174
  tests = Dir[*self.test_globs].uniq
175
175
 
176
- null_dev = WINDOWS ? "> NUL 2>&1" : "> /dev/null 2>&1"
176
+ # 3 seems to be the magic number... (tho not by that much)
177
+ bad, good, n = {}, [], (ENV.delete("K") || 3).to_i
178
+ file = ENV.delete("F")
179
+ times = {}
177
180
 
178
- tests.each do |test|
179
- cmd = make_test_cmd test
181
+ tt0 = Time.now
180
182
 
181
- if system "ruby #{cmd} #{null_dev}" then
182
- puts "# good: #{test}"
183
+ n.threads_do tests.sort do |path|
184
+ t0 = Time.now
185
+ output = `#{Gem.ruby} #{make_test_cmd path} 2>&1`
186
+ t1 = Time.now - t0
187
+
188
+ times[path] = t1
189
+
190
+ if $?.success?
191
+ $stderr.print "."
192
+ good << path
183
193
  else
184
- puts "# bad: #{test}"
185
- puts " ruby #{cmd}"
194
+ $stderr.print "x"
195
+ bad[path] = output
186
196
  end
187
197
  end
198
+
199
+ puts "done"
200
+ puts "Ran in %.2f seconds" % [ Time.now - tt0 ]
201
+
202
+ if file then
203
+ require "json"
204
+ File.open file, "w" do |io|
205
+ io.puts JSON.pretty_generate times
206
+ end
207
+ end
208
+
209
+ unless good.empty?
210
+ puts
211
+ puts "# Good tests:"
212
+ puts
213
+ good.sort.each do |path|
214
+ puts "%.2fs: %s" % [times[path], path]
215
+ end
216
+ end
217
+
218
+ unless bad.empty?
219
+ puts
220
+ puts "# Bad tests:"
221
+ puts
222
+ bad.keys.sort.each do |path|
223
+ puts "%.2fs: %s" % [times[path], path]
224
+ end
225
+ puts
226
+ puts "# Bad Test Output:"
227
+ puts
228
+ bad.sort.each do |path, output|
229
+ puts
230
+ puts "# #{path}:"
231
+ puts output
232
+ end
233
+ exit 1
234
+ end
188
235
  end
189
236
 
237
+ task "#{name}:deps" => "#{name}:isolated" # now just an alias
238
+
190
239
  desc "Show bottom 25 tests wrt time."
191
240
  task "#{name}:slow" do
192
241
  sh ["rake #{name} TESTOPTS=-v",
@@ -210,8 +259,8 @@ module Minitest # :nodoc:
210
259
  tests.map! { |f| %(require "#{f}") }
211
260
 
212
261
  runner = []
213
- runner << framework
214
262
  runner << test_prelude if test_prelude
263
+ runner << framework
215
264
  runner.concat tests
216
265
  runner = runner.join "; "
217
266
 
@@ -227,3 +276,30 @@ module Minitest # :nodoc:
227
276
  end
228
277
  end
229
278
  end
279
+
280
+ class Work < Queue
281
+ def initialize jobs = []
282
+ super()
283
+
284
+ jobs.each do |job|
285
+ self << job
286
+ end
287
+
288
+ close
289
+ end
290
+ end
291
+
292
+ class Integer
293
+ def threads_do(jobs) # :nodoc:
294
+ require "thread"
295
+ q = Work.new jobs
296
+
297
+ self.times.map {
298
+ Thread.new do
299
+ while job = q.pop # go until quit value
300
+ yield job
301
+ end
302
+ end
303
+ }.each(&:join)
304
+ end
305
+ end
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  require "minitest/autorun"
2
3
  require "hoe"
3
4
  require "tempfile"
@@ -217,6 +218,109 @@ class TestHoe < Minitest::Test
217
218
  assert_equal exp, hoe.parse_urls(hash)
218
219
  end
219
220
 
221
+ def test_parse_mrww
222
+ h = nil
223
+ mrww_readme = <<~EOM
224
+ = make
225
+ = rake
226
+ = work
227
+ = well
228
+
229
+ home :: https://github.com/seattlerb/makerakeworkwell
230
+ rdoc :: http://docs.seattlerb.org/makerakeworkwell
231
+
232
+ == DESCRIPTION:
233
+
234
+ make/rake/work/well provides two simple modifications to rake that
235
+ make working with file tasks cleaner, easier, and faster.
236
+ EOM
237
+
238
+
239
+
240
+ assert_silent do
241
+ h = Hoe.spec "blah" do
242
+ developer "author", "email"
243
+ license "MIT"
244
+ self.version = "1.0"
245
+ self.readme_file = nil
246
+ self.history_file = nil
247
+ self.changes = true
248
+
249
+ self.intuit_values mrww_readme
250
+ end
251
+ end
252
+
253
+ desc = mrww_readme.lines[10..11].join.chomp
254
+ urls = {
255
+ "home" => "https://github.com/seattlerb/makerakeworkwell",
256
+ "rdoc" => "http://docs.seattlerb.org/makerakeworkwell"
257
+ }
258
+
259
+ assert_equal desc, h.description
260
+ assert_equal desc, h.summary
261
+ assert_equal urls, h.urls
262
+ end
263
+
264
+ def test_intuit_values_should_be_silent_if_urls_are_already_set
265
+ h = nil
266
+ nokogiri_readme = <<~EOM
267
+ ## Links
268
+
269
+ * https://nokogiri.org
270
+ * [Installation Help](https://nokogiri.org/tutorials/installing_nokogiri.html)
271
+ * [Tutorials](https://nokogiri.org/tutorials/toc.html)
272
+ * [Cheat Sheet](https://github.com/sparklemotion/nokogiri/wiki/Cheat-sheet)
273
+ * [GitHub](https://github.com/sparklemotion/nokogiri)
274
+ * [Mailing List](https://groups.google.com/group/nokogiri-talk)
275
+ * [Chat/Gitter](https://gitter.im/sparklemotion/nokogiri)
276
+
277
+ EOM
278
+
279
+ exp = {
280
+ "home" => "https://nokogiri.org",
281
+ "bugs" => "https://github.com/sparklemotion/nokogiri/issues",
282
+ "doco" => "https://nokogiri.org/rdoc/index.html",
283
+ "clog" => "https://nokogiri.org/CHANGELOG.html",
284
+ "code" => "https://github.com/sparklemotion/nokogiri",
285
+ }
286
+
287
+ assert_silent do
288
+ h = Hoe.spec "blah" do
289
+ developer "author", "email"
290
+ license "MIT"
291
+
292
+ self.urls = exp
293
+ self.intuit_values nokogiri_readme
294
+ end
295
+ end
296
+
297
+ assert_equal exp, h.urls
298
+ end
299
+
300
+ def test_metadata
301
+ hash = [
302
+ "home :: https://github.com/seattlerb/hoe",
303
+ "doco :: http://docs.seattlerb.org/hoe/Hoe.pdf",
304
+ "clog :: https://github.com/seattlerb/hoe/master/History.rdoc",
305
+ "bugs :: https://github.com/seattlerb/hoe/issues",
306
+ "code :: https://github.com/seattlerb/hoe",
307
+ "wiki :: https://github.com/seattlerb/hoe/wiki",
308
+ "mail :: https://github.com/seattlerb/hoe/wiki#mailing_list",
309
+ ].join "\n"
310
+
311
+ exp = {
312
+ "home" => "https://github.com/seattlerb/hoe",
313
+ "doco" => "http://docs.seattlerb.org/hoe/Hoe.pdf",
314
+ "clog" => "https://github.com/seattlerb/hoe/master/History.rdoc",
315
+ "bugs" => "https://github.com/seattlerb/hoe/issues",
316
+ "code" => "https://github.com/seattlerb/hoe",
317
+ "wiki" => "https://github.com/seattlerb/hoe/wiki",
318
+ "mail" => "https://github.com/seattlerb/hoe/wiki#mailing_list",
319
+ }
320
+
321
+ assert_equal exp, hoe.parse_urls(hash)
322
+ end
323
+
220
324
  def test_possibly_better
221
325
  t = Gem::Specification::TODAY
222
326
 
@@ -256,7 +360,7 @@ class TestHoe < Minitest::Test
256
360
  assert_equal urls["home"], spec.homepage
257
361
  assert_equal ["--main", "README.rdoc"], spec.rdoc_options
258
362
  assert_equal ["lib"], spec.require_paths
259
- assert_equal Gem::RubyGemsVersion, spec.rubygems_version
363
+ assert_equal Gem::VERSION, spec.rubygems_version
260
364
  assert_match(/^Hoe.*Rakefiles$/, spec.summary)
261
365
 
262
366
  deps = spec.dependencies.sort_by(&:name)
@@ -391,6 +495,8 @@ class TestHoe < Minitest::Test
391
495
  end
392
496
 
393
497
  def test_with_config_overrides
498
+ require "hoe/debug" # modifies Hoe::DEFAULT_CONFIG["exclude"]
499
+
394
500
  overrides = {
395
501
  "exclude" => Regexp.union( Hoe::DEFAULT_CONFIG["exclude"], /\.hg/ ),
396
502
  "plugins" => %w[tweedledee tweedledum],
@@ -1,4 +1,5 @@
1
1
  require "hoe"
2
+ require "minitest/autorun"
2
3
 
3
4
  Hoe.load_plugins
4
5
 
@@ -14,6 +14,10 @@ class TestHoePublish < Minitest::Test
14
14
 
15
15
  make_my_diffs_pretty!
16
16
 
17
+ def linux? platform = RUBY_PLATFORM # TODO: push up to minitest?
18
+ /linux/ =~ platform
19
+ end
20
+
17
21
  def test_make_rdoc_cmd
18
22
  expected = %W[
19
23
  #{Gem.ruby}
@@ -25,6 +29,7 @@ class TestHoePublish < Minitest::Test
25
29
  History.rdoc Manifest.txt README.rdoc
26
30
  ]
27
31
 
32
+ skip if linux?
28
33
  assert_equal expected, @hoe.make_rdoc_cmd
29
34
  end
30
35
  end
@@ -26,36 +26,77 @@ class TestHoeTest < Minitest::Test
26
26
  end
27
27
  end
28
28
 
29
- def test_make_test_cmd_with_different_testlibs
30
- skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
29
+ EXPECTED = %W[-w -Ilib:bin:test:.
30
+ -e 'require "rubygems"; %srequire "test/test_hoe_test.rb"'
31
+ --].join(" ") + " "
32
+
33
+ MT_EXPECTED = %W[-Ilib:test:. -w
34
+ -e '%srequire "test/test_hoe_test.rb"'
35
+ --].join(" ") + " "
31
36
 
32
- expected = ['-w -Ilib:bin:test:. -e \'require "rubygems"; %s',
33
- 'require "test/test_hoe_test.rb"',
34
- "' -- ",
35
- ].join
37
+ def test_make_test_cmd_defaults_to_minitest
38
+ skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
36
39
 
37
40
  # default
38
41
  assert_deprecated do
39
42
  autorun = %(require "minitest/autorun"; )
40
- assert_equal expected % autorun, @tester.make_test_cmd
43
+ assert_equal EXPECTED % autorun, @tester.make_test_cmd
41
44
  end
45
+ end
46
+
47
+ def test_make_test_cmd_for_testunit
48
+ skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
42
49
 
43
50
  assert_deprecated do
44
51
  @tester.testlib = :testunit
45
52
  testunit = %(require "test/unit"; )
46
- assert_equal expected % testunit, @tester.make_test_cmd
53
+ assert_equal EXPECTED % testunit, @tester.make_test_cmd
47
54
  end
55
+ end
48
56
 
49
- assert_deprecated do
50
- @tester.testlib = :minitest
51
- autorun = %(require "minitest/autorun"; )
52
- assert_equal expected % autorun, @tester.make_test_cmd
57
+ def test_make_test_cmd_for_minitest
58
+ skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
59
+
60
+ require "minitest/test_task" # currently in hoe, but will move
61
+
62
+ framework = %(require "minitest/autorun"; )
63
+
64
+ @tester = Minitest::TestTask.create :test do |t|
65
+ t.libs += Hoe.include_dirs.uniq
66
+ t.test_globs = ["test/test_hoe_test.rb"]
67
+ end
68
+
69
+ assert_equal MT_EXPECTED % [framework].join("; "), @tester.make_test_cmd
70
+ end
71
+
72
+ def test_make_test_cmd_for_minitest_prelude
73
+ skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
74
+
75
+ require "minitest/test_task" # currently in hoe, but will move
76
+
77
+ prelude = %(require "other/file")
78
+ framework = %(require "minitest/autorun"; )
79
+
80
+ @tester = Minitest::TestTask.create :test do |t|
81
+ t.test_prelude = prelude
82
+ t.libs += Hoe.include_dirs.uniq
83
+ t.test_globs = ["test/test_hoe_test.rb"]
53
84
  end
54
85
 
86
+ assert_equal MT_EXPECTED % [prelude, framework].join("; "), @tester.make_test_cmd
87
+ end
88
+
89
+ def test_make_test_cmd_for_no_framework
90
+ skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
91
+
55
92
  assert_deprecated do
56
93
  @tester.testlib = :none
57
- assert_equal expected % "", @tester.make_test_cmd
94
+ assert_equal EXPECTED % "", @tester.make_test_cmd
58
95
  end
96
+ end
97
+
98
+ def test_make_test_cmd_for_faketestlib
99
+ skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
59
100
 
60
101
  @tester.testlib = :faketestlib
61
102
  e = assert_raises(RuntimeError) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.19.0
4
+ version: 3.22.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDPjCCAiagAwIBAgIBAzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBBDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
14
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTE4MTIwNDIxMzAxNFoXDTE5MTIwNDIxMzAxNFowRTETMBEGA1UE
15
+ GRYDY29tMB4XDTE5MTIxMzAwMDIwNFoXDTIwMTIxMjAwMDIwNFowRTETMBEGA1UE
16
16
  AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
17
17
  JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
18
18
  b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
@@ -22,14 +22,14 @@ cert_chain:
22
22
  qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
23
23
  gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
24
24
  HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
25
- AQCbJwLmpJR2PomLU+Zzw3KRzH/hbyUWc/ftru71AopZ1fy4iY9J/BW5QYKVYwbP
26
- V0FSBWtvfI/RdwfKGtuGhPKECZgmLieGuZ3XCc09qPu1bdg7i/tu1p0t0c6163ku
27
- nDMDIC/t/DAFK0TY9I3HswuyZGbLW7rgF0DmiuZdN/RPhHq2pOLMLXJmFclCb/im
28
- 9yToml/06TJdUJ5p64mkBs0TzaK66DIB1Smd3PdtfZqoRV+EwaXMdx0Hb3zdR1JR
29
- Em82dBUFsipwMLCYj39kcyHWAxyl6Ae1Cn9r/ItVBCxoeFdrHjfavnrIEoXUt4bU
30
- UfBugfLD19bu3nvL+zTAGx/U
25
+ AQCkkcHqAa6IKLYGl93rn78J3L+LnqyxaA059n4IGMHWN5bv9KBQnIjOrpLadtYZ
26
+ vhWkunWDKdfVapBEq5+T4HzqnsEXC3aCv6JEKJY6Zw7iSzl0M8hozuzRr+w46wvT
27
+ fV2yTN6QTVxqbMsJJyjosks4ZdQYov2zdvQpt1HsLi+Qmckmg8SPZsd+T8uiiBCf
28
+ b+1ORSM5eEfBQenPXy83LZcoQz8i6zVB4aAfTGGdhxjoMGUEmSZ6xpkOzmnGa9QK
29
+ m5x9IDiApM+vCELNwDXXGNFEnQBBK+wAe4Pek8o1V1TTOxL1kGPewVOitX1p3xoN
30
+ h7iEjga8iM1LbZUfiISZ+WrB
31
31
  -----END CERTIFICATE-----
32
- date: 2019-10-30 00:00:00.000000000 Z
32
+ date: 2020-08-31 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: '0.8'
41
41
  - - "<"
42
42
  - !ruby/object:Gem::Version
43
- version: '13.0'
43
+ version: '15.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  version: '0.8'
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '13.0'
53
+ version: '15.0'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: rdoc
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -152,14 +152,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
152
  requirements:
153
153
  - - ">="
154
154
  - !ruby/object:Gem::Version
155
- version: '0'
155
+ version: '2.1'
156
+ - - "<"
157
+ - !ruby/object:Gem::Version
158
+ version: '3.1'
156
159
  required_rubygems_version: !ruby/object:Gem::Requirement
157
160
  requirements:
158
161
  - - ">="
159
162
  - !ruby/object:Gem::Version
160
163
  version: '1.4'
161
164
  requirements: []
162
- rubygems_version: 3.0.6
165
+ rubygems_version: 3.1.2
163
166
  signing_key:
164
167
  specification_version: 4
165
168
  summary: Hoe is a rake/rubygems helper for project Rakefiles
metadata.gz.sig CHANGED
Binary file