hoe 3.24.0 → 3.26.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: 8cb122a688a65479576dd094bf310d32eac67a003a402e4eedd20575a3ab125f
4
- data.tar.gz: a505faf19cab47471c35529a04c57a5e5f490190783691eb060f1a699b6a56bc
3
+ metadata.gz: b3cc28399dd8b7e10dc915b12bc3a9aba7baf0948753f52ad292cbfecf24929a
4
+ data.tar.gz: 5fb0f5df02f4597b4229f685707a4e27a977c6df70be287a24698e381ac71095
5
5
  SHA512:
6
- metadata.gz: 5b78311752ceff6ce02081439d4c460bce0b70fb2e0f6c3754857e924aab4de790de17cffc960bdec2827b079acc9e63dac2941403324fd850db72c048503c96
7
- data.tar.gz: 495338f933baf41253f578acc106fb4a10237ae07bca733ddd110f7b15b5fdbdc23997a35ff4263b661c774aaa298b17eb2d48e55ff2bff05ecdc6271de12aa0
6
+ metadata.gz: 9c8fa5004607a777baff624078e9fcac387afa84c356b872970a684241314249bc6751b979662abbabe6e36301c389605544c9d7637253d81c981d21ef1a3ab2
7
+ data.tar.gz: 74db46687d2d171cae8a7d469f26167e878e403d27c85631b23828b6842fbe053357e965158c4deef4b78b8b5ae07f96cfba9dacffd47ff5308cd9580b5a483f
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,24 @@
1
+ === 3.26.0 / 2022-10-20
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Added warning to bundled minitest/test_task.
6
+ * Removed dead rcov plugin and added (simple)cov plugin.
7
+
8
+ * 1 bug fix:
9
+
10
+ * Fixed test task load path issue, prepend Hoe.include_dirs to ensure they come first.
11
+
12
+ === 3.25.0 / 2022-08-18
13
+
14
+ * 1 minor enhancement:
15
+
16
+ * Added otp_command config option for OTP auth on gem push.
17
+
18
+ * 1 bug fix:
19
+
20
+ * Use sh instead of system during gem install to raise on error.
21
+
1
22
  === 3.24.0 / 2022-06-20
2
23
 
3
24
  * 3 minor enhancements:
data/Manifest.txt CHANGED
@@ -8,6 +8,7 @@ bin/sow
8
8
  lib/hoe.rb
9
9
  lib/hoe/clean.rb
10
10
  lib/hoe/compiler.rb
11
+ lib/hoe/cov.rb
11
12
  lib/hoe/debug.rb
12
13
  lib/hoe/deps.rb
13
14
  lib/hoe/flay.rb
@@ -20,7 +21,6 @@ lib/hoe/package.rb
20
21
  lib/hoe/publish.rb
21
22
  lib/hoe/racc.rb
22
23
  lib/hoe/rake.rb
23
- lib/hoe/rcov.rb
24
24
  lib/hoe/rdoc.rb
25
25
  lib/hoe/signing.rb
26
26
  lib/hoe/test.rb
data/Rakefile CHANGED
@@ -6,6 +6,7 @@ require "./lib/hoe.rb"
6
6
  Hoe.plugin :seattlerb
7
7
  Hoe.plugin :isolate
8
8
  Hoe.plugin :rdoc
9
+ Hoe.plugin :cov
9
10
 
10
11
  Hoe.spec "hoe" do
11
12
  developer "Ryan Davis", "ryand-ruby@zenspider.com"
data/lib/hoe/clean.rb CHANGED
@@ -16,7 +16,7 @@ module Hoe::Clean
16
16
 
17
17
  def initialize_clean
