Class: Bundler::RubygemsIntegration::Future
Overview
Constant Summary
EXT_LOCK
Instance Method Summary
collapse
#backport_base_dir, #backport_cache_file, #backport_segment_generation, #backport_spec_file, #backport_yaml_initialize, #bin_path, #binstubs_call_gem?, #build_args, #build_args=, #build_gem, #clear_paths, #config_map, #configuration, #ext_lock, #fetch_prerelease_specs, #gem_bindir, #gem_cache, #gem_dir, #gem_path, #inflate, #initialize, #load_path_insert_index, #load_plugin_files, #load_plugins, #loaded_gem_paths, #loaded_specs, #mark_loaded, #marshal_spec_dir, #method_visibility, #path, #platforms, #post_reset_hooks, #preserve_paths, provides?, #provides?, #read_binary, #redefine_method, #replace_bin_path, #replace_entrypoints, #replace_gem, #replace_refresh, #reset, #reverse_rubygems_kernel_mixin, #ruby_engine, #security_policies, #security_policy_keys, #set_installed_by_version, #sources, #sources=, #spec_cache_dirs, #spec_default_gem?, #spec_extension_dir, #spec_from_gem, #spec_matches_for_glob, #spec_missing_extensions?, #stub_set_spec, #stub_source_index, #stubs_provide_full_functionality?, #suffix_pattern, #ui=, #undo_replacements, #user_home, #validate, #version, version, #with_build_args
Instance Method Details
#all_specs ⇒ Object
739
740
741
|
# File 'lib/bundler/rubygems_integration.rb', line 739
def all_specs
Gem::Specification.to_a
end
|
#build(spec, skip_validation = false) ⇒ Object
790
791
792
793
|
# File 'lib/bundler/rubygems_integration.rb', line 790
def build(spec, skip_validation = false)
require "rubygems/package"
Gem::Package.build(spec, skip_validation)
end
|
#download_gem(spec, uri, path) ⇒ Object
767
768
769
770
771
772
773
774
|
# File 'lib/bundler/rubygems_integration.rb', line 767
def download_gem(spec, uri, path)
uri = Bundler.settings.mirror_for(uri)
fetcher = gem_remote_fetcher
fetcher. = { "X-Gemfile-Source" => spec.remote.original_uri.to_s } if spec.remote.original_uri
Bundler::Retry.new("download gem from #{uri}").attempts do
fetcher.download(spec, uri, path)
end
end
|
#fetch_all_remote_specs(remote) ⇒ Object
758
759
760
761
762
763
764
765
|
# File 'lib/bundler/rubygems_integration.rb', line 758
def fetch_all_remote_specs(remote)
source = remote.uri.is_a?(URI) ? remote.uri : URI.parse(source.to_s)
specs = fetch_specs(source, remote, "specs")
pres = fetch_specs(source, remote, "prerelease_specs") || []
specs.concat(pres)
end
|
#fetch_specs(source, remote, name) ⇒ Object
747
748
749
750
751
752
753
754
755
756
|
# File 'lib/bundler/rubygems_integration.rb', line 747
def fetch_specs(source, remote, name)
path = source + "#{name}.#{Gem.marshal_version}.gz"
fetcher = gem_remote_fetcher
fetcher. = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
string = fetcher.fetch_path(path)
Bundler.load_marshal(string)
rescue Gem::RemoteFetcher::FetchError => e
raise e unless name == "prerelease_specs"
end
|
#find_name(name) ⇒ Object
743
744
745
|
# File 'lib/bundler/rubygems_integration.rb', line 743
def find_name(name)
Gem::Specification.find_all_by_name name
end
|
#gem_from_path(path, policy = nil) ⇒ Object
783
784
785
786
787
788
|
# File 'lib/bundler/rubygems_integration.rb', line 783
def gem_from_path(path, policy = nil)
require "rubygems/package"
p = Gem::Package.new(path)
p.security_policy = policy if policy
p
end
|
#gem_remote_fetcher ⇒ Object
776
777
778
779
780
781
|
# File 'lib/bundler/rubygems_integration.rb', line 776
def gem_remote_fetcher
require "resolv"
proxy = configuration[:http_proxy]
dns = Resolv::DNS.new
Bundler::GemRemoteFetcher.new(proxy, dns)
end
|
#install_with_build_args(args) ⇒ Object
799
800
801
|
# File 'lib/bundler/rubygems_integration.rb', line 799
def install_with_build_args(args)
yield
end
|
#path_separator ⇒ Object
803
804
805
|
# File 'lib/bundler/rubygems_integration.rb', line 803
def path_separator
Gem.path_separator
end
|
#repository_subdirectories ⇒ Object
795
796
797
|
# File 'lib/bundler/rubygems_integration.rb', line 795
def repository_subdirectories
Gem::REPOSITORY_SUBDIRECTORIES
end
|
#stub_rubygems(specs) ⇒ Object
727
728
729
730
731
732
733
734
735
736
737
|
# File 'lib/bundler/rubygems_integration.rb', line 727
def stub_rubygems(specs)
Gem::Specification.all = specs
Gem.post_reset do
Gem::Specification.all = specs
end
redefine_method((class << Gem; self; end), :finish_resolve) do |*|
[]
end
end
|