diff --git a/.gitignore b/.gitignore index 96ec003b86cb2..df5ca018c167e 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Library/Homebrew/cask/artifact/pkg.rb b/Library/Homebrew/cask/artifact/pkg.rb index 45e3bba1287f9..bade72ab9fa18 100644 --- a/Library/Homebrew/cask/artifact/pkg.rb +++ b/Library/Homebrew/cask/artifact/pkg.rb @@ -1,4 +1,4 @@ -require "vendor/plist/plist" +require "plist" require "cask/artifact/abstract_artifact" diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb index c94bfc83459be..54c16633076a5 100644 --- a/Library/Homebrew/extend/string.rb +++ b/Library/Homebrew/extend/string.rb @@ -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. diff --git a/Library/Homebrew/load_path.rb b/Library/Homebrew/load_path.rb index bab8941a97ab2..678263d3224e7 100644 --- a/Library/Homebrew/load_path.rb +++ b/Library/Homebrew/load_path.rb @@ -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" diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index 7ec65439db5ba..0ab7a0d3a7caa 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -1,4 +1,4 @@ -require "vendor/macho/macho" +require "macho" require "os/mac/architecture_list" module MachOShim diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index 571b3540be847..c1614cc95d70e 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -1,6 +1,6 @@ require "open3" require "ostruct" -require "vendor/plist/plist" +require "plist" require "shellwords" require "extend/io" diff --git a/Library/Homebrew/vendor/.bundle/config b/Library/Homebrew/vendor/.bundle/config new file mode 100644 index 0000000000000..9b31762860330 --- /dev/null +++ b/Library/Homebrew/vendor/.bundle/config @@ -0,0 +1,4 @@ +--- +BUNDLE_PATH: "bundle-standalone" +BUNDLE_DISABLE_SHARED_GEMS: "true" +BUNDLE_BIN: "false" diff --git a/Library/Homebrew/vendor/Gemfile b/Library/Homebrew/vendor/Gemfile new file mode 100644 index 0000000000000..70cbcaa2263ed --- /dev/null +++ b/Library/Homebrew/vendor/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "backports" +gem "plist" +gem "ruby-macho" diff --git a/Library/Homebrew/vendor/Gemfile.lock b/Library/Homebrew/vendor/Gemfile.lock new file mode 100644 index 0000000000000..e03f3113bf6d7 --- /dev/null +++ b/Library/Homebrew/vendor/Gemfile.lock @@ -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 diff --git a/Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb b/Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb new file mode 100644 index 0000000000000..34e086a93ca57 --- /dev/null +++ b/Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb @@ -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" diff --git a/Library/Homebrew/vendor/backports/string.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/backports-3.8.0/lib/backports/2.4.0/string/match.rb similarity index 66% rename from Library/Homebrew/vendor/backports/string.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/backports-3.8.0/lib/backports/2.4.0/string/match.rb index 6299a3fb48432..9f9f49dd187ff 100644 --- a/Library/Homebrew/vendor/backports/string.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/backports-3.8.0/lib/backports/2.4.0/string/match.rb @@ -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) diff --git a/Library/Homebrew/vendor/plist/plist.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/plist-3.3.0/lib/plist.rb old mode 100755 new mode 100644 similarity index 74% rename from Library/Homebrew/vendor/plist/plist.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/plist-3.3.0/lib/plist.rb index 82ecb27d28eb9..986dad4617455 --- a/Library/Homebrew/vendor/plist/plist.rb +++ b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/plist-3.3.0/lib/plist.rb @@ -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 diff --git a/Library/Homebrew/vendor/plist/plist/generator.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/plist-3.3.0/lib/plist/generator.rb old mode 100755 new mode 100644 similarity index 100% rename from Library/Homebrew/vendor/plist/plist/generator.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/plist-3.3.0/lib/plist/generator.rb diff --git a/Library/Homebrew/vendor/plist/plist/parser.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/plist-3.3.0/lib/plist/parser.rb similarity index 100% rename from Library/Homebrew/vendor/plist/plist/parser.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/plist-3.3.0/lib/plist/parser.rb diff --git a/Library/Homebrew/vendor/plist/plist/version.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/plist-3.3.0/lib/plist/version.rb old mode 100755 new mode 100644 similarity index 100% rename from Library/Homebrew/vendor/plist/plist/version.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/plist-3.3.0/lib/plist/version.rb diff --git a/Library/Homebrew/vendor/macho/macho.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho.rb diff --git a/Library/Homebrew/vendor/macho/macho/exceptions.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/exceptions.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/exceptions.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/exceptions.rb diff --git a/Library/Homebrew/vendor/macho/macho/fat_file.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/fat_file.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/fat_file.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/fat_file.rb diff --git a/Library/Homebrew/vendor/macho/macho/headers.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/headers.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/headers.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/headers.rb diff --git a/Library/Homebrew/vendor/macho/macho/load_commands.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/load_commands.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/load_commands.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/load_commands.rb diff --git a/Library/Homebrew/vendor/macho/macho/macho_file.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/macho_file.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/macho_file.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/macho_file.rb diff --git a/Library/Homebrew/vendor/macho/macho/sections.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/sections.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/sections.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/sections.rb diff --git a/Library/Homebrew/vendor/macho/macho/structure.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/structure.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/structure.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/structure.rb diff --git a/Library/Homebrew/vendor/macho/macho/tools.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/tools.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/tools.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/tools.rb diff --git a/Library/Homebrew/vendor/macho/macho/utils.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/utils.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/utils.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/utils.rb diff --git a/Library/Homebrew/vendor/macho/macho/view.rb b/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/view.rb similarity index 100% rename from Library/Homebrew/vendor/macho/macho/view.rb rename to Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/ruby-macho-2.0.0/lib/macho/view.rb