seattlerb / hoe

Hoe is a rake/rubygems helper for project Rakefiles. It helps you 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.

Home Page:http://www.zenspider.com/projects/hoe.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hoe >= 3.19 incompatible with Ruby < 2.1

MSP-Greg opened this issue · comments

Hoe 3.19 and later are incompatible with Ruby < 2.1 due to using an Array#to_h call here:

hoe/lib/hoe.rb

Lines 537 to 539 in 4a75996

s.metadata = (urls.keys & URLS_TO_META_MAP.keys).map { |name|
[URLS_TO_META_MAP[name], urls[name]]
}.to_h

I think it could be 'fixed' with something like:

s.metadata             = Hash[
  (urls.keys & URLS_TO_META_MAP.keys).map { |name| 
    [URLS_TO_META_MAP[name], urls[name]] 
  }
]

Most repos' CI doesn't include older Ruby versions, but if it works...

EDIT: Came across the issue when trying to get sqlite3 CI to pass on Travis. It passes CI back to 1.9.3...

Thoughts?

Sorry, I wasn't really clear on this. 3.19.0 and 3.20.0 won't even load with Ruby 1.9.3 & 2.0. At present, all of the released gems do not have required_ruby_version in their gemspecs.

For gems/repos testing on old Ruby versions, it would be helpful if 3.20.1 was released with this fixed, and then, if needed, start using required_ruby_version for 3.21 or whatever.

I haven't verified if this is the only issue with early Ruby versions.

Support ended for ruby 2.0 in 2016... for 1.9 that ended in 2015. Both have known problems against the latest versions and really shouldn't be used anymore if at all possible.

I'm not against fixing this... but it is certainly something you should consider.

Yes, I know. I would always suggest that anyone using Rubies that old strongly consider upgrading. I do quite a bit of my work using Ruby master.

The CI issue was solved with a Gemfile hack.

gem "hoe", (RUBY_VERSION < "2.1" ? "3.18.1" : "~>3.20")

Maybe just add required_ruby_version to the next release?...

Adding require_ruby_version "~> 2.1" now...

(and it probably should be 2.3 since I won't test that far back)

@zenspider

ruby master was just changed from 2.8.0 to 3.0.0. Neither hoe or minitest will load.

As you might imagine, this will break a lot of CI. I could do PR's for both, require_ruby_version ">= 2.1", but the real work (gem release) I can't do...

No prob. Celebrating an anniversary currently but I’ll get a release out shortly. Can you cut a new issue so I have something open on it?

Congratulations & enjoy yourself. CI using Bundler often works, as it just installs an older version...

See #109

Fixed! Thank you!