-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Add DSL for after_install and similar blocks #5723
Conversation
|
||
module InstalledMethods | ||
def info_plist | ||
"#{destination_path}/#{artifacts[:link].first.first}/Contents/Info.plist" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
artifacts[:link].first.first
is ugly. Any better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Lisp there is caar
. Ruby is somewhat Lispy, but seems to lack this.
For a prototype, this is pretty great! The functionality would definitely get used by many Cask authors. Also, we can be fairly liberal about merging something incomplete as long as it stays undocumented. My main question is the choice of class name/filename. Will another coder realize that |
Yes, I am not a fan of the names either. |
Two other points:
|
Tests are passing. There is certainly room for improvement but, if the other maintainers agree, we can merge it as is. Let me know and I can squash the commits. |
Let's squash and merge. Momentum is important. Later – must it be considered a decorator? The |
include Cask::DSL::Installed | ||
|
||
def suppress_move_to_applications | ||
system_command("/usr/bin/defaults", :args => ["write", bundle_identifier, "suppressMoveToApplications", "-bool", "true"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out suppressMoveToApplications
is not a standard at all, and most of the Casks use moveToApplicationsFolderAlertSuppress
instead. There is also kNTMoveToApplicationsFolderAlertSuppress
.
We may also need a generic DSL method for accessing defaults
.
@rolandwalker PR is ready to merge. Thanks for the feedback. I like the approach used by |
Add DSL for after_install and similar blocks
It's great to have your input. I'm closing #5268 and #5266. I tried to remove the WRT assistive devices needing to be explicit on install and uninstall, perhaps we can leverage the upcoming |
Since it is taking so many weeks to finish #4688, that means this code has been out for a long time, and these elements can be blessed into DSL 1.0. No objections, right? I only want to look at the question of consistency for calling external commands from a Cask. Currently, I have the problem that |
No objections. Let me know if there are any pressing issues you need help with. I've been a little out of the loop lately. |
Refs #5268
This is just a prototype version. Some tests are broken and others missing, but I wanted to get feedback on the general direction and style advice so that I can continue working.