Class: Bundler::RubygemsIntegration::Legacy

Inherits:
Bundler::RubygemsIntegration show all
Defined in:
lib/bundler/rubygems_integration.rb

Overview

Rubygems 1.4 through 1.6

Direct Known Subclasses

Ancient, Transitional

Constant Summary

Constants inherited from Bundler::RubygemsIntegration

EXT_LOCK

Instance Method Summary collapse

Methods inherited from Bundler::RubygemsIntegration

#backport_base_dir, #backport_cache_file, #backport_segment_generation, #backport_spec_file, #backport_yaml_initialize, #bin_path, #build, #build_args, #build_args=, #build_gem, #clear_paths, #config_map, #configuration, #download_gem, #ext_lock, #fetch_all_remote_specs, #fetch_prerelease_specs, #fetch_specs, #gem_bindir, #gem_cache, #gem_dir, #gem_from_path, #gem_path, #inflate, #load_path_insert_index, #loaded_gem_paths, #loaded_specs, #mark_loaded, #marshal_spec_dir, #method_visibility, #path, #platforms, #preserve_paths, provides?, #provides?, #read_binary, #redefine_method, #replace_bin_path, #replace_entrypoints, #replace_gem, #replace_refresh, #repository_subdirectories, #reverse_rubygems_kernel_mixin, #ruby_engine, #security_policies, #security_policy_keys, #set_installed_by_version, #sources, #sources=, #spec_cache_dirs, #spec_from_gem, #spec_missing_extensions?, #stub_source_index, #ui=, #undo_replacements, #user_home, version, #version, #with_build_args

Constructor Details

#initializeLegacy

Returns a new instance of Legacy



539
540
541
542
543
544
545
# File 'lib/bundler/rubygems_integration.rb', line 539

def initialize
  super
  backport_base_dir
  backport_cache_file
  backport_spec_file
  backport_yaml_initialize
end

Instance Method Details

#all_specsObject



558
559
560
# File 'lib/bundler/rubygems_integration.rb', line 558

def all_specs
  Gem.source_index.gems.values
end

#find_name(name) ⇒ Object



562
563
564
# File 'lib/bundler/rubygems_integration.rb', line 562

def find_name(name)
  Gem.source_index.find_name(name)
end

#post_reset_hooksObject



572
573
574
# File 'lib/bundler/rubygems_integration.rb', line 572

def post_reset_hooks
  []
end

#resetObject



576
577
# File 'lib/bundler/rubygems_integration.rb', line 576

def reset
end

#stub_rubygems(specs) ⇒ Object



547
548
549
550
551
552
553
554
555
556
# File 'lib/bundler/rubygems_integration.rb', line 547

def stub_rubygems(specs)
  # Rubygems versions lower than 1.7 use SourceIndex#from_gems_in
  source_index_class = (class << Gem::SourceIndex; self; end)
  redefine_method(source_index_class, :from_gems_in) do |*args|
    Gem::SourceIndex.new.tap do |source_index|
      source_index.spec_dirs = *args
      source_index.add_specs(*specs)
    end
  end
end

#validate(spec) ⇒ Object



566
567
568
569
570
# File 'lib/bundler/rubygems_integration.rb', line 566

def validate(spec)
  # These versions of RubyGems always validate in "packaging" mode,
  # which is too strict for the kinds of checks we care about. As a
  # result, validation is disabled on versions of RubyGems below 1.7.
end