18
18
  self.clean_globs ||= %w[diff diff.txt TAGS ri deps .source_index
19
- *.gem **/*~ **/.*~ **/*.rbc coverage*]
19
+ *.gem **/*~ **/.*~ **/*.rbc]
20
20
  end
21
21
 
22
22
  ##
data/lib/hoe/cov.rb ADDED
@@ -0,0 +1,34 @@
1
+ ##
2
+ # Coverage plugin for hoe. Uses simplecov.
3
+ #
4
+ # === Tasks Provided:
5
+ #
6
+ # cov:: Analyze code coverage with tests using simplecov.
7
+
8
+ module Hoe::Cov
9
+
10
+ ##
11
+ # Activate the cov dependencies.
12
+
13
+ def activate_cov_deps
14
+ dependency "simplecov", "~> 0.21", :development
15
+ end
16
+
17
+ ##
18
+ # Define tasks for plugin.
19
+
20
+ def define_cov_tasks
21
+ task :isolate # ensure it exists
22
+
23
+ self.clean_globs << "coverage"
24
+
25
+ desc "Run tests and analyze code coverage"
26
+ task :cov => :isolate do
27
+ test_task.test_prelude = "require \"simplecov\"; SimpleCov.start"
28
+
29
+ Rake::Task[:test].invoke
30
+ end
31
+ rescue LoadError
32
+ warn "simplecov not found"
33
+ end
34
+ end
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/test.rb CHANGED
@@ -56,6 +56,11 @@ module Hoe::Test
56
56
 
57
57
  attr_accessor :rspec_options
58
58
 
59
+ ##
60
+ # The test task created for this plugin.
61
+
62
+ attr_accessor :test_task
63
+
59
64
  ##
60
65
  # Initialize variables for plugin.
61
66
 
@@ -81,9 +86,9 @@ module Hoe::Test
81
86
  require "minitest/test_task" # currently in hoe, but will move
82
87
 
83
88
  test_prelude = self.test_prelude
84
- Minitest::TestTask.create :test do |t|
89
+ self.test_task = Minitest::TestTask.create :test do |t|
85
90
  t.test_prelude = test_prelude
86
- t.libs += Hoe.include_dirs.uniq
91
+ t.libs.prepend Hoe.include_dirs.uniq
87
92
  end
88
93
  when :testunit then
89
94
  desc "Run the test suite. Use FILTER or TESTOPTS to add flags/args."
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.26.0"
91
91
 
92
92
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
93
93
  :publish, :gemcutter, :signing, :test]
@@ -2,6 +2,15 @@ require "shellwords"
2
2
  require "rbconfig"
3
3
  require "rake/tasklib"
4
4
 
5
+ warn <<~EOM
6
+ minitest/test_task.rb is now packaged with minitest. If you see
7
+ this, you are getting it from hoe instead. If you're NOT able to
8
+ upgrade minitest to pick this up, please drop an issue on
9
+ seattlerb/hoe and let me know.
10
+
11
+ Required from #{caller[2]}
12
+ EOM
13
+
5
14
  module Minitest # :nodoc:
6
15
 
7
16
  ##
data/test/test_hoe.rb CHANGED
@@ -265,7 +265,7 @@ class TestHoe < Minitest::Test
265
265
  h = nil
266
266
  nokogiri_readme = <<~EOM
267
267
  ## Links
268
-
268
+
269
269
  * https://nokogiri.org
270
270
  * [Installation Help](https://nokogiri.org/tutorials/installing_nokogiri.html)
271
271
  * [Tutorials](https://nokogiri.org/tutorials/toc.html)
@@ -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
@@ -1,8 +1,7 @@
1
+ require "minitest/autorun"
1
2
  require "hoe"
2
- require File.expand_path "lib/hoe/debug.rb" # ugh. avoid dupe warnings
3
+ require_relative "../lib/hoe/debug"
3
4
  require "tmpdir"
4
- require "tempfile"
5
- require "minitest/autorun"
6
5
 
7
6
  class TestHoeDebug < Minitest::Test
8
7
 
@@ -1,6 +1,6 @@
1
- require "hoe"
2
- require "hoe/gemcutter" unless defined? Hoe::Gemcutter
3
1
  require "minitest/autorun"
2
+ require "hoe"
3
+ require_relative "../lib/hoe/gemcutter"
4
4
 
5
5
  class TestHoeGemcutter < Minitest::Test
6
6
  include Hoe::Gemcutter
@@ -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
@@ -1,5 +1,5 @@
1
- require "hoe"
2
1
  require "minitest/autorun"
2
+ require "hoe"
3
3
 
4
4
  Hoe.load_plugins
5
5
 
@@ -1,4 +1,3 @@
1
- require "rubygems"
2
1
  require "minitest/autorun"
3
2
  require "hoe"
4
3
 
@@ -1,5 +1,6 @@
1
1
  require "minitest/autorun"
2
2
  require "hoe"
3
+ require "minitest/test_task" # currently in hoe, but will move
3
4
 
4
5
  Hoe.load_plugins # make sure Hoe::Test is loaded
5
6
 
@@ -60,11 +61,9 @@ class TestHoeTest < Minitest::Test
60
61
  def test_make_test_cmd_for_minitest
61
62
  skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
62
63
 
63
- require "minitest/test_task" # currently in hoe, but will move
64
-
65
64
  framework = %(require "minitest/autorun"; )
66
65
 
67
- @tester = Minitest::TestTask.create :test do |t|
66
+ @tester = Minitest::TestTask.create :testtest do |t|
68
67
  t.libs += Hoe.include_dirs.uniq
69
68
  t.test_globs = ["test/test_hoe_test.rb"]
70
69
  end
@@ -75,8 +74,6 @@ class TestHoeTest < Minitest::Test
75
74
  def test_make_test_cmd_for_minitest_prelude
76
75
  skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"]
77
76
 
78
- require "minitest/test_task" # currently in hoe, but will move
79
-
80
77
  prelude = %(require "other/file")
81
78
  framework = %(require "minitest/autorun"; )
82
79
 
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.26.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-10-20 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake
@@ -71,6 +71,20 @@ dependencies:
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
73
  version: '7'
74
+ - !ruby/object:Gem::Dependency
75
+ name: simplecov
76
+ requirement: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '0.21'
81
+ type: :development
82
+ prerelease: false
83
+ version_requirements: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '0.21'
74
88
  description: |-
75
89
  Hoe is a rake/rubygems helper for project Rakefiles. It helps you
76
90
  manage, maintain, and release your project and includes a dynamic
@@ -102,6 +116,7 @@ files:
102
116
  - lib/hoe.rb
103
117
  - lib/hoe/clean.rb
104
118
  - lib/hoe/compiler.rb
119
+ - lib/hoe/cov.rb
105
120
  - lib/hoe/debug.rb
106
121
  - lib/hoe/deps.rb
107
122
  - lib/hoe/flay.rb
@@ -114,7 +129,6 @@ files:
114
129
  - lib/hoe/publish.rb
115
130
  - lib/hoe/racc.rb
116
131
  - lib/hoe/rake.rb
117
- - lib/hoe/rcov.rb
118
132
  - lib/hoe/rdoc.rb
119
133
  - lib/hoe/signing.rb
120
134
  - lib/hoe/test.rb
metadata.gz.sig CHANGED
Binary file
data/lib/hoe/rcov.rb DELETED
@@ -1,68 +0,0 @@
1
- ##
2
- # RCov plugin for hoe.
3
- #
4
- # === Tasks Provided:
5
- #
6
- # rcov:: Analyze code coverage with tests
7
-
8
- module Hoe::RCov
9
-
10
- ##
11
- # Activate the rcov dependencies.
12
-
13
- def activate_rcov_deps
14
- dependency "rcov", "~> 0.9", :development
15
- end
16
-
17
- ##
18
- # Define tasks for plugin.
19
-
20
- def define_rcov_tasks
21
- task :isolate # ensure it exists
22
-
23
- task :rcov => :isolate do
24
- sh(*make_rcov_cmd)
25
- end
26
-
27
- task :clobber_rcov do
28
- rm_rf "coverage"
29
- end
30
-
31
- task :clobber => :clobber_rcov
32
-
33
- # this is for my emacs rcov overlay stuff on emacswiki.
34
- task :rcov_overlay do
35
- path = ENV["FILE"]
36
- rcov, eol = Marshal.load(File.read("coverage.info")).last[path], 1
37
- puts rcov[:lines].zip(rcov[:coverage]).map { |line, coverage|
38
- bol, eol = eol, eol + line.length
39
- [bol, eol, "#ffcccc"] unless coverage
40
- }.compact.inspect
41
- end
42
- rescue LoadError
43
- # skip
44
- task :clobber_rcov # in case rcov didn't load
45
- # TODO: didn't load? this must be terribly historical
46
- end
47
-
48
- def make_rcov_cmd # :nodoc:
49
- rcov = Gem.bin_wrapper "rcov"
50
- tests = test_globs.sort.map { |g| Dir.glob(g) }.flatten.map(&:inspect)
51
-
52
- cmd = %W[#{rcov}
53
- #{Hoe::RUBY_FLAGS}
54
- --text-report
55
- --no-color
56
- --save coverage.info
57
- -x ^/
58
- -x tmp/isolate
59
- --sort coverage
60
- --sort-reverse
61
- -o coverage
62
- ] + tests
63
-
64
- cmd
65
- end
66
- end
67
-
68
- task :clean => :clobber_rcov