Skip to content

Commit

Permalink
Merge pull request #4895 from MikeMcQuaid/vendor-bundle-standalone
Browse files Browse the repository at this point in the history
Use Bundler to manage vendor directory
  • Loading branch information
MikeMcQuaid authored Sep 14, 2018
2 parents 1b45666 + d7eca0b commit 5772493
Show file tree
Hide file tree
Showing 26 changed files with 53 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
**/.bundle/cache
**/vendor/bundle
**/vendor/ruby
**/vendor/bundle-standalone/ruby/*/cache
**/vendor/bundle-standalone/ruby/*/gems/*/*
**/vendor/bundle-standalone/ruby/*/specifications

# Unignore vendored gems
!**/vendor/bundle-standalone/ruby/*/gems/*/lib

# Ignore backports gem (we don't need all files)
**/vendor/bundle-standalone/ruby/*/gems/backports-*/lib

# Ignore `bin` contents (again).
/bin
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/artifact/pkg.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "vendor/plist/plist"
require "plist"

require "cask/artifact/abstract_artifact"

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/string.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contains backports from newer versions of Ruby
require_relative "../vendor/backports/string"
require "backports/2.4.0/string/match"

class String
# String.chomp, but if result is empty: returns nil instead.
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/load_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
unless $LOAD_PATH.include?(HOMEBREW_LIBRARY_PATH.to_s)
$LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.to_s)
end

require "vendor/bundle-standalone/bundler/setup"
2 changes: 1 addition & 1 deletion Library/Homebrew/os/mac/mach.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "vendor/macho/macho"
require "macho"
require "os/mac/architecture_list"

module MachOShim
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/system_command.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "open3"
require "ostruct"
require "vendor/plist/plist"
require "plist"
require "shellwords"

require "extend/io"
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/vendor/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
BUNDLE_PATH: "bundle-standalone"
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_BIN: "false"
5 changes: 5 additions & 0 deletions Library/Homebrew/vendor/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem "backports"
gem "plist"
gem "ruby-macho"
17 changes: 17 additions & 0 deletions Library/Homebrew/vendor/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
GEM
remote: https://rubygems.org/
specs:
backports (3.8.0)
plist (3.3.0)
ruby-macho (2.0.0)

PLATFORMS
ruby

DEPENDENCIES
backports
plist
ruby-macho

BUNDLED WITH
1.16.4
9 changes: 9 additions & 0 deletions Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'rbconfig'
# ruby 1.8.7 doesn't define RUBY_ENGINE
ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
ruby_version = RbConfig::CONFIG["ruby_version"]
path = File.expand_path('..', __FILE__)
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/backports-3.8.0/lib"
$:.unshift "#{path}/"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/plist-3.3.0/lib"
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-2.0.0/lib"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Taken from https://github.com/marcandre/backports/blob/v3.8.0/lib/backports/2.4.0/string/match.rb
unless String.method_defined? :match?
class String
def match?(*args)
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/vendor/plist/plist.rb → .../ruby/2.3.0/gems/plist-3.3.0/lib/plist.rb
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
require 'cgi'
require 'stringio'

require_relative 'plist/generator'
require_relative 'plist/parser'
require_relative 'plist/version'
require 'plist/generator'
require 'plist/parser'
require 'plist/version'

module Plist
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5772493

Please sign in to comment.