hoe 3.24.0 → 3.25.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: 8cb122a688a65479576dd094bf310d32eac67a003a402e4eedd20575a3ab125f
4
- data.tar.gz: a505faf19cab47471c35529a04c57a5e5f490190783691eb060f1a699b6a56bc
3
+ metadata.gz: 55420e46afc4913200cd7bcb4ec75e026722a4b66471c95b3ba7e9d111782697
4
+ data.tar.gz: 0ef8f2b3e9703c82a3e7fa84df62a18f28b8a10131afcd7a98064c3bcd98d349
5
5
  SHA512:
6
- metadata.gz: 5b78311752ceff6ce02081439d4c460bce0b70fb2e0f6c3754857e924aab4de790de17cffc960bdec2827b079acc9e63dac2941403324fd850db72c048503c96
7
- data.tar.gz: 495338f933baf41253f578acc106fb4a10237ae07bca733ddd110f7b15b5fdbdc23997a35ff4263b661c774aaa298b17eb2d48e55ff2bff05ecdc6271de12aa0
6
+ metadata.gz: a2a1f33e796aa3a0c2f442275d4da908558d7829bedf5e72fd329b2453b1a9621287ec6605099b207ac1bca8db2c089dbeba921c1976a4e147709bf59923a147
7
+ data.tar.gz: 8a58eccbbb9270167a0edcd007cf0ca1278d2b1f5abae7e2c8d2846c1d4d63456976d69541806f63aa5f894f15c1e2f19506d8f8baf9aa29c43c74b9db9046d0
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,13 @@
1
+ === 3.25.0 / 2022-08-18
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added otp_command config option for OTP auth on gem push.
6
+
7
+ * 1 bug fix:
8
+
9
+ * Use sh instead of system during gem install to raise on error.
10
+
1
11
  === 3.24.0 / 2022-06-20
2
12
 
3
13
  * 3 minor enhancements:
data/lib/hoe/gemcutter.rb CHANGED
@@ -1,8 +1,29 @@
1
1
  require "rake"
2
2
 
3
+ ##
4
+ # Gemcutter plugin for hoe.
5
+ #
6
+ # === Extra Configuration Options:
7
+ #
8
+ # otp_command:: Shell command to run to populate GEM_HOST_OTP_CODE.
9
+
3
10
  module Hoe::Gemcutter
4
11
  include Rake::DSL if defined?(Rake::DSL)
5
12
 
13
+ Hoe::DEFAULT_CONFIG["otp_command"] = false
14
+
15
+ def gem_push gems
16
+ with_config do |config, _|
17
+ otp_command = config["otp_command"]
18
+
19
+ ENV["GEM_HOST_OTP_CODE"] = `#{otp_command}`.chomp if otp_command
20
+ end
21
+
22
+ gems.each do |g|
23
+ sh Gem.ruby, "-S", "gem", "push", g
24
+ end
25
+ end
26
+
6
27
  ##
7
28
  # Define release_to_gemcutter and attach it to the release task.
8
29
 
@@ -11,11 +32,8 @@ module Hoe::Gemcutter
11
32
  task :release_to_gemcutter => [:clean, :package, :release_sanity] do
12
33
  pkg = "pkg/#{spec.name}-#{spec.version}"
13
34
  gems = Dir["#{pkg}*.gem"]
14
- gems.each do |g|
15
- # TODO - once gemcutter supports command invocation, use it.
16
- # We could still fail here due to --format executable
17
- sh Gem.ruby, "-S", "gem", "push", g
18
- end
35
+
36
+ gem_push gems
19
37
  end
20
38
 
21
39
  task :release_to => :release_to_gemcutter
data/lib/hoe/package.rb CHANGED
@@ -100,8 +100,7 @@ module Hoe::Package
100
100
  cmd += " --no-document" unless rdoc
101
101
  cmd += " #{null_dev}" unless Rake.application.options.trace
102
102
 
103
- puts cmd if Rake.application.options.trace
104
- result = system cmd
103
+ result = sh cmd
105
104
  Gem::Specification.reset
106
105
  result
107
106
  end
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.24.0"
90
+ VERSION = "3.25.0"
91
91
 
92
92
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
93
93
  :publish, :gemcutter, :signing, :test]
data/test/test_hoe.rb CHANGED
@@ -465,14 +465,14 @@ class TestHoe < Minitest::Test
465
465
 
466
466
  def test_nosudo
467
467
  hoe = self.hoe do
468
- def system cmd
468
+ def sh cmd
469
469
  cmd
470
470
  end
471
471
  end
472
472
 
473
- assert_match(/^(sudo )?(j|maglev-)?gem.*/, hoe.install_gem("foo"))
473
+ assert_match(/^(sudo )?gem.*/, hoe.install_gem("foo"))
474
474
  ENV["NOSUDO"] = "1"
475
- assert_match(/^(j|maglev-)?gem.*/, hoe.install_gem("foo"))
475
+ assert_match(/^gem.*/, hoe.install_gem("foo"))
476
476
  ensure
477
477
  ENV.delete "NOSUDO"
478
478
  end
@@ -11,5 +11,28 @@ class TestHoeGemcutter < Minitest::Test
11
11
  assert Rake::Task[:release_to].prerequisites.include?("release_to_gemcutter")
12
12
  end
13
13
 
14
- # TODO add tests for push once using Gem::Commands::Push (waiting on rubygems release)
14
+ def sh *cmd_args
15
+ @cmd_args = cmd_args
16
+ end
17
+
18
+ def with_config
19
+ yield({ "otp_command" => "echo my_otp_code"}, "~/.hoerc")
20
+ end
21
+
22
+ def save_env
23
+ orig_env = ENV.to_h
24
+ yield
25
+ ensure
26
+ ENV.replace orig_env
27
+ end
28
+
29
+ def test_gem_push
30
+ save_env do
31
+ gem_push %w[pkg/blah-123.gem]
32
+
33
+ exp = %W[#{Gem.ruby} -S gem push pkg/blah-123.gem]
34
+ assert_equal exp, @cmd_args
35
+ assert_equal "my_otp_code", ENV["GEM_HOST_OTP_CODE"]
36
+ end
37
+ end
15
38
  end
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.24.0
4
+ version: 3.25.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-06-20 00:00:00.000000000 Z
32
+ date: 2022-08-18 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake
@@ -51,6 +51,20 @@ dependencies:
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
53
  version: '15.0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: minitest
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '5.16'
61
+ type: :development
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '5.16'
54
68
  - !ruby/object:Gem::Dependency
55
69
  name: rdoc
56
70
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file