summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-06-24 14:52:44 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-06-24 14:52:44 -0500
commitb7086cc8ab332781c49b13414cde5b833d534f04 (patch)
tree99e3fefd4eb94a8cbe0a3dc7ba53f0a7f0ca4e43 /lib/bundler
parentdca6d26833ddd9d9de658bef7274c8fa21014c44 (diff)
downloadbundler-seg-postit-trampoline-load-path.tar.gz
[Trampoline] Dont change the load path just for postitseg-postit-trampoline-load-path
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/postit_trampoline.rb11
-rw-r--r--lib/bundler/vendor/postit/lib/postit.rb10
-rw-r--r--lib/bundler/vendor/postit/lib/postit/environment.rb6
-rw-r--r--lib/bundler/vendor/postit/lib/postit/installer.rb2
-rw-r--r--lib/bundler/vendor/postit/lib/postit/parser.rb2
-rw-r--r--lib/bundler/vendor/postit/lib/postit/setup.rb8
-rw-r--r--lib/bundler/vendor/postit/lib/postit/version.rb4
7 files changed, 20 insertions, 23 deletions
diff --git a/lib/bundler/postit_trampoline.rb b/lib/bundler/postit_trampoline.rb
index 50bfee66a5..2080b1dfcc 100644
--- a/lib/bundler/postit_trampoline.rb
+++ b/lib/bundler/postit_trampoline.rb
@@ -1,11 +1,10 @@
# frozen_string_literal: true
-postit_lib = File.expand_path("../vendor/postit/lib", __FILE__)
-$:.unshift(postit_lib)
-require "postit"
+module BundlerVendoredPostIt; end
+require "bundler/vendor/postit/lib/postit"
require "rubygems"
-environment = BundlerVendoredPostIt::Environment.new([])
+environment = BundlerVendoredPostIt::PostIt::Environment.new([])
version = Gem::Requirement.new(environment.bundler_version)
installed_version =
@@ -19,7 +18,7 @@ installed_version &&= Gem::Version.new(installed_version)
if !version.satisfied_by?(installed_version)
begin
- installer = BundlerVendoredPostIt::Installer.new(version)
+ installer = BundlerVendoredPostIt::PostIt::Installer.new(version)
installer.install!
rescue => e
abort <<-EOS.strip
@@ -53,5 +52,3 @@ end
if !Gem::Version.correct?(running_version.to_s) || !version.satisfied_by?(Gem::Version.create(running_version))
abort "The running bundler (#{running_version}) does not match the required `#{version}`"
end
-
-$:.delete_at($:.find_index(postit_lib))
diff --git a/lib/bundler/vendor/postit/lib/postit.rb b/lib/bundler/vendor/postit/lib/postit.rb
index 4b3ff34d49..e07dfccac4 100644
--- a/lib/bundler/vendor/postit/lib/postit.rb
+++ b/lib/bundler/vendor/postit/lib/postit.rb
@@ -1,10 +1,10 @@
-require 'postit/environment'
-require 'postit/installer'
-require 'postit/parser'
-require 'postit/version'
+require 'bundler/vendor/postit/lib/postit/environment'
+require 'bundler/vendor/postit/lib/postit/installer'
+require 'bundler/vendor/postit/lib/postit/parser'
+require 'bundler/vendor/postit/lib/postit/version'
require 'rubygems'
-module BundlerVendoredPostIt
+module BundlerVendoredPostIt::PostIt
def self.setup
load File.expand_path('../postit/setup.rb', __FILE__)
end
diff --git a/lib/bundler/vendor/postit/lib/postit/environment.rb b/lib/bundler/vendor/postit/lib/postit/environment.rb
index b758fa0ccb..0c27f2cd69 100644
--- a/lib/bundler/vendor/postit/lib/postit/environment.rb
+++ b/lib/bundler/vendor/postit/lib/postit/environment.rb
@@ -1,6 +1,6 @@
-require 'postit/parser'
+require 'bundler/vendor/postit/lib/postit/parser'
-module BundlerVendoredPostIt
+module BundlerVendoredPostIt::PostIt
class Environment
def initialize(argv)
@argv = argv
@@ -31,7 +31,7 @@ module BundlerVendoredPostIt
end
def lockfile_version
- BundlerVendoredPostIt::Parser.new(lockfile).parse
+ BundlerVendoredPostIt::PostIt::Parser.new(lockfile).parse
end
def bundler_version
diff --git a/lib/bundler/vendor/postit/lib/postit/installer.rb b/lib/bundler/vendor/postit/lib/postit/installer.rb
index 4139038df8..5fa34b6938 100644
--- a/lib/bundler/vendor/postit/lib/postit/installer.rb
+++ b/lib/bundler/vendor/postit/lib/postit/installer.rb
@@ -1,4 +1,4 @@
-module BundlerVendoredPostIt
+module BundlerVendoredPostIt::PostIt
class Installer
def initialize(bundler_version)
@bundler_version = bundler_version
diff --git a/lib/bundler/vendor/postit/lib/postit/parser.rb b/lib/bundler/vendor/postit/lib/postit/parser.rb
index 98c4a3578f..7b2eb72ff1 100644
--- a/lib/bundler/vendor/postit/lib/postit/parser.rb
+++ b/lib/bundler/vendor/postit/lib/postit/parser.rb
@@ -1,6 +1,6 @@
require 'rubygems'
-module BundlerVendoredPostIt
+module BundlerVendoredPostIt::PostIt
class Parser
def initialize(file)
@file = file
diff --git a/lib/bundler/vendor/postit/lib/postit/setup.rb b/lib/bundler/vendor/postit/lib/postit/setup.rb
index 260edd559d..2580e7b7b8 100644
--- a/lib/bundler/vendor/postit/lib/postit/setup.rb
+++ b/lib/bundler/vendor/postit/lib/postit/setup.rb
@@ -1,10 +1,10 @@
-require 'postit/environment'
-require 'postit/installer'
+require 'bundler/vendor/postit/lib/postit/environment'
+require 'bundler/vendor/postit/lib/postit/installer'
-environment = BundlerVendoredPostIt::Environment.new(ARGV)
+environment = BundlerVendoredPostIt::PostIt::Environment.new(ARGV)
version = environment.bundler_version
-installer = BundlerVendoredPostIt::Installer.new(version)
+installer = BundlerVendoredPostIt::PostIt::Installer.new(version)
installer.install!
gem 'bundler', version
diff --git a/lib/bundler/vendor/postit/lib/postit/version.rb b/lib/bundler/vendor/postit/lib/postit/version.rb
index 1a16501024..b54175254d 100644
--- a/lib/bundler/vendor/postit/lib/postit/version.rb
+++ b/lib/bundler/vendor/postit/lib/postit/version.rb
@@ -1,3 +1,3 @@
-module BundlerVendoredPostIt
- VERSION = '0.1.2'.freeze
+module BundlerVendoredPostIt::PostIt
+ VERSION = '0.2.0'.freeze
end