Skip to content
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

Allow defining top-level modules without :: #332

Merged
merged 3 commits into from
Feb 17, 2021
Merged

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Feb 7, 2021

This is a feature originally proposed in itamae-kitchen/mitamae#64, using the idea in https://dev.to/okuramasafumi/eval-ing-twice-to-define-toplevel-module-from-string-33ma.

Instead of module ::Helper, you'll be able to write the following recipes without errors:

# helper.rb
module Helper
  def self.help
    :help
  end
end
# recipe.rb
include_recipe 'helper'
Helper.help

This also fixes #308.

@unasuke
Copy link
Member

unasuke commented Feb 7, 2021

It seems ok. Ruby is very profound...Ah, where is the result of travis-ci.com?
Last night, we reached the quota of travis ci maybe. sue445-san had contacted travis. I want to wait for the response.

@sue445
Copy link
Member

sue445 commented Feb 17, 2021

@k0kubun I revived CI and merged the latest master.

But the build seems to be failing.
Please fix this 🙏

Copy link
Member

@sue445 sue445 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@k0kubun
Copy link
Member Author

k0kubun commented Feb 17, 2021

Thanks for preparing GitHub Actions! 👏 👏 👏

@k0kubun k0kubun merged commit dcd1440 into master Feb 17, 2021
@k0kubun k0kubun deleted the topleve-definition branch February 17, 2021 04:22
@sue445
Copy link
Member

sue445 commented Feb 17, 2021

released as v1.12.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Capturing local variable context doesn't work
3 participants