hoe 3.22.3 → 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: 50cf01f11def02a11b7afb9d045a0259dcff3f184177c6c87e2de0c47ca41781
4
- data.tar.gz: a5bc3b90a2eba8d4e1d1536138765121da2fe61fe582b5fcd26090e47cf4834b
3
+ metadata.gz: 8cb122a688a65479576dd094bf310d32eac67a003a402e4eedd20575a3ab125f
4
+ data.tar.gz: a505faf19cab47471c35529a04c57a5e5f490190783691eb060f1a699b6a56bc
5
5
  SHA512:
6
- metadata.gz: bcfd1970f18fdb52f5b234300dfe7383ebdce7b34dadf1cc3a9e6dd0579ca80a082b39b3bf774a9ffd81caefaf2818fc19e80fc39afeb26537c4fd13a8fbcd5a
7
- data.tar.gz: 63d7ec780e191cf662cee19f597a67443fc363ece9bbeaf74cccf72f757612cf28e5b305634be46e4f27db32a3dded8a2d2177a9133eccb77c37df8350a929c0
6
+ metadata.gz: 5b78311752ceff6ce02081439d4c460bce0b70fb2e0f6c3754857e924aab4de790de17cffc960bdec2827b079acc9e63dac2941403324fd850db72c048503c96
7
+ data.tar.gz: 495338f933baf41253f578acc106fb4a10237ae07bca733ddd110f7b15b5fdbdc23997a35ff4263b661c774aaa298b17eb2d48e55ff2bff05ecdc6271de12aa0
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,24 @@
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
+
9
+ === 3.23.1 / 2022-01-04
10
+
11
+ * 1 bug fix:
12
+
13
+ * Fixed loading config files for ruby 3.1's now default YAML.safe_load_file.
14
+
15
+ === 3.23.0 / 2021-05-29
16
+
17
+ * 2 minor enhancements:
18
+
19
+ * Bump racc (plugin) dependency.
20
+ * Removed ruby18! and ruby19! methods. ugh
21
+
1
22
  === 3.22.3 / 2021-01-10
2
23
 
3
24
  * 1 bug fix:
data/lib/hoe/racc.rb CHANGED
@@ -50,7 +50,7 @@ module Hoe::Racc
50
50
  # Activate the racc dependencies
51
51
 
52
52
  def activate_racc_deps
53
- dependency "racc", "~> 1.4.6", :development
53
+ dependency "racc", "~> 1.5", :development
54
54
  end
55
55
 
56
56
  ##
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.22.3"
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
@@ -840,20 +855,6 @@ class Hoe
840
855
  spec_extras[:required_ruby_version] = versions
841
856
  end
842
857
 
843
- ##
844
- # Declare that this gem requires ruby to be in the 1.8+ family.
845
-
846
- def ruby18!
847
- require_ruby_version "~> 1.8"
848
- end
849
-
850
- ##
851
- # Declare that this gem requires ruby to be in the 1.9 family.
852
-
853
- def ruby19!
854
- require_ruby_version "~> 1.9"
855
- end
856
-
857
858
  ##
858
859
  # Declare that this gem requires ruby to be in the 2.0+ family.
859
860
 
@@ -882,6 +883,9 @@ class Hoe
882
883
  require_ruby_version "~> 2.3"
883
884
  end
884
885
 
886
+ # I don't care for these methods (eg 3.0 is out) ... so I'm not
887
+ # continuing them.
888
+
885
889
  ##
886
890
  # Provide a linear degrading value from n to m over start to finis
887
891
  # dates. If not provided, start and finis will default to 1/1 and
@@ -907,6 +911,10 @@ class Hoe
907
911
  end
908
912
  end
909
913
 
914
+ def skip_intuit_values?
915
+ %w[summary description homepage].all? { |field| send field }
916
+ end
917
+
910
918
  ##
911
919
  # Loads ~/.hoerc, merges it with a .hoerc in the current pwd (if
912
920
  # any) and yields the configuration and its path
@@ -915,19 +923,29 @@ class Hoe
915
923
  config = Hoe::DEFAULT_CONFIG
916
924
 
917
925
  rc = File.expand_path("~/.hoerc")
918
- exists = File.exist? rc
919
- homeconfig = exists ? YAML.load_file(rc) : {}
926
+ homeconfig = maybe_load_yaml rc
920
927
 
921
928
  config = config.merge homeconfig
922
929
 
923
930
  localrc = File.join Dir.pwd, ".hoerc"
924
- exists = File.exist? localrc
925
- localconfig = exists ? YAML.load_file(localrc) : {}
931
+ localconfig = maybe_load_yaml(localrc)
926
932
 
927
933
  config = config.merge localconfig
928
934
 
929
935
  yield config, rc
930
936
  end
937
+
938
+ def maybe_load_yaml path
939
+ if File.exist? path then
940
+ if YAML.respond_to? :safe_load_file then
941
+ YAML.safe_load_file path, permitted_classes: [Regexp, Symbol]
942
+ else
943
+ YAML.load_file path
944
+ end
945
+ else
946
+ {}
947
+ end
948
+ end
931
949
  end
932
950
 
933
951
  class File
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.22.3
4
+ version: 3.24.0
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
- MIIDPjCCAiagAwIBAgIBBTANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBBjANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
14
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTIwMTIyMjIwMzgzMFoXDTIxMTIyMjIwMzgzMFowRTETMBEGA1UE
15
+ GRYDY29tMB4XDTIxMTIyMzIzMTkwNFoXDTIyMTIyMzIzMTk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JcN9hbCYoA5i/EeubUEtFIh2w3SpO6YfB
29
+ JFmxn4h9YO/pVdB962BdBNNDia0kgIjI3ENnkLq0dKpYU3+F3KhEuTksLO0L6X/V
30
+ YsuyUzsMz6GQA4khyaMgKNSD
31
31
  -----END CERTIFICATE-----
32
- date: 2021-01-11 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.1.4
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