mirror of
https://github.com/wavetermdev/homebrew-cask.git
synced 2026-08-05 13:43:24 -07:00
Merge pull request #2546 from rolandwalker/indenting
indent to two spaces
This commit is contained in:
@@ -311,6 +311,11 @@ If your application and homebrew-cask do not work well together, feel free to
|
||||
[file an issue](https://github.com/phinze/homebrew-cask/issues) after checking
|
||||
out open issues.
|
||||
|
||||
## Indenting
|
||||
|
||||
All Casks and code in the homebrew-cask project should be indented using two
|
||||
spaces (never tabs).
|
||||
|
||||
## Submitting Your Changes
|
||||
|
||||
Hop into your Tap and check to make sure your new Cask is there:
|
||||
|
||||
@@ -5,12 +5,12 @@ class CrosspackAvr < Cask
|
||||
sha1 'd255e7822e961c002691fbb0d19a564a819c7386'
|
||||
install 'CrossPack-AVR.pkg'
|
||||
after_uninstall do
|
||||
IO.popen('yes | sudo -E /usr/local/CrossPack-AVR/uninstall && sudo pkgutil --forget at.obdev.CrossPack-AVR', 'r+') do |pipe|
|
||||
pipe.close_write
|
||||
while line = pipe.gets
|
||||
puts line
|
||||
end
|
||||
end
|
||||
IO.popen('yes | sudo -E /usr/local/CrossPack-AVR/uninstall && sudo pkgutil --forget at.obdev.CrossPack-AVR', 'r+') do |pipe|
|
||||
pipe.close_write
|
||||
while line = pipe.gets
|
||||
puts line
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
caveats do
|
||||
|
||||
@@ -5,10 +5,10 @@ class Mailfollowup < Cask
|
||||
sha1 '538c0441786be4a89a68ce168de2087fa9304c95'
|
||||
nested_container 'MailFollowUp_1.6.2.dmg'
|
||||
install 'Install MailFollowUp.pkg'
|
||||
|
||||
|
||||
uninstall(
|
||||
:quit => 'com.apple.mail',
|
||||
:quit => 'com.apple.mail',
|
||||
:files => '~/Library/Mail/Bundles/MailFollowUp.mailbundle/'
|
||||
)
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -5,5 +5,5 @@ class ProlificUsbSerialDriver < Cask
|
||||
sha1 '2e30c876b159f6be76f5a9d58a0cd512fb2a5478'
|
||||
install 'md_PL2303_MacOSX-10_6up_v1_5_1/PL2303_MacOSX_v1.5.1.pkg'
|
||||
uninstall :pkgutil => 'com.prolific.prolificUsbserialCableDriverV151.ProlificUsbSerial.pkg',
|
||||
:kext => 'com.prolific.driver.PL2303'
|
||||
:kext => 'com.prolific.driver.PL2303'
|
||||
end
|
||||
|
||||
@@ -12,9 +12,9 @@ class Cask::CLI::Search
|
||||
cask_names = simplified_titles.grep(/#{simplified_search_term}/i) { |t| all_titles[simplified_titles.index(t)] }
|
||||
end
|
||||
unless cask_names.empty?
|
||||
puts_columns Cask::CLI.nice_listing cask_names
|
||||
puts_columns Cask::CLI.nice_listing cask_names
|
||||
else
|
||||
puts "No cask found for \"#{search_term}\"."
|
||||
puts "No cask found for \"#{search_term}\"."
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+12
-12
@@ -1,15 +1,15 @@
|
||||
module Cask::Options
|
||||
def self.included(base)
|
||||
base.extend(ClassMethods)
|
||||
end
|
||||
def self.included(base)
|
||||
base.extend(ClassMethods)
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
def no_binaries
|
||||
@no_binaries ||= false
|
||||
end
|
||||
module ClassMethods
|
||||
def no_binaries
|
||||
@no_binaries ||= false
|
||||
end
|
||||
|
||||
def no_binaries=(_no_binaries)
|
||||
@no_binaries = _no_binaries
|
||||
end
|
||||
end
|
||||
end
|
||||
def no_binaries=(_no_binaries)
|
||||
@no_binaries = _no_binaries
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
require 'test_helper'
|
||||
|
||||
describe Cask::Artifact::App do
|
||||
let(:cask) {
|
||||
Cask.load('with-binary').tap do |cask|
|
||||
TestHelper.install_without_artifacts(cask)
|
||||
end
|
||||
}
|
||||
let(:expected_path) {
|
||||
Cask.binarydir/'binary'
|
||||
}
|
||||
let(:cask) {
|
||||
Cask.load('with-binary').tap do |cask|
|
||||
TestHelper.install_without_artifacts(cask)
|
||||
end
|
||||
}
|
||||
let(:expected_path) {
|
||||
Cask.binarydir/'binary'
|
||||
}
|
||||
|
||||
it "links the binary to the proper directory" do
|
||||
shutup do
|
||||
Cask::Artifact::Binary.new(cask).install
|
||||
end
|
||||
it "links the binary to the proper directory" do
|
||||
shutup do
|
||||
Cask::Artifact::Binary.new(cask).install
|
||||
end
|
||||
|
||||
TestHelper.valid_alias?(expected_path).must_equal true
|
||||
end
|
||||
TestHelper.valid_alias?(expected_path).must_equal true
|
||||
end
|
||||
|
||||
it "avoids clobbering an existing binary by linking over it" do
|
||||
FileUtils.touch expected_path
|
||||
|
||||
shutup do
|
||||
Cask::Artifact::Binary.new(cask).install
|
||||
end
|
||||
it "avoids clobbering an existing binary by linking over it" do
|
||||
FileUtils.touch expected_path
|
||||
|
||||
expected_path.wont_be :symlink?
|
||||
end
|
||||
shutup do
|
||||
Cask::Artifact::Binary.new(cask).install
|
||||
end
|
||||
|
||||
it "clobbers an existing symlink" do
|
||||
expected_path.make_symlink('/tmp')
|
||||
expected_path.wont_be :symlink?
|
||||
end
|
||||
|
||||
shutup do
|
||||
Cask::Artifact::Binary.new(cask).install
|
||||
end
|
||||
it "clobbers an existing symlink" do
|
||||
expected_path.make_symlink('/tmp')
|
||||
|
||||
File.readlink(expected_path).wont_equal '/tmp'
|
||||
end
|
||||
shutup do
|
||||
Cask::Artifact::Binary.new(cask).install
|
||||
end
|
||||
|
||||
it "respects --no-binaries flag" do
|
||||
Cask.no_binaries = true
|
||||
File.readlink(expected_path).wont_equal '/tmp'
|
||||
end
|
||||
|
||||
shutup do
|
||||
Cask::Artifact::Binary.new(cask).install
|
||||
end
|
||||
it "respects --no-binaries flag" do
|
||||
Cask.no_binaries = true
|
||||
|
||||
expected_path.exist?.must_equal false
|
||||
shutup do
|
||||
Cask::Artifact::Binary.new(cask).install
|
||||
end
|
||||
|
||||
Cask.no_binaries = false
|
||||
end
|
||||
end
|
||||
expected_path.exist?.must_equal false
|
||||
|
||||
Cask.no_binaries = false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,8 +11,8 @@ describe Cask::CLI::Search do
|
||||
end
|
||||
|
||||
it "shows that there are no casks matching a search term that did not result in anything" do
|
||||
lambda {
|
||||
Cask::CLI::Search.run('foo-bar-baz')
|
||||
}.must_output("No cask found for \"foo-bar-baz\".\n")
|
||||
lambda {
|
||||
Cask::CLI::Search.run('foo-bar-baz')
|
||||
}.must_output("No cask found for \"foo-bar-baz\".\n")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user