diff options
| author | Xu Cheng | 2015-03-26 12:14:22 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-03-27 16:01:34 +0800 |
| commit | 32efd704a0d81828386575ec51860b95b75a6659 (patch) | |
| tree | 970ff1c38419959ef75293ab8d8bbb113ce8f1a3 /Library | |
| parent | 8cb2bc4c3d52bd84a686dfbde6c7b7800209ae87 (diff) | |
| download | homebrew-32efd704a0d81828386575ec51860b95b75a6659.tar.bz2 | |
reattach-to-user-namespace: add test and modernize
Closes #38086.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/reattach-to-user-namespace.rb | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Library/Formula/reattach-to-user-namespace.rb b/Library/Formula/reattach-to-user-namespace.rb index 4a050aa24..79764a2a5 100644 --- a/Library/Formula/reattach-to-user-namespace.rb +++ b/Library/Formula/reattach-to-user-namespace.rb @@ -1,29 +1,29 @@ -require 'formula' - class ReattachToUserNamespace < Formula - homepage 'https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard' - url 'https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/archive/v2.3.tar.gz' - sha1 '830d329992b294c2673ed240ee3c7786e4e06308' + homepage "https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard" + url "https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/archive/v2.3.tar.gz" + sha256 "f9ff4f7bca2927465092c8c5cb44b782a8a500229db72a014bbb12bf43a5bf96" - head 'https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git' + head "https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git" - option 'wrap-pbcopy-and-pbpaste', 'Include wrappers for pbcopy/pbpaste that shim in this fix' - option 'wrap-launchctl', 'Include wrapper for launchctl with this fix' + option "with-wrap-pbcopy-and-pbpaste", "Include wrappers for pbcopy/pbpaste that shim in this fix" + option "with-wrap-launchctl", "Include wrapper for launchctl with this fix" + deprecated_option "wrap-pbcopy-and-pbpaste" => "with-wrap-pbcopy-and-pbpaste" + deprecated_option "wrap-launchctl" => "with-wrap-launchctl" def install system "make" bin.install "reattach-to-user-namespace" - wrap_pbpasteboard_commands if build.include? 'wrap-pbcopy-and-pbpaste' - wrap_launchctl if build.include? 'wrap-launchctl' + wrap_pbpasteboard_commands if build.with? "wrap-pbcopy-and-pbpaste" + wrap_launchctl if build.with? "wrap-launchctl" end def wrap_pbpasteboard_commands - make_executable_with_content('pbcopy', 'cat - | reattach-to-user-namespace /usr/bin/pbcopy') - make_executable_with_content('pbpaste', 'reattach-to-user-namespace /usr/bin/pbpaste') + make_executable_with_content("pbcopy", "cat - | reattach-to-user-namespace /usr/bin/pbcopy") + make_executable_with_content("pbpaste", "reattach-to-user-namespace /usr/bin/pbpaste") end def wrap_launchctl - make_executable_with_content('launchctl', 'reattach-to-user-namespace /bin/launchctl "$@"') + make_executable_with_content("launchctl", 'reattach-to-user-namespace /bin/launchctl "$@"') end def make_executable_with_content(executable_name, content_lines) @@ -32,4 +32,8 @@ class ReattachToUserNamespace < Formula executable.write(content) executable.chmod(0755) end + + test do + system bin/"reattach-to-user-namespace", "-l", "bash", "-c", "echo Hello World!" + end end |
