summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-08 21:33:18 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-12 09:25:06 -0400
commitd23a352afa73a587e9960c1d4f438c56432748ed (patch)
treeaed60bab38f2fbe51c6429a11c272da0ed28a3e5
parenta5da088a6d8aa2bb14d5007dc7f70b25a50d79d7 (diff)
downloadbundler-d23a352afa73a587e9960c1d4f438c56432748ed.tar.gz
Migrate internal autoloads to not use LOAD_PATH
-rw-r--r--lib/bundler.rb74
-rw-r--r--lib/bundler/fetcher.rb8
-rw-r--r--lib/bundler/fetcher/compact_index.rb2
-rw-r--r--lib/bundler/plugin/api.rb2
-rw-r--r--lib/bundler/plugin/installer.rb4
-rw-r--r--lib/bundler/settings.rb6
-rw-r--r--lib/bundler/source.rb10
-rw-r--r--lib/bundler/source/git.rb2
-rw-r--r--lib/bundler/source/path.rb2
-rw-r--r--lib/bundler/source/rubygems.rb2
-rw-r--r--lib/bundler/ui.rb6
11 files changed, 59 insertions, 59 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 8ad5ab6634..d8f9462c6d 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -22,43 +22,43 @@ module Bundler
ENV.replace(environment_preserver.backup)
SUDO_MUTEX = Mutex.new
- autoload :Definition, "bundler/definition"
- autoload :Dependency, "bundler/dependency"
- autoload :DepProxy, "bundler/dep_proxy"
- autoload :Deprecate, "bundler/deprecate"
- autoload :Dsl, "bundler/dsl"
- autoload :EndpointSpecification, "bundler/endpoint_specification"
- autoload :Env, "bundler/env"
- autoload :Fetcher, "bundler/fetcher"
- autoload :FeatureFlag, "bundler/feature_flag"
- autoload :GemHelper, "bundler/gem_helper"
- autoload :GemHelpers, "bundler/gem_helpers"
- autoload :GemRemoteFetcher, "bundler/gem_remote_fetcher"
- autoload :GemVersionPromoter, "bundler/gem_version_promoter"
- autoload :Graph, "bundler/graph"
- autoload :Index, "bundler/index"
- autoload :Injector, "bundler/injector"
- autoload :Installer, "bundler/installer"
- autoload :LazySpecification, "bundler/lazy_specification"
- autoload :LockfileParser, "bundler/lockfile_parser"
- autoload :MatchPlatform, "bundler/match_platform"
- autoload :ProcessLock, "bundler/process_lock"
- autoload :RemoteSpecification, "bundler/remote_specification"
- autoload :Resolver, "bundler/resolver"
- autoload :Retry, "bundler/retry"
- autoload :RubyDsl, "bundler/ruby_dsl"
- autoload :RubyGemsGemInstaller, "bundler/rubygems_gem_installer"
- autoload :RubyVersion, "bundler/ruby_version"
- autoload :Runtime, "bundler/runtime"
- autoload :Settings, "bundler/settings"
- autoload :SharedHelpers, "bundler/shared_helpers"
- autoload :Source, "bundler/source"
- autoload :SourceList, "bundler/source_list"
- autoload :SpecSet, "bundler/spec_set"
- autoload :StubSpecification, "bundler/stub_specification"
- autoload :UI, "bundler/ui"
- autoload :URICredentialsFilter, "bundler/uri_credentials_filter"
- autoload :VersionRanges, "bundler/version_ranges"
+ autoload :Definition, File.expand_path("bundler/definition", __dir__)
+ autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
+ autoload :DepProxy, File.expand_path("bundler/dep_proxy", __dir__)
+ autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
+ autoload :Dsl, File.expand_path("bundler/dsl", __dir__)
+ autoload :EndpointSpecification, File.expand_path("bundler/endpoint_specification", __dir__)
+ autoload :Env, File.expand_path("bundler/env", __dir__)
+ autoload :Fetcher, File.expand_path("bundler/fetcher", __dir__)
+ autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
+ autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
+ autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
+ autoload :GemRemoteFetcher, File.expand_path("bundler/gem_remote_fetcher", __dir__)
+ autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
+ autoload :Graph, File.expand_path("bundler/graph", __dir__)
+ autoload :Index, File.expand_path("bundler/index", __dir__)
+ autoload :Injector, File.expand_path("bundler/injector", __dir__)
+ autoload :Installer, File.expand_path("bundler/installer", __dir__)
+ autoload :LazySpecification, File.expand_path("bundler/lazy_specification", __dir__)
+ autoload :LockfileParser, File.expand_path("bundler/lockfile_parser", __dir__)
+ autoload :MatchPlatform, File.expand_path("bundler/match_platform", __dir__)
+ autoload :ProcessLock, File.expand_path("bundler/process_lock", __dir__)
+ autoload :RemoteSpecification, File.expand_path("bundler/remote_specification", __dir__)
+ autoload :Resolver, File.expand_path("bundler/resolver", __dir__)
+ autoload :Retry, File.expand_path("bundler/retry", __dir__)
+ autoload :RubyDsl, File.expand_path("bundler/ruby_dsl", __dir__)
+ autoload :RubyGemsGemInstaller, File.expand_path("bundler/rubygems_gem_installer", __dir__)
+ autoload :RubyVersion, File.expand_path("bundler/ruby_version", __dir__)
+ autoload :Runtime, File.expand_path("bundler/runtime", __dir__)
+ autoload :Settings, File.expand_path("bundler/settings", __dir__)
+ autoload :SharedHelpers, File.expand_path("bundler/shared_helpers", __dir__)
+ autoload :Source, File.expand_path("bundler/source", __dir__)
+ autoload :SourceList, File.expand_path("bundler/source_list", __dir__)
+ autoload :SpecSet, File.expand_path("bundler/spec_set", __dir__)
+ autoload :StubSpecification, File.expand_path("bundler/stub_specification", __dir__)
+ autoload :UI, File.expand_path("bundler/ui", __dir__)
+ autoload :URICredentialsFilter, File.expand_path("bundler/uri_credentials_filter", __dir__)
+ autoload :VersionRanges, File.expand_path("bundler/version_ranges", __dir__)
class << self
def configure
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 7ec41d62c0..d21baf659d 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -9,10 +9,10 @@ require "rubygems/request"
module Bundler
# Handles all the fetching with the rubygems server
class Fetcher
- autoload :CompactIndex, "bundler/fetcher/compact_index"
- autoload :Downloader, "bundler/fetcher/downloader"
- autoload :Dependency, "bundler/fetcher/dependency"
- autoload :Index, "bundler/fetcher/index"
+ autoload :CompactIndex, File.expand_path("fetcher/compact_index", __dir__)
+ autoload :Downloader, File.expand_path("fetcher/downloader", __dir__)
+ autoload :Dependency, File.expand_path("fetcher/dependency", __dir__)
+ autoload :Index, File.expand_path("fetcher/index", __dir__)
# This error is raised when it looks like the network is down
class NetworkDownError < HTTPError; end
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb
index 1efd3e03af..f36d76d4ae 100644
--- a/lib/bundler/fetcher/compact_index.rb
+++ b/lib/bundler/fetcher/compact_index.rb
@@ -4,7 +4,7 @@ require_relative "base"
require_relative "../worker"
module Bundler
- autoload :CompactIndexClient, "bundler/compact_index_client"
+ autoload :CompactIndexClient, File.expand_path("../compact_index_client", __dir__)
class Fetcher
class CompactIndex < Base
diff --git a/lib/bundler/plugin/api.rb b/lib/bundler/plugin/api.rb
index a2d5cbb4ac..ee2bffe3ab 100644
--- a/lib/bundler/plugin/api.rb
+++ b/lib/bundler/plugin/api.rb
@@ -23,7 +23,7 @@ module Bundler
# and hooks).
module Plugin
class API
- autoload :Source, "bundler/plugin/api/source"
+ autoload :Source, File.expand_path("api/source", __dir__)
# The plugins should declare that they handle a command through this helper.
#
diff --git a/lib/bundler/plugin/installer.rb b/lib/bundler/plugin/installer.rb
index 4a262efac2..bcea3f0e45 100644
--- a/lib/bundler/plugin/installer.rb
+++ b/lib/bundler/plugin/installer.rb
@@ -8,8 +8,8 @@ module Bundler
# are heavily dependent on the Gemfile.
module Plugin
class Installer
- autoload :Rubygems, "bundler/plugin/installer/rubygems"
- autoload :Git, "bundler/plugin/installer/git"
+ autoload :Rubygems, File.expand_path("installer/rubygems", __dir__)
+ autoload :Git, File.expand_path("installer/git", __dir__)
def install(names, options)
check_sources_consistency!(options)
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 6cc25bc998..6d63745ae6 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -4,9 +4,9 @@ require "uri"
module Bundler
class Settings
- autoload :Mirror, "bundler/mirror"
- autoload :Mirrors, "bundler/mirror"
- autoload :Validator, "bundler/settings/validator"
+ autoload :Mirror, File.expand_path("mirror", __dir__)
+ autoload :Mirrors, File.expand_path("mirror", __dir__)
+ autoload :Validator, File.expand_path("settings/validator", __dir__)
BOOL_KEYS = %w[
allow_bundler_dependency_conflicts
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index 26a3625bb1..4b2e305bda 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -2,11 +2,11 @@
module Bundler
class Source
- autoload :Gemspec, "bundler/source/gemspec"
- autoload :Git, "bundler/source/git"
- autoload :Metadata, "bundler/source/metadata"
- autoload :Path, "bundler/source/path"
- autoload :Rubygems, "bundler/source/rubygems"
+ autoload :Gemspec, File.expand_path("source/gemspec", __dir__)
+ autoload :Git, File.expand_path("source/git", __dir__)
+ autoload :Metadata, File.expand_path("source/metadata", __dir__)
+ autoload :Path, File.expand_path("source/path", __dir__)
+ autoload :Rubygems, File.expand_path("source/rubygems", __dir__)
attr_accessor :dependency_names
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index aa24a87ed7..ed16f4a4e0 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -6,7 +6,7 @@ require "uri"
module Bundler
class Source
class Git < Path
- autoload :GitProxy, "bundler/source/git/git_proxy"
+ autoload :GitProxy, File.expand_path("git/git_proxy", __dir__)
attr_reader :uri, :ref, :branch, :options, :submodules
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 5f3f1bc2e4..c1d25fc4da 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -3,7 +3,7 @@
module Bundler
class Source
class Path < Source
- autoload :Installer, "bundler/source/path/installer"
+ autoload :Installer, File.expand_path("path/installer", __dir__)
attr_reader :path, :options, :root_path, :original_path
attr_writer :name
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 86fd329089..103faa6b80 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -6,7 +6,7 @@ require "rubygems/user_interaction"
module Bundler
class Source
class Rubygems < Source
- autoload :Remote, "bundler/source/rubygems/remote"
+ autoload :Remote, File.expand_path("rubygems/remote", __dir__)
# Use the API when installing less than X gems
API_REQUEST_LIMIT = 500
diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb
index 8138b30d38..7a4fa03669 100644
--- a/lib/bundler/ui.rb
+++ b/lib/bundler/ui.rb
@@ -2,8 +2,8 @@
module Bundler
module UI
- autoload :RGProxy, "bundler/ui/rg_proxy"
- autoload :Shell, "bundler/ui/shell"
- autoload :Silent, "bundler/ui/silent"
+ autoload :RGProxy, File.expand_path("ui/rg_proxy", __dir__)
+ autoload :Shell, File.expand_path("ui/shell", __dir__)
+ autoload :Silent, File.expand_path("ui/silent", __dir__)
end
end