Merge pull request #3522 from reitermarkus/caskroom
Remove unused writer methods for `Hbc.caskroom` and `Hbc.cache`.
This commit is contained in:
commit
0ad42ebbcb
@ -7,14 +7,10 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
attr_writer :caskroom
|
|
||||||
|
|
||||||
def caskroom
|
def caskroom
|
||||||
@caskroom ||= HOMEBREW_PREFIX.join("Caskroom")
|
@caskroom ||= HOMEBREW_PREFIX.join("Caskroom")
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_writer :cache
|
|
||||||
|
|
||||||
def cache
|
def cache
|
||||||
@cache ||= HOMEBREW_CACHE.join("Cask")
|
@cache ||= HOMEBREW_CACHE.join("Cask")
|
||||||
end
|
end
|
||||||
@ -61,8 +57,6 @@ module Hbc
|
|||||||
@servicedir ||= Pathname.new("~/Library/Services").expand_path
|
@servicedir ||= Pathname.new("~/Library/Services").expand_path
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_writer :binarydir
|
|
||||||
|
|
||||||
def binarydir
|
def binarydir
|
||||||
@binarydir ||= HOMEBREW_PREFIX.join("bin")
|
@binarydir ||= HOMEBREW_PREFIX.join("bin")
|
||||||
end
|
end
|
||||||
|
|||||||
@ -11,9 +11,8 @@ module Hbc
|
|||||||
EOS
|
EOS
|
||||||
end)
|
end)
|
||||||
|
|
||||||
option "--caskroom=PATH", (lambda do |value|
|
option "--caskroom=PATH", (lambda do |*|
|
||||||
Hbc.caskroom = value
|
odisabled "`brew cask` with the `--caskroom` flag"
|
||||||
odeprecated "`brew cask` with the `--caskroom` flag", disable_on: Time.utc(2017, 10, 31)
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -7,10 +7,6 @@ describe Hbc::Artifact::Binary, :cask do
|
|||||||
let(:artifacts) { cask.artifacts.select { |a| a.is_a?(described_class) } }
|
let(:artifacts) { cask.artifacts.select { |a| a.is_a?(described_class) } }
|
||||||
let(:expected_path) { Hbc.binarydir.join("binary") }
|
let(:expected_path) { Hbc.binarydir.join("binary") }
|
||||||
|
|
||||||
before(:each) do
|
|
||||||
Hbc.binarydir.mkpath
|
|
||||||
end
|
|
||||||
|
|
||||||
after(:each) do
|
after(:each) do
|
||||||
FileUtils.rm expected_path if expected_path.exist?
|
FileUtils.rm expected_path if expected_path.exist?
|
||||||
end
|
end
|
||||||
|
|||||||
@ -8,18 +8,17 @@ require "test/support/helper/cask/never_sudo_system_command"
|
|||||||
|
|
||||||
HOMEBREW_CASK_DIRS = [
|
HOMEBREW_CASK_DIRS = [
|
||||||
:appdir,
|
:appdir,
|
||||||
:caskroom,
|
|
||||||
:cache,
|
|
||||||
:prefpanedir,
|
:prefpanedir,
|
||||||
:qlplugindir,
|
:qlplugindir,
|
||||||
:servicedir,
|
:servicedir,
|
||||||
:binarydir,
|
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
RSpec.shared_context "Homebrew-Cask" do
|
RSpec.shared_context "Homebrew-Cask" do
|
||||||
around(:each) do |example|
|
around(:each) do |example|
|
||||||
third_party_tap = Tap.fetch("third-party", "tap")
|
third_party_tap = Tap.fetch("third-party", "tap")
|
||||||
begin
|
begin
|
||||||
|
[Hbc.binarydir, Hbc.caskroom, Hbc.cache].each(&:mkpath)
|
||||||
|
|
||||||
dirs = HOMEBREW_CASK_DIRS.map do |dir|
|
dirs = HOMEBREW_CASK_DIRS.map do |dir|
|
||||||
Pathname.new(TEST_TMPDIR).join("cask-#{dir}").tap do |path|
|
Pathname.new(TEST_TMPDIR).join("cask-#{dir}").tap do |path|
|
||||||
path.mkpath
|
path.mkpath
|
||||||
@ -40,6 +39,7 @@ RSpec.shared_context "Homebrew-Cask" do
|
|||||||
example.run
|
example.run
|
||||||
ensure
|
ensure
|
||||||
FileUtils.rm_rf dirs
|
FileUtils.rm_rf dirs
|
||||||
|
FileUtils.rm_rf [Hbc.binarydir, Hbc.caskroom, Hbc.cache]
|
||||||
Hbc.default_tap.path.unlink
|
Hbc.default_tap.path.unlink
|
||||||
FileUtils.rm_rf Hbc.default_tap.path.parent
|
FileUtils.rm_rf Hbc.default_tap.path.parent
|
||||||
third_party_tap.path.unlink
|
third_party_tap.path.unlink
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user