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

Draft Roadmap: Cask DSL 2.0 #5592

Closed
1 task
rolandwalker opened this issue Jul 31, 2014 · 3 comments
Closed
1 task

Draft Roadmap: Cask DSL 2.0 #5592

rolandwalker opened this issue Jul 31, 2014 · 3 comments
Milestone

Comments

@rolandwalker
Copy link
Contributor

This is a catch-all issue for the Cask DSL version 2.0

This is only a draft for discussion; not everything here will necessarily get implemented. Furthermore, DSL 2.0 is far enough in the future that we have no idea when we would start working on it.

  • variant
    • proposed syntax variant.localization('en') do ... end
    • This worked fine in a quick draft
    • Chaining can also work (eg variant.localization('en').hardware('x86') do ... end) but nesting is probably clearer.
    • types: localization, hardware, arch (bitness), os_version, java_version
    • completely do away with conditionals: make Cask aware of the choices
    • defaults should be modifiable in persistent config file and command-line
    • many Casks could be moved from the Homebrew-versions repo and inlined into sister Casks in the main repo

References: #4688

@federicobond
Copy link
Contributor

What about this?

variant localization('en'), architecture('x86') do
  ...
end

Or optionally nested:

variant localization('en') do
  variant architecture('x86') do
    ...
  end
end

Idea stolen from http://soveran.github.io/cuba/

@federicobond
Copy link
Contributor

Nevermind, it does not add much clarity and forces us to put the matchers at the top level.

@rolandwalker
Copy link
Contributor Author

@federicobond as syntax, your version reads much better. But yes, I was trying to avoid defining methods such as localization at the top-level. I would rather do it your way if Ruby let me.

Here's a gist of a stupid rough draft in which variant constructs a VariantContainer instance. The VariantContainer instance has methods localization, etc., and consumes the do block.

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

No branches or pull requests

5 participants