Skip to content

Commit

Permalink
flatten homebrew-fork and move it under vendor/lib
Browse files Browse the repository at this point in the history
* remove transitional modifications to $LOAD_PATH
* all require statements are now explicit about loading from homebrew-fork
  • Loading branch information
rolandwalker committed Dec 31, 2014
1 parent a17ddd8 commit 36b8903
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 24 deletions.
4 changes: 1 addition & 3 deletions lib/brew-cask-cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@

require 'pathname'

# todo remove internal Homebrew dependencies and remove this line
$LOAD_PATH.unshift(File.expand_path('../homebrew-fork/Library/Homebrew', Pathname.new(__FILE__).realpath))
$LOAD_PATH.unshift(File.expand_path('..', Pathname.new(__FILE__).realpath))

# todo remove internal Homebrew dependencies and remove this line
require 'global'
require 'vendor/homebrew-fork/global'

require 'cask'

Expand Down
3 changes: 2 additions & 1 deletion lib/cask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

class Cask; end

require 'download_strategy'
# todo remove internal Homebrew dependencies and remove this line
require 'vendor/homebrew-fork/download_strategy'

require 'cask/extend'
require 'cask/artifact'
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'resource'
require 'vendor/homebrew-fork/resource'

class AbstractDownloadStrategy
attr_reader :name, :resource
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'extend/pathname'
require 'exceptions'
require 'utils'
require 'vendor/homebrew-fork/monkeypatch_pathname'
require 'vendor/homebrew-fork/exceptions'
require 'vendor/homebrew-fork/utils'

def cache
if ENV['HOMEBREW_CACHE']
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'download_strategy'
require 'vendor/homebrew-fork/download_strategy'

# Resource is the fundamental representation of an external resource. The
# primary formula download, along with other declared resources, are instances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

$:.push(File.expand_path(__FILE__+'/../..'))

require 'extend/pathname'
require 'utils'
require 'vendor/homebrew-fork/monkeypatch_pathname'
require 'vendor/homebrew-fork/utils'
require 'tmpdir'

TEST_TMPDIR = Dir.mktmpdir("homebrew_tests")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'pathname'
require 'exceptions'
require 'hardware'
require 'utils/popen'
require 'vendor/homebrew-fork/exceptions'
require 'vendor/homebrew-fork/hardware'
require 'vendor/homebrew-fork/popen'

def homebrew_fork_system cmd, *args
puts "#{cmd} #{args*' '}" if Cask.verbose
Expand Down
7 changes: 2 additions & 5 deletions spec/support/homebrew_testing_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ def self.included(base)
# set some Homebrew constants used in our code
base.const_set('HOMEBREW_BREW_FILE', '/usr/local/bin/brew')

# add our homebrew fork to load path
# todo: removeme, this is transitional
$:.push(Pathname.new(File.expand_path(__FILE__+'/../../../lib/homebrew-fork/Library/Homebrew')))

# require homebrew testing env
with_disabled_at_exit do
require 'test/testing_env'
# todo: removeme, this is transitional
require 'vendor/homebrew-fork/testing_env'
end
end
end
7 changes: 2 additions & 5 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@
lib_path = brew_cask_path.join('lib')
$:.push(lib_path)

# add our homebrew fork to load path
# todo: removeme, this is transitional
$:.push(lib_path.join('homebrew-fork', 'Library', 'Homebrew'))

# require homebrew testing env
require 'test/testing_env'
# todo: removeme, this is transitional
require 'vendor/homebrew-fork/testing_env'

# todo temporary, copied from old Homebrew, this method is now moved inside a class
def shutup
Expand Down

0 comments on commit 36b8903

Please sign in to comment.