hoe 3.23.1 → 3.24.0

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: af9f27074a88867b02f53c746bd5d307c79c44b07fa493d1369676b16143710f
4
- data.tar.gz: ca66d5bf6295b18b08e16b2b028c58dd8cb9221b5ef311d2d8f5149d58194450
3
+ metadata.gz: 8cb122a688a65479576dd094bf310d32eac67a003a402e4eedd20575a3ab125f
4
+ data.tar.gz: a505faf19cab47471c35529a04c57a5e5f490190783691eb060f1a699b6a56bc
5
5
  SHA512:
6
- metadata.gz: 04525fdaa980c9844c37c63e309026914f5a32d7e8ec31b0e85476d26306b3da543c07c69488138cd5a11061bab37546c07d9733898306ce104a04bc1650ffc7
7
- data.tar.gz: 5b5952a69f70f270f86ddb86a69332f41bd8cc5bcf8861dcb56c568639524977e1b56748f7ab1d8d185db9f188b64b5eb75054c69c0f75b7e8a78e2cbc7bf666
6
+ metadata.gz: 5b78311752ceff6ce02081439d4c460bce0b70fb2e0f6c3754857e924aab4de790de17cffc960bdec2827b079acc9e63dac2941403324fd850db72c048503c96
7
+ data.tar.gz: 495338f933baf41253f578acc106fb4a10237ae07bca733ddd110f7b15b5fdbdc23997a35ff4263b661c774aaa298b17eb2d48e55ff2bff05ecdc6271de12aa0
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,11 @@
1
+ === 3.24.0 / 2022-06-20
2
+
3
+ * 3 minor enhancements:
4
+
5
+ * Add bindir and homepage accessor methods. (dsisnero)
6
+ * Don't auto-intuit values if they're already set. (dsisnero)
7
+ * Use bindir to determine executables. (dsisnero)
8
+
1
9
  === 3.23.1 / 2022-01-04
2
10
 
3
11
  * 1 bug fix:
data/lib/hoe.rb CHANGED
@@ -87,7 +87,7 @@ class Hoe
87
87
  include Rake::DSL if defined?(Rake::DSL)
88
88
 
89
89
  # duh
90
- VERSION = "3.23.1"
90
+ VERSION = "3.24.0"
91
91
 
92
92
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
93
93
  :publish, :gemcutter, :signing, :test]
@@ -222,6 +222,18 @@ class Hoe
222
222
 
223
223
  attr_accessor :group_name
224
224
 
225
+ ##
226
+ # Optional: The name of the executables directory. [default: bin]
227
+
228
+ attr_accessor :bindir
229
+
230
+ ##
231
+ # Optional: The homepage of the project. Auto-populates to the home key
232
+ # of the urls read from the README.txt
233
+ #
234
+
235
+ attr_accessor :homepage
236
+
225
237
  ##
226
238
  # The Gem::Specification.
227
239
 
@@ -525,17 +537,18 @@ class Hoe
525
537
  s.version = version if version
526
538
  s.summary = summary
527
539
  s.email = email
528
- s.homepage = urls["home"] || urls.values.first
540
+ s.homepage = homepage || urls["home"] || urls.values.first
541
+
529
542
  s.description = description
530
543
  s.files = manifest
531
- s.executables = s.files.grep(/^bin/) { |f| File.basename(f) }
532
- s.bindir = "bin"
544
+ s.bindir = bindir || "bin"
545
+ s.executables = s.files.grep(/^#{s.bindir}/) { |f| File.basename(f) }
533
546
  s.require_paths = dirs unless dirs.empty?
534
547
  s.rdoc_options = ["--main", readme_file]
535
548
  s.post_install_message = post_install_message
536
549
  s.metadata = (urls.keys & URLS_TO_META_MAP.keys).map { |name|
537
550
  [URLS_TO_META_MAP[name], urls[name]]
538
- }.to_h
551
+ }.to_h if urls
539
552
 
540
553
  missing "Manifest.txt" if s.files.empty?
541
554
 
@@ -810,7 +823,9 @@ class Hoe
810
823
 
811
824
  def post_initialize
812
825
  activate_plugin_deps
813
- intuit_values File.read_utf readme_file if readme_file
826
+ unless skip_intuit_values?
827
+ intuit_values File.read_utf readme_file if readme_file
828
+ end
814
829
  validate_fields
