diff options
| author | Markus Reiter | 2016-10-04 22:44:19 +0200 |
|---|---|---|
| committer | GitHub | 2016-10-04 22:44:19 +0200 |
| commit | a7a2aef803afbadd49a281b840c0bf9083fcf71e (patch) | |
| tree | ffe336ab8f53de98d4e06685a2c21452976b2605 /Library/Homebrew/cask/lib/hbc/system_command.rb | |
| parent | cafe1497808ef1ddb002061665ad606aa2340d10 (diff) | |
| parent | ddf5583208e473ef00447834a3a712411e61e190 (diff) | |
| download | brew-a7a2aef803afbadd49a281b840c0bf9083fcf71e.tar.bz2 | |
Merge pull request #1224 from reitermarkus/refactor-extensions
Refactor Cask’s extensions.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/system_command.rb')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/system_command.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb index 160aadff9..aa4b9b295 100644 --- a/Library/Homebrew/cask/lib/hbc/system_command.rb +++ b/Library/Homebrew/cask/lib/hbc/system_command.rb @@ -1,6 +1,10 @@ require "open3" require "shellwords" +require "extend/io" + +require "hbc/utils/hash_validator" + module Hbc class SystemCommand attr_reader :command @@ -43,7 +47,8 @@ module Hbc attr_reader :executable, :options, :processed_output, :processed_status def process_options! - options.assert_valid_keys :input, :print_stdout, :print_stderr, :args, :must_succeed, :sudo, :bsexec + options.extend(HashValidator) + .assert_valid_keys :input, :print_stdout, :print_stderr, :args, :must_succeed, :sudo, :bsexec sudo_prefix = %w[/usr/bin/sudo -E --] bsexec_prefix = ["/bin/launchctl", "bsexec", options[:bsexec] == :startup ? "/" : options[:bsexec]] @command = [executable] |
