-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require Ruby 2.6 #45
Require Ruby 2.6 #45
Conversation
I was trying to use this gem on Ruby 2.5 (sigh) and ran into an issue. It turns out that it calls `then` on a Hash, which was added in Ruby 2.6. I figured it would be helpful to document this explicitly. https://til.hashrocket.com/posts/f4agttd8si-chaining-then-in-ruby-26
If |
Yeah that'd work too, I can make that change later. I didn't know if it was intentional or if there are any other dependencies on 2.6. |
For Ruby 2.5 compatibility.
@rubys done! I haven't tested this on Ruby 2.5 yet but it seems like it should work now... Actually... maybe not. I now get this error, so maybe there's an issue with 2.5's version of ERB. Maybe something changed with how it handles partials? I'm confused since the syntax seems pretty normal to me... 🤷🏾.
The template line in question: https://github.com/fly-apps/dockerfile-rails/blob/main/lib/generators/templates/Dockerfile.erb#L39 The part of ERB that's raising the error though I don't really understand why: https://github.com/ruby/ruby/blob/b7f19dd8419aa10c8bc3dfb8181a2caafe0d81d9/lib/erb.rb#L874 Personally... I'm not very invested in making this work on 2.5, I am in the process of upgrading anyway, and I can run the generator with 2.6 even if I'm building a 2.5 Docker image at the moment. Do you think it makes sense to just update the gemspec to specify 2.6+ for now? Thanks! I do really like this gem overall. |
Fix the RuboCop failure and I'll merge the change. |
Thanks! I left change of the alias method in for now, hope that's okay. If I get some time to figure out why it's not working on 2.5 I may submit another PR and loosen the restriction, but for now this should probably help some confusion for people on old Ruby versions. |
I was trying to use this gem on Ruby 2.5 (sigh) and ran into an issue. It turns out that it calls
then
on a Hash, which was added in Ruby 2.6. I figured it would be helpful to document this explicitly, though hopefully there aren't a lot of people out there running 2.5.https://til.hashrocket.com/posts/f4agttd8si-chaining-then-in-ruby-26