Hello community, here is the log from the commit of package rubygem-hoe for openSUSE:Factory checked in at 2020-03-07 21:38:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-hoe (Old) and /work/SRC/openSUSE:Factory/.rubygem-hoe.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-hoe" Sat Mar 7 21:38:23 2020 rev:45 rq:773772 version:3.22.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-hoe/rubygem-hoe.changes 2019-08-06 15:09:45.219794939 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-hoe.new.26092/rubygem-hoe.changes 2020-03-07 21:38:26.164280151 +0100 @@ -1,0 +2,67 @@ +Mon Feb 10 14:51:34 UTC 2020 - Stephan Kulow + +- updated to version 3.22.0 + see installed History.rdoc + + === 2.22.0 / 2020-02-09 + + * 4 minor enhancements: + + * Added metadate mapping for 'docs'. + * Added rdoc extension to the history and readme file finder globs. + * Extended readme parsing to more intelligently deal with markup sections. + * Refactored intuit_values to take the file content as an arg. + + * 2 bug fixes: + + * Fixed ordering of test_prelude vs framework in Minitest::TestTask. (flavorjones) + * Fixed wiring of test_prelude into Minitest::TestTask.create. (flavorjones) + + === 3.21.0 / 2020-01-11 + + * 2 minor enhancements: + + * Added support for wiki_uri and mailing_list_uri. (JuanitoFatas) + * Load encrypted private key using ENV['GEM_PRIVATE_KEY_PASSPHRASE'] as passphrase. (larskanis) + + * 5 bug fixes: + + * Add require_ruby_version for 2.1+. (MSP-Greg) + * Fix a ruby 2.7 keyword arg deprecation. (anatol) + * Fix debug_gem task when you have a signing_key and broken rubygems (< 3.1.0). + * Fixed shadowed variable and json output for minitest's test:isolated task. + * Minor tweak to make hoe load when openssl isn't available. + + === 3.20.0 / 2019-11-09 + + * 2 minor enhancements: + + * Added :isolated task that runs tests in parallel. Replaces :dep task. + * Bumped rake dependency to be < 15. + + === 3.19.0 / 2019-10-29 + + * 4 minor enhancements: + + * Added deprecation to parse_urls for ancient url array form. + * Added support for gemspec metadata. (viraptor) + * Hoe#parse_urls now returns a hash no matter what + * Removed looong deprecated Hoe#url/url= methods. + + * 1 bug fix: + + * Fixed sow for ruby 2.6 deprecations in ERB. (felipec) + + === 3.18.1 / 2019-09-14 + + * 1 minor enhancement: + + * Added deprecations to minitest/test_task: TESTOPTS, N (for #threads), FILTER. + + * 3 bug fixes: + + * Fixed one use of Array.prepend on ruby 2.3-2.4. + * Removed FILTER/N/X handling from hoe/test.rb in favor of minitest/test_task.rb. + * Sort globs before shuffling to normalize different file systems. + +------------------------------------------------------------------- Old: ---- hoe-3.18.0.gem New: ---- hoe-3.22.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-hoe.spec ++++++ --- /var/tmp/diff_new_pack.s0414C/_old 2020-03-07 21:38:28.904282002 +0100 +++ /var/tmp/diff_new_pack.s0414C/_new 2020-03-07 21:38:28.904282002 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-hoe # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,17 +24,18 @@ # Name: rubygem-hoe -Version: 3.18.0 +Version: 3.22.0 Release: 0 %define mod_name hoe %define mod_full_name %{mod_name}-%{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: %{ruby < 3} +BuildRequires: %{ruby => 2.1} BuildRequires: %{rubygem gem2rpm} BuildRequires: %{rubygem rdoc > 3.10} -BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 BuildRequires: update-alternatives -Url: http://www.zenspider.com/projects/hoe.html +URL: http://www.zenspider.com/projects/hoe.html Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: Hoe is a rake/rubygems helper for project Rakefiles @@ -47,7 +48,7 @@ manage, maintain, and release your project and includes a dynamic plug-in system allowing for easy extensibility. Hoe ships with plug-ins for all your usual project tasks including rdoc generation, -testing, packaging, deployment, and announcement.. +testing, packaging, deployment, and announcement. See class rdoc for help. Hint: `ri Hoe` or any of the plugins listed below. For extra goodness, see: http://docs.seattlerb.org/hoe/Hoe.pdf. ++++++ hoe-3.18.0.gem -> hoe-3.22.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/History.rdoc new/History.rdoc --- old/History.rdoc 2019-05-27 00:21:19.000000000 +0200 +++ new/History.rdoc 2020-02-10 00:00:01.000000000 +0100 @@ -1,3 +1,64 @@ +=== 2.22.0 / 2020-02-09 + +* 4 minor enhancements: + + * Added metadate mapping for 'docs'. + * Added rdoc extension to the history and readme file finder globs. + * Extended readme parsing to more intelligently deal with markup sections. + * Refactored intuit_values to take the file content as an arg. + +* 2 bug fixes: + + * Fixed ordering of test_prelude vs framework in Minitest::TestTask. (flavorjones) + * Fixed wiring of test_prelude into Minitest::TestTask.create. (flavorjones) + +=== 3.21.0 / 2020-01-11 + +* 2 minor enhancements: + + * Added support for wiki_uri and mailing_list_uri. (JuanitoFatas) + * Load encrypted private key using ENV['GEM_PRIVATE_KEY_PASSPHRASE'] as passphrase. (larskanis) + +* 5 bug fixes: + + * Add require_ruby_version for 2.1+. (MSP-Greg) + * Fix a ruby 2.7 keyword arg deprecation. (anatol) + * Fix debug_gem task when you have a signing_key and broken rubygems (< 3.1.0). + * Fixed shadowed variable and json output for minitest's test:isolated task. + * Minor tweak to make hoe load when openssl isn't available. + +=== 3.20.0 / 2019-11-09 + +* 2 minor enhancements: + + * Added :isolated task that runs tests in parallel. Replaces :dep task. + * Bumped rake dependency to be < 15. + +=== 3.19.0 / 2019-10-29 + +* 4 minor enhancements: + + * Added deprecation to parse_urls for ancient url array form. + * Added support for gemspec metadata. (viraptor) + * Hoe#parse_urls now returns a hash no matter what + * Removed looong deprecated Hoe#url/url= methods. + +* 1 bug fix: + + * Fixed sow for ruby 2.6 deprecations in ERB. (felipec) + +=== 3.18.1 / 2019-09-14 + +* 1 minor enhancement: + + * Added deprecations to minitest/test_task: TESTOPTS, N (for #threads), FILTER. + +* 3 bug fixes: + + * Fixed one use of Array.prepend on ruby 2.3-2.4. + * Removed FILTER/N/X handling from hoe/test.rb in favor of minitest/test_task.rb. + * Sort globs before shuffling to normalize different file systems. + === 3.18.0 / 2019-05-25 * 1 major enhancement: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.rdoc new/README.rdoc --- old/README.rdoc 2019-05-27 00:21:19.000000000 +0200 +++ new/README.rdoc 2020-02-10 00:00:01.000000000 +0100 @@ -5,6 +5,7 @@ bugs :: https://github.com/seattlerb/hoe/issues rdoc :: http://docs.seattlerb.org/hoe/ doco :: http://docs.seattlerb.org/hoe/Hoe.pdf +clog :: https://github.com/seattlerb/hoe/blob/master/History.rdoc other :: http://github.com/jbarnette/hoe-plugin-examples == DESCRIPTION: @@ -13,7 +14,7 @@ manage, maintain, and release your project and includes a dynamic plug-in system allowing for easy extensibility. Hoe ships with plug-ins for all your usual project tasks including rdoc generation, -testing, packaging, deployment, and announcement.. +testing, packaging, deployment, and announcement. See class rdoc for help. Hint: `ri Hoe` or any of the plugins listed below. @@ -39,7 +40,7 @@ or: require 'hoe' - + Hoe.spec projectname do # ... project specific data ... end @@ -90,7 +91,7 @@ Every project should know what it is shipping. This is done via an explicit list of everything that goes out in a release. Hoe uses this during packaging so that nothing embarrassing is picked up. - + Imagine, you're a customs inspector at the Los Angeles Port, the world's largest import/export port. A large ship filled to the brim pulls up to the pier ready for inspection. You walk up to the captain @@ -122,9 +123,9 @@ packaging. === Releasing in 1 easy step - + % rake release VERSION=x.y.z - + That really is all there is to it. Behind the scenes it: * Branches the release in our perforce server. (via hoe-seattlerb plugin) @@ -133,7 +134,7 @@ * Uploads the packages to rubygems.org. * Posts news of the release my blog. * Sends an announcement email. (via the hoe-seattlerb plugin gem) - + That `VERSION=x.y.z` is there as a last-chance sanity check that you know what you're releasing. You'd be surprised how blurry eyed/brained you get at 3AM. This check helps a lot more than it should. @@ -205,7 +206,7 @@ === Writing Plugins: A plugin can be as simple as: - + module Hoe::Thingy attr_accessor :thingy @@ -219,7 +220,7 @@ end end end - + Not terribly useful, but you get the idea. This example exercises both plugin methods (initialize_#{plugin} and define_#{plugin}_tasks and adds an accessor method to the Hoe instance. @@ -244,13 +245,13 @@ because they're providing the same functionality that the previous Hoe was and without them, it'd be rather useless. Other plugins should be "opt-in" and are activated by: - + Hoe::plugin :thingy - + Put this _above_ your hoe-spec. All it does is add `:thingy` to `Hoe.plugins`. You could also deactivate a plugin by removing it from `Hoe.plugins` although that shouldn't be necessary for the most part. - + Please note that it is **not** a good idea to have a plugin you're writing activate itself. Let developers opt-in, not opt-out. Just because someone needs the `:thingy` plugin on one project doesn't mean they need them on _all_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2019-05-27 00:21:19.000000000 +0200 +++ new/Rakefile 2020-02-10 00:00:01.000000000 +0100 @@ -18,8 +18,9 @@ pluggable! require_rubygems_version ">= 1.4" + require_ruby_version "~> 2.1" - dependency "rake", [">= 0.8", "< 13.0"] # FIX: to force it to exist pre-isolate + dependency "rake", [">= 0.8", "< 15.0"] # FIX: to force it to exist pre-isolate end task :plugins do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bin/sow new/bin/sow --- old/bin/sow 2019-05-27 00:21:19.000000000 +0200 +++ new/bin/sow 2020-02-10 00:00:01.000000000 +0100 @@ -117,7 +117,11 @@ warn "erb: #{path}" File.open path, "w" do |io| - erb = ERB.new file, nil, "<>" + if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+ + erb = ERB.new file, trim_mode: "<>" + else + erb = ERB.new file, nil, "<>" + end erb.filename = path io.puts erb.result(binding) end Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ Binary files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/data.tar.gz.sig new/data.tar.gz.sig --- old/data.tar.gz.sig 2019-05-27 00:21:19.000000000 +0200 +++ new/data.tar.gz.sig 2020-02-10 00:00:01.000000000 +0100 @@ -1,3 +1,3 @@ -³*4yÐHò�D÷Áý€´@ ’od#�#T+ßQÆDF¿©¿{íã -j'Tù7¯Ó>ª#÷”®“…·°s™ãTCe »…׎qAikqúõ}нÿZ&Þ¼ñª¨HBæ×¹9B¾ÜBhøvøÿ%ÂBHŽo½| •¦K§]|ÁY£ï‡8®û‘’t·„Ž„�-kÊ‹Éç¥ŽÙæyþH�ضÞ×�±,‹p»/”-þk�Tñ&yП¶²�êXqçÈ -  ñÄ‚ŠVyYBÙåk�|„‘G0NsK‚Þ‹C¾ O°ÆõËý¬PÆ�²§ê¶± cÈæåø^� \ No newline at end of file +r,ÖÒ7†® v„#R{Ûé&.�ÅuÏEx×… +;Œ/s·jÊ<аs� íâÄ�œ(_rí9+SKH‚µN—ær +^t«§¤„s¶—™&bK +91ŒâZ”í=ì¤O,/å4„…þqy6aˆ½cc%W:¦±<ä—ÇÑfç@‘½lúy1nU/›§¿/$”…›sÊþüº¤Asx„J!‡ÇoyÈ93\­ÑrNã`ʼðÀ“®�»iß*/<�ƒAm° וâɤ7m-ê#æ€H2�L½×ØR»2ØJç§;�·—o$³T(:«·J�ðLuñÿ)O|„«§; \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hoe/debug.rb new/lib/hoe/debug.rb --- old/lib/hoe/debug.rb 2019-05-27 00:21:19.000000000 +0200 +++ new/lib/hoe/debug.rb 2020-02-10 00:00:01.000000000 +0100 @@ -91,8 +91,23 @@ begin sh "#{DIFF} -du Manifest.txt #{f}", verbose ensure - rm f, verbose + rm f, **verbose end end end end + +class Gem::Specification < Gem::BasicSpecification + alias old_ruby_code ruby_code + + def ruby_code(obj) + old_ruby_code obj + rescue Gem::Exception => e + case e.message + when /OpenSSL/ + "nil" + else + raise + end + end +end unless Gem::VERSION >= "3.1.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hoe/signing.rb new/lib/hoe/signing.rb --- old/lib/hoe/signing.rb 2019-05-27 00:21:19.000000000 +0200 +++ new/lib/hoe/signing.rb 2020-02-10 00:00:01.000000000 +0100 @@ -24,6 +24,9 @@ # # Keep your private key secret! Keep your private key safe! # +# You can provide your private key passphrase via the +# GEM_PRIVATE_KEY_PASSPHRASE environment variable. +# # To make sure your gems are signed run: # # rake package; tar tf pkg/yourproject-1.2.3.gem @@ -54,6 +57,8 @@ task :check_key do check_key_task end + rescue NameError + warn "Couldn't set up signing (openssl error?). Skipping." end def set_up_signing # :nodoc: @@ -70,7 +75,8 @@ end if signing_key and cert_chain then - spec.signing_key = OpenSSL::PKey::RSA.new File.read signing_key + passphrase = ENV['GEM_PRIVATE_KEY_PASSPHRASE'] + spec.signing_key = OpenSSL::PKey::RSA.new(File.read(signing_key), passphrase) spec.cert_chain = cert_chain end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hoe/test.rb new/lib/hoe/test.rb --- old/lib/hoe/test.rb 2019-05-27 00:21:19.000000000 +0200 +++ new/lib/hoe/test.rb 2020-02-10 00:00:01.000000000 +0100 @@ -25,20 +25,6 @@ :none => nil, } - ## - # Used to add flags to test_unit (e.g., -n test_borked). - # - # eg FILTER="-n test_blah" - - FILTER = (ENV["FILTER"] || ENV["TESTOPTS"] || "").dup - FILTER << " -n #{ENV["N"]}" if ENV["N"] - FILTER << " -e #{ENV["X"]}" if ENV["X"] - - # this is an unfortunate naming collision. I don't use the CPU (N) - # specifier so it is shifting to "C" inside of Hoe. - ENV.delete "N" if ENV["N"] - ENV["N"] = ENV["C"] if ENV["C"] - Hoe::DEFAULT_CONFIG["multiruby_skip"] = [] ## @@ -94,8 +80,9 @@ when :minitest then require "minitest/test_task" # currently in hoe, but will move + test_prelude = self.test_prelude Minitest::TestTask.create :test do |t| - t.test_prelude = self.test_prelude + t.test_prelude = test_prelude t.libs += Hoe.include_dirs.uniq end when :testunit then @@ -188,7 +175,11 @@ tests.insert 1, test_prelude if test_prelude - "#{Hoe::RUBY_FLAGS} -e '#{tests.join("; ")}' -- #{FILTER}" + filter = (ENV["FILTER"] || ENV["TESTOPTS"] || "").dup + filter << " -n #{ENV["N"]}" if ENV["N"] + filter << " -e #{ENV["X"]}" if ENV["X"] + + "#{Hoe::RUBY_FLAGS} -e '#{tests.join("; ")}' -- #{filter}" end ## diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hoe.rb new/lib/hoe.rb --- old/lib/hoe.rb 2019-05-27 00:21:19.000000000 +0200 +++ new/lib/hoe.rb 2020-02-10 00:00:01.000000000 +0100 @@ -1,7 +1,3 @@ -# -*- mode: ruby; coding: us-ascii; -*- - -require "rubygems" - begin gem "rake" rescue Gem::LoadError @@ -91,7 +87,7 @@ include Rake::DSL if defined?(Rake::DSL) # duh - VERSION = "3.18.0" + VERSION = "3.22.0" @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package, :publish, :gemcutter, :signing, :test] @@ -112,6 +108,21 @@ RUBY_FLAGS = ENV["RUBY_FLAGS"] || default_ruby_flags ## + # Map from the commonly used url names to gemspec's metadata keys + # See https://guides.rubygems.org/specification-reference/#metadata + + URLS_TO_META_MAP = { + "bugs" => "bug_tracker_uri", + "clog" => "changelog_uri", + "doco" => "documentation_uri", + "docs" => "documentation_uri", + "home" => "homepage_uri", + "code" => "source_code_uri", + "wiki" => "wiki_uri", + "mail" => "mailing_list_uri", + } + + ## # Default configuration values for .hoerc. Plugins should populate # this on load. @@ -244,24 +255,6 @@ attr_accessor :test_globs ## - # Deprecated: Optional: The url(s) of the project. (can be array). - # Auto-populates to a list of urls read from the beginning of - # README.txt. - # - - def url - warn "NOTE: Hoe#url is deprecated, use urls. It will be removed on or after 2012-06-01." - warn "Used from #{caller.first}" - @url - end - - def url=o # :nodoc: - warn "NOTE: Hoe#url= is deprecated, use urls=. It will be removed on or after 2012-06-01." - warn "Used from #{caller.first}" - @url=o - end - - ## # Optional: The urls of the project. This can be an array or # (preferably) a hash. Auto-populates to the urls read from the # beginning of README.txt. @@ -313,7 +306,7 @@ @loaded ||= {} @files ||= Gem.find_files "hoe/*.rb" - @files.reverse.each do |path| + @files.reverse.each do |path| # reverse so first one wins @found[File.basename(path, ".rb").intern] = path end @@ -532,14 +525,7 @@ s.version = version if version s.summary = summary s.email = email - s.homepage = case urls - when Hash then - urls["home"] || urls.values.first - when Array then - urls.first - else - warn "** Unknown urls format: #{urls.inspect}" - end + s.homepage = urls["home"] || urls.values.first s.description = description s.files = manifest s.executables = s.files.grep(/^bin/) { |f| File.basename(f) } @@ -547,6 +533,9 @@ s.require_paths = dirs unless dirs.empty? s.rdoc_options = ["--main", readme_file] s.post_install_message = post_install_message + s.metadata = (urls.keys & URLS_TO_META_MAP.keys).map { |name| + [URLS_TO_META_MAP[name], urls[name]] + }.to_h missing "Manifest.txt" if s.files.empty? @@ -658,8 +647,8 @@ self.history_file = manifest.grep(/^History\./).first end - self.history_file ||= Dir.glob("History.{txt,md}").first || "History.txt" - self.readme_file ||= Dir.glob("README.{txt,md}").first || "README.txt" + self.history_file ||= Dir.glob("History.{rdoc,txt,md}").first || "History.txt" + self.readme_file ||= Dir.glob("README.{rdoc,txt,md}").first || "README.txt" abort "Hoe.new {...} removed. Switch to Hoe.spec." if block_given? end @@ -667,17 +656,23 @@ ## # Intuit values from the readme and history files. - def intuit_values - header_re = /^((?:=+|#+) .*)$/ - readme = File.read_utf(readme_file).split(header_re)[1..-1] rescue "" + def intuit_values input + readme = input + .lines + .chunk { |l| l[/^(?:=+|#+)/] || "" } + .map(&:last) + .each_slice(2) + .map { |k, v| + kp = k.join + kp = kp.strip.chomp(":").split.last.downcase if k.size == 1 + [kp, v.join.strip] + } + .to_h unless readme.empty? then - sections = Hash[*readme.map { |s| - s =~ /^[=#]/ ? s.strip.downcase.chomp(":").split.last : s.strip - }] - desc = sections.values_at(*description_sections).join("\n\n") + desc = readme.values_at(*description_sections).join("\n\n") summ = desc.split(/\.\s+/).first(summary_sentences).join(". ") - urls = parse_urls(readme[1]) + urls = parse_urls(readme.values.first) self.urls ||= urls self.description ||= desc @@ -719,7 +714,10 @@ if lines.first =~ /::/ then Hash[lines.map { |line| line.split(/\s*::\s*/) }] else - lines + warn "DEPRECATED: Please switch readme to hash format for urls." + warn " Only defining 'home' url." + warn " This will be removed on or after 2020-10-28." + { "home" => lines.first } end end @@ -813,7 +811,7 @@ def post_initialize activate_plugin_deps - intuit_values + intuit_values File.read_utf readme_file if readme_file validate_fields define_spec load_plugin_tasks diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/minitest/test_task.rb new/lib/minitest/test_task.rb --- old/lib/minitest/test_task.rb 2019-05-27 00:21:19.000000000 +0200 +++ new/lib/minitest/test_task.rb 2020-02-10 00:00:01.000000000 +0100 @@ -19,20 +19,19 @@ # # The most basic and default setup. # - # Minitest::TestTask.create :do_the_thing + # Minitest::TestTask.create :my_tests # # The most basic/default setup, but with a custom name # - # Minitest::TestTask.create :spec do |t| - # t.test_globs = ["spec/**/*_spec.rb"] - # t.libs << "../dependency/lib" + # Minitest::TestTask.create :unit do |t| + # t.test_globs = ["test/unit/**/*_test.rb"] + # t.warning = false # end # - # Customize the name, dependencies, and use a spec directory instead - # of test. + # Customize the name and only run unit tests. class TestTask < Rake::TaskLib - WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ # :nodoc: # TODO: verify + WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ # :nodoc: ## # Create several test-oriented tasks under +name+. Takes an @@ -50,10 +49,11 @@ # Extra arguments to pass to the tests. Defaults empty but gets # populated by a number of enviroment variables: # - # + N (-n flag) a string or regexp of tests to run. - # + X (-e flag) a string or regexp of tests to exclude. - # + TESTOPTS - extra stuff. For compatibility? I guess? - # + A (arg) - quick way to inject an arbitrary argument (eg A=--help) + # N (-n flag) :: a string or regexp of tests to run. + # X (-e flag) :: a string or regexp of tests to exclude. + # A (arg) :: quick way to inject an arbitrary argument (eg A=--help). + # + # See #process_env attr_accessor :extra_args @@ -94,11 +94,14 @@ attr_accessor :test_prelude ## - # Print out commands as they run. Defaults to Rake's trace (-t + # Print out commands as they run. Defaults to Rake's +trace+ (-t # flag) option. attr_accessor :verbose + ## + # Use TestTask.create instead. + def initialize name = :test # :nodoc: self.extra_args = [] self.framework = %(require "minitest/autorun") @@ -113,38 +116,47 @@ ## # Extract variables from the environment and convert them to - # command line arguments. See +extra_args+. + # command line arguments. See #extra_args. # # Environment Variables: # - # + MT_LIB_EXTRAS - Extra libs to dynamically override/inject for custom runs. - # + N - Tests to run (string or regexp) - # + X - Tests to exclude (string or regexp) - # + TESTOPTS - deprecated, use A - # + A - Any extra arguments. Honors shell quoting. + # MT_LIB_EXTRAS :: Extra libs to dynamically override/inject for custom runs. + # N :: Tests to run (string or /regexp/). + # X :: Tests to exclude (string or /regexp/). + # A :: Any extra arguments. Honors shell quoting. + # + # Deprecated: + # + # TESTOPTS :: For argument passing, use +A+. + # N :: For parallel testing, use +MT_CPU+. + # FILTER :: Same as +TESTOPTS+. def process_env warn "TESTOPTS is deprecated in Minitest::TestTask. Use A instead" if ENV["TESTOPTS"] + warn "FILTER is deprecated in Minitest::TestTask. Use A instead" if + ENV["FILTER"] + warn "N is deprecated in Minitest::TestTask. Use MT_CPU instead" if + ENV["N"] && ENV["N"].to_i > 0 lib_extras = (ENV["MT_LIB_EXTRAS"] || "").split File::PATH_SEPARATOR - self.libs.prepend lib_extras + self.libs[0,0] = lib_extras extra_args << "-n" << ENV["N"] if ENV["N"] extra_args << "-e" << ENV["X"] if ENV["X"] extra_args.concat Shellwords.split(ENV["TESTOPTS"]) if ENV["TESTOPTS"] + extra_args.concat Shellwords.split(ENV["FILTER"]) if ENV["FILTER"] extra_args.concat Shellwords.split(ENV["A"]) if ENV["A"] + ENV.delete "N" if ENV["N"] + # TODO? RUBY_DEBUG = ENV["RUBY_DEBUG"] # TODO? ENV["RUBY_FLAGS"] extra_args.compact! end - ## - # Create the tasks. - - def define + def define # :nodoc: default_tasks = [] desc "Run the test suite. Use N, X, A, and TESTOPTS to add flags/args." @@ -157,24 +169,73 @@ puts "ruby #{make_test_cmd}" end - desc "Show which test files fail when run alone." - task "#{name}:deps" do + desc "Show which test files fail when run in isolation." + task "#{name}:isolated" do tests = Dir[*self.test_globs].uniq - null_dev = WINDOWS ? "> NUL 2>&1" : "> /dev/null 2>&1" + # 3 seems to be the magic number... (tho not by that much) + bad, good, n = {}, [], (ENV.delete("K") || 3).to_i + file = ENV.delete("F") + times = {} + + tt0 = Time.now + + n.threads_do tests.sort do |path| + t0 = Time.now + output = `#{Gem.ruby} #{make_test_cmd path} 2>&1` + t1 = Time.now - t0 + + times[path] = t1 + + if $?.success? + $stderr.print "." + good << path + else + $stderr.print "x" + bad[path] = output + end + end - tests.each do |test| - cmd = make_test_cmd test + puts "done" + puts "Ran in %.2f seconds" % [ Time.now - tt0 ] - if system "ruby #{cmd} #{null_dev}" then - puts "# good: #{test}" - else - puts "# bad: #{test}" - puts " ruby #{cmd}" + if file then + require "json" + File.open file, "w" do |io| + io.puts JSON.pretty_generate times + end + end + + unless good.empty? + puts + puts "# Good tests:" + puts + good.sort.each do |path| + puts "%.2fs: %s" % [times[path], path] end end + + unless bad.empty? + puts + puts "# Bad tests:" + puts + bad.keys.sort.each do |path| + puts "%.2fs: %s" % [times[path], path] + end + puts + puts "# Bad Test Output:" + puts + bad.sort.each do |path, output| + puts + puts "# #{path}:" + puts output + end + exit 1 + end end + task "#{name}:deps" => "#{name}:isolated" # now just an alias + desc "Show bottom 25 tests wrt time." task "#{name}:slow" do sh ["rake #{name} TESTOPTS=-v", @@ -194,12 +255,12 @@ def make_test_cmd globs = test_globs tests = [] - tests.concat Dir[*globs].shuffle + tests.concat Dir[*globs].sort.shuffle # TODO: SEED -> srand first? tests.map! { |f| %(require "#{f}") } runner = [] - runner << framework runner << test_prelude if test_prelude + runner << framework runner.concat tests runner = runner.join "; " @@ -215,3 +276,30 @@ end end end + +class Work < Queue + def initialize jobs = [] + super() + + jobs.each do |job| + self << job + end + + close + end +end + +class Integer + def threads_do(jobs) # :nodoc: + require "thread" + q = Work.new jobs + + self.times.map { + Thread.new do + while job = q.pop # go until quit value + yield job + end + end + }.each(&:join) + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2019-05-27 00:21:19.000000000 +0200 +++ new/metadata 2020-02-10 00:00:01.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: hoe version: !ruby/object:Gem::Version - version: 3.18.0 + version: 3.22.0 platform: ruby authors: - Ryan Davis @@ -10,9 +10,9 @@ cert_chain: - | -----BEGIN CERTIFICATE----- - MIIDPjCCAiagAwIBAgIBAzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu + MIIDPjCCAiagAwIBAgIBBDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB - GRYDY29tMB4XDTE4MTIwNDIxMzAxNFoXDTE5MTIwNDIxMzAxNFowRTETMBEGA1UE + GRYDY29tMB4XDTE5MTIxMzAwMDIwNFoXDTIwMTIxMjAwMDIwNFowRTETMBEGA1UE AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx @@ -22,14 +22,14 @@ qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB - AQCbJwLmpJR2PomLU+Zzw3KRzH/hbyUWc/ftru71AopZ1fy4iY9J/BW5QYKVYwbP - V0FSBWtvfI/RdwfKGtuGhPKECZgmLieGuZ3XCc09qPu1bdg7i/tu1p0t0c6163ku - nDMDIC/t/DAFK0TY9I3HswuyZGbLW7rgF0DmiuZdN/RPhHq2pOLMLXJmFclCb/im - 9yToml/06TJdUJ5p64mkBs0TzaK66DIB1Smd3PdtfZqoRV+EwaXMdx0Hb3zdR1JR - Em82dBUFsipwMLCYj39kcyHWAxyl6Ae1Cn9r/ItVBCxoeFdrHjfavnrIEoXUt4bU - UfBugfLD19bu3nvL+zTAGx/U + AQCkkcHqAa6IKLYGl93rn78J3L+LnqyxaA059n4IGMHWN5bv9KBQnIjOrpLadtYZ + vhWkunWDKdfVapBEq5+T4HzqnsEXC3aCv6JEKJY6Zw7iSzl0M8hozuzRr+w46wvT + fV2yTN6QTVxqbMsJJyjosks4ZdQYov2zdvQpt1HsLi+Qmckmg8SPZsd+T8uiiBCf + b+1ORSM5eEfBQenPXy83LZcoQz8i6zVB4aAfTGGdhxjoMGUEmSZ6xpkOzmnGa9QK + m5x9IDiApM+vCELNwDXXGNFEnQBBK+wAe4Pek8o1V1TTOxL1kGPewVOitX1p3xoN + h7iEjga8iM1LbZUfiISZ+WrB -----END CERTIFICATE----- -date: 2019-05-26 00:00:00.000000000 Z +date: 2020-02-09 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake @@ -40,7 +40,7 @@ version: '0.8' - - "<" - !ruby/object:Gem::Version - version: '13.0' + version: '15.0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement @@ -50,7 +50,7 @@ version: '0.8' - - "<" - !ruby/object:Gem::Version - version: '13.0' + version: '15.0' - !ruby/object:Gem::Dependency name: rdoc requirement: !ruby/object:Gem::Requirement @@ -76,7 +76,7 @@ manage, maintain, and release your project and includes a dynamic plug-in system allowing for easy extensibility. Hoe ships with plug-ins for all your usual project tasks including rdoc generation, - testing, packaging, deployment, and announcement.. + testing, packaging, deployment, and announcement. See class rdoc for help. Hint: `ri Hoe` or any of the plugins listed below. @@ -136,7 +136,12 @@ homepage: http://www.zenspider.com/projects/hoe.html licenses: - MIT -metadata: {} +metadata: + homepage_uri: http://www.zenspider.com/projects/hoe.html + source_code_uri: https://github.com/seattlerb/hoe + bug_tracker_uri: https://github.com/seattlerb/hoe/issues + documentation_uri: http://docs.seattlerb.org/hoe/Hoe.pdf + changelog_uri: https://github.com/seattlerb/hoe/blob/master/History.rdoc post_install_message: rdoc_options: - "--main" @@ -145,16 +150,16 @@ - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - - ">=" + - - "~>" - !ruby/object:Gem::Version - version: '0' + version: '2.1' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '1.4' requirements: [] -rubygems_version: 3.0.2 +rubygems_version: 3.0.3 signing_key: specification_version: 4 summary: Hoe is a rake/rubygems helper for project Rakefiles Binary files old/metadata.gz.sig and new/metadata.gz.sig differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_hoe.rb new/test/test_hoe.rb --- old/test/test_hoe.rb 2019-05-27 00:21:19.000000000 +0200 +++ new/test/test_hoe.rb 2020-02-10 00:00:01.000000000 +0100 @@ -146,14 +146,9 @@ def test_initialize_intuit Dir.mktmpdir do |path| Dir.chdir path do - open "Manifest.txt", "w" do |io| # sorted - io.puts "FAQ.rdoc" - io.puts "History.rdoc" - io.puts "README.rdoc" - end - - open "README.rdoc", "w" do |io| io.puts "= blah" end - open "History.rdoc", "w" do |io| io.puts "=== 1.0" end + File.write "Manifest.txt", "FAQ.rdoc\nHistory.rdoc\nREADME.rdoc\n" + File.write "README.rdoc", "= blah\n\nhome :: http://blah/" + File.write "History.rdoc", "=== 1.0" assert_equal "History.rdoc", hoe.history_file assert_equal "README.rdoc", hoe.readme_file @@ -166,15 +161,10 @@ def test_initialize_intuit_ambiguous Dir.mktmpdir do |path| Dir.chdir path do - open "Manifest.txt", "w" do |io| - io.puts "History.rdoc" # sorted - io.puts "README.ja.rdoc" - io.puts "README.rdoc" - end - - open "README.rdoc", "w" do |io| io.puts "= blah" end - open "README.ja.rdoc", "w" do |io| io.puts "= blah" end - open "History.rdoc", "w" do |io| io.puts "=== 1.0" end + File.write "Manifest.txt", "History.rdoc\nREADME.ja.rdoc\nREADME.rdoc\n" + File.write "README.rdoc", "= blah\n\nhome :: http://blah/" + File.write "README.ja.rdoc", "= blah\n\nhome :: http://blah/" + File.write "History.rdoc", "=== 1.0" assert_equal "README.ja.rdoc", hoe(:skip_files).readme_file end @@ -201,12 +191,12 @@ "* http://docs.seattlerb.org/hoe/Hoe.pdf", "* http://github.com/jbarnette/hoe-plugin-examples"].join "\n" - exp = ["https://github.com/seattlerb/hoe", - "http://docs.seattlerb.org/hoe/", - "http://docs.seattlerb.org/hoe/Hoe.pdf", - "http://github.com/jbarnette/hoe-plugin-examples"] + exp = { "home" => "https://github.com/seattlerb/hoe" } + err = /DEPRECATED: Please switch readme to hash format/ - assert_equal exp, hoe.parse_urls(ary) + assert_output "", err do + assert_equal exp, hoe.parse_urls(ary) + end end def test_parse_urls_hash @@ -227,6 +217,73 @@ assert_equal exp, hoe.parse_urls(hash) end + def test_parse_mrww + h = nil + mrww_readme = <<~EOM + = make + = rake + = work + = well + + home :: https://github.com/seattlerb/makerakeworkwell + rdoc :: http://docs.seattlerb.org/makerakeworkwell + + == DESCRIPTION: + + make/rake/work/well provides two simple modifications to rake that + make working with file tasks cleaner, easier, and faster. + EOM + + + + assert_silent do + h = Hoe.spec "blah" do + developer "author", "email" + license "MIT" + self.version = "1.0" + self.readme_file = nil + self.history_file = nil + self.changes = true + + self.intuit_values mrww_readme + end + end + + desc = mrww_readme.lines[10..11].join.chomp + urls = { + "home" => "https://github.com/seattlerb/makerakeworkwell", + "rdoc" => "http://docs.seattlerb.org/makerakeworkwell" + } + + assert_equal desc, h.description + assert_equal desc, h.summary + assert_equal urls, h.urls + end + + def test_metadata + hash = [ + "home :: https://github.com/seattlerb/hoe", + "doco :: http://docs.seattlerb.org/hoe/Hoe.pdf", + "clog :: https://github.com/seattlerb/hoe/master/History.rdoc", + "bugs :: https://github.com/seattlerb/hoe/issues", + "code :: https://github.com/seattlerb/hoe", + "wiki :: https://github.com/seattlerb/hoe/wiki", + "mail :: https://github.com/seattlerb/hoe/wiki#mailing_list", + ].join "\n" + + exp = { + "home" => "https://github.com/seattlerb/hoe", + "doco" => "http://docs.seattlerb.org/hoe/Hoe.pdf", + "clog" => "https://github.com/seattlerb/hoe/master/History.rdoc", + "bugs" => "https://github.com/seattlerb/hoe/issues", + "code" => "https://github.com/seattlerb/hoe", + "wiki" => "https://github.com/seattlerb/hoe/wiki", + "mail" => "https://github.com/seattlerb/hoe/wiki#mailing_list", + } + + assert_equal exp, hoe.parse_urls(hash) + end + def test_possibly_better t = Gem::Specification::TODAY @@ -244,6 +301,7 @@ "bugs" => "https://github.com/seattlerb/hoe/issues", "rdoc" => "http://docs.seattlerb.org/hoe/", "doco" => "http://docs.seattlerb.org/hoe/Hoe.pdf", + "clog" => "https://github.com/seattlerb/hoe/blob/master/History.rdoc", "other" => "http://github.com/jbarnette/hoe-plugin-examples", } @@ -265,18 +323,19 @@ assert_equal urls["home"], spec.homepage assert_equal ["--main", "README.rdoc"], spec.rdoc_options assert_equal ["lib"], spec.require_paths - assert_equal Gem::RubyGemsVersion, spec.rubygems_version + assert_equal Gem::VERSION, spec.rubygems_version assert_match(/^Hoe.*Rakefiles$/, spec.summary) deps = spec.dependencies.sort_by(&:name) expected = [ ["hoe", :development, "~> #{Hoe::VERSION.sub(/\.\d+$/, "")}"], - ["rdoc", :development, ">= 4.0, < 7"], + ["rdoc", :development, "< 7", ">= 4.0"], ] assert_equal expected, deps.map { |dep| - [dep.name, dep.type, dep.requirement.to_s] + dep_reqs = dep.requirement.to_s.split(/, /).sort + [dep.name, dep.type, *dep_reqs] } end @@ -399,6 +458,8 @@ end def test_with_config_overrides + require "hoe/debug" # modifies Hoe::DEFAULT_CONFIG["exclude"] + overrides = { "exclude" => Regexp.union( Hoe::DEFAULT_CONFIG["exclude"], /\.hg/ ), "plugins" => %w[tweedledee tweedledum], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_hoe_debug.rb new/test/test_hoe_debug.rb --- old/test/test_hoe_debug.rb 2019-05-27 00:21:19.000000000 +0200 +++ new/test/test_hoe_debug.rb 2020-02-10 00:00:01.000000000 +0100 @@ -51,8 +51,6 @@ end def test_check_manifest_missing - skip "https://github.com/MagLev/maglev/issues/224" if maglev? - in_tmpdir do manifest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_hoe_package.rb new/test/test_hoe_package.rb --- old/test/test_hoe_package.rb 2019-05-27 00:21:19.000000000 +0200 +++ new/test/test_hoe_package.rb 2020-02-10 00:00:01.000000000 +0100 @@ -1,4 +1,5 @@ require "hoe" +require "minitest/autorun" Hoe.load_plugins diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_hoe_test.rb new/test/test_hoe_test.rb --- old/test/test_hoe_test.rb 2019-05-27 00:21:19.000000000 +0200 +++ new/test/test_hoe_test.rb 2020-02-10 00:00:01.000000000 +0100 @@ -26,36 +26,77 @@ end end - def test_make_test_cmd_with_different_testlibs - skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"] + EXPECTED = %W[-w -Ilib:bin:test:. + -e 'require "rubygems"; %srequire "test/test_hoe_test.rb"' + --].join(" ") + " " + + MT_EXPECTED = %W[-Ilib:test:. -w + -e '%srequire "test/test_hoe_test.rb"' + --].join(" ") + " " - expected = ['-w -Ilib:bin:test:. -e \'require "rubygems"; %s', - 'require "test/test_hoe_test.rb"', - "' -- ", - ].join + def test_make_test_cmd_defaults_to_minitest + skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"] # default assert_deprecated do autorun = %(require "minitest/autorun"; ) - assert_equal expected % autorun, @tester.make_test_cmd + assert_equal EXPECTED % autorun, @tester.make_test_cmd end + end + + def test_make_test_cmd_for_testunit + skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"] assert_deprecated do @tester.testlib = :testunit testunit = %(require "test/unit"; ) - assert_equal expected % testunit, @tester.make_test_cmd + assert_equal EXPECTED % testunit, @tester.make_test_cmd end + end - assert_deprecated do - @tester.testlib = :minitest - autorun = %(require "minitest/autorun"; ) - assert_equal expected % autorun, @tester.make_test_cmd + def test_make_test_cmd_for_minitest + skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"] + + require "minitest/test_task" # currently in hoe, but will move + + framework = %(require "minitest/autorun"; ) + + @tester = Minitest::TestTask.create :test do |t| + t.libs += Hoe.include_dirs.uniq + t.test_globs = ["test/test_hoe_test.rb"] end + assert_equal MT_EXPECTED % [framework].join("; "), @tester.make_test_cmd + end + + def test_make_test_cmd_for_minitest_prelude + skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"] + + require "minitest/test_task" # currently in hoe, but will move + + prelude = %(require "other/file") + framework = %(require "minitest/autorun"; ) + + @tester = Minitest::TestTask.create :test do |t| + t.test_prelude = prelude + t.libs += Hoe.include_dirs.uniq + t.test_globs = ["test/test_hoe_test.rb"] + end + + assert_equal MT_EXPECTED % [prelude, framework].join("; "), @tester.make_test_cmd + end + + def test_make_test_cmd_for_no_framework + skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"] + assert_deprecated do @tester.testlib = :none - assert_equal expected % "", @tester.make_test_cmd + assert_equal EXPECTED % "", @tester.make_test_cmd end + end + + def test_make_test_cmd_for_faketestlib + skip "Using TESTOPTS... skipping" if ENV["TESTOPTS"] @tester.testlib = :faketestlib e = assert_raises(RuntimeError) do