815
830
  define_spec
816
831
  load_plugin_tasks
@@ -896,6 +911,10 @@ class Hoe
896
911
  end
897
912
  end
898
913
 
914
+ def skip_intuit_values?
915
+ %w[summary description homepage].all? { |field| send field }
916
+ end
917
+
899
918
  ##
900
919
  # Loads ~/.hoerc, merges it with a .hoerc in the current pwd (if
901
920
  # any) and yields the configuration and its path
data/test/test_hoe.rb CHANGED
@@ -297,6 +297,30 @@ class TestHoe < Minitest::Test
297
297
  assert_equal exp, h.urls
298
298
  end
299
299
 
300
+ def test_intuit_values_should_be_silent_if_summary_description_and_homepage_are_set
301
+ h = nil
302
+ _readme = <<~EOM
303
+ == this is readme
304
+
305
+ == description
306
+ this is a bogus description
307
+ EOM
308
+
309
+ assert_silent do
310
+ h = Hoe.spec "blah" do
311
+ developer "auther", "email"
312
+ license "MIT"
313
+ self.homepage = 'http://myhome'
314
+ self.description = 'this is real description'
315
+ self.summary = 'this is summary'
316
+ end
317
+ end
318
+
319
+ assert_equal h.homepage , 'http://myhome'
320
+ assert_equal h.description , 'this is real description'
321
+ assert_equal h.summary , 'this is summary'
322
+ end
323
+
300
324
  def test_metadata
301
325
  hash = [
302
326
  "home :: https://github.com/seattlerb/hoe",
@@ -19,9 +19,16 @@ class TestHoePublish < Minitest::Test
19
19
  end
20
20
 
21
21
  def test_make_rdoc_cmd
22
+ rdoc = Gem.bin_wrapper "rdoc"
23
+
24
+ unless File.exist? rdoc then
25
+ extra = "-S"
26
+ rdoc = "rdoc"
27
+ end
28
+
22
29
  expected = %W[
23
30
  #{Gem.ruby}
24
- #{Gem.bin_wrapper "rdoc"}
31
+ #{rdoc}
25
32
  --title blah-1.0\ Documentation
26
33
  -o doc
27
34
  --main README.rdoc
@@ -29,7 +36,11 @@ class TestHoePublish < Minitest::Test
29
36
  History.rdoc Manifest.txt README.rdoc
30
37
  ]
31
38
 
32
- skip if linux?
33
- assert_equal expected, @hoe.make_rdoc_cmd
39
+ expected[1, 0] = extra if extra
40
+
41
+ # skip if linux?
42
+ capture_io do
43
+ assert_equal expected, @hoe.make_rdoc_cmd
44
+ end
34
45
  end
35
46
  end
@@ -26,11 +26,14 @@ class TestHoeTest < Minitest::Test
26
26
  end
27
27
  end
28
28
 
29
- EXPECTED = %W[-w -Ilib:bin:test:.
29
+ path = %w[lib bin test .].join File::PATH_SEPARATOR
30
+ mt_path = %w[lib test .].join File::PATH_SEPARATOR
31
+
32
+ EXPECTED = %W[-w -I#{path}
30
33
  -e 'require "rubygems"; %srequire "test/test_hoe_test.rb"'
31
34
  --].join(" ") + " "
32
35
 
33
- MT_EXPECTED = %W[-Ilib:test:. -w
36
+ MT_EXPECTED = %W[-I#{mt_path} -w
34
37
  -e '%srequire "test/test_hoe_test.rb"'
35
38
  --].join(" ") + " "
36
39
 
data.tar.gz.sig CHANGED
Binary file
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.23.1
4
+ version: 3.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  JFmxn4h9YO/pVdB962BdBNNDia0kgIjI3ENnkLq0dKpYU3+F3KhEuTksLO0L6X/V
30
30
  YsuyUzsMz6GQA4khyaMgKNSD
31
31
  -----END CERTIFICATE-----
32
- date: 2022-01-05 00:00:00.000000000 Z
32
+ date: 2022-06-20 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  - !ruby/object:Gem::Version
163
163
  version: '1.4'
164
164
  requirements: []
165
- rubygems_version: 3.3.3
165
+ rubygems_version: 3.3.12
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Hoe is a rake/rubygems helper for project Rakefiles
metadata.gz.sig CHANGED
Binary file