123456789_123456789_123456789_123456789_123456789_

Class: Gem::Installer::FakePackage

Relationships & Source Files
Inherits: Object
Defined in: lib/rubygems/installer.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(spec) ⇒ FakePackage

[ GitHub ]

  
# File 'lib/rubygems/installer.rb', line 124

def initialize(spec)
  @spec = spec
end

Instance Attribute Details

#data_mode (rw)

[ GitHub ]

  
# File 'lib/rubygems/installer.rb', line 122

attr_accessor :data_mode

#dir_mode (rw)

[ GitHub ]

  
# File 'lib/rubygems/installer.rb', line 120

attr_accessor :dir_mode

#prog_mode (rw)

[ GitHub ]

  
# File 'lib/rubygems/installer.rb', line 121

attr_accessor :prog_mode

#spec (rw)

[ GitHub ]

  
# File 'lib/rubygems/installer.rb', line 118

attr_accessor :spec

Instance Method Details

#copy_to(path)

[ GitHub ]

  
# File 'lib/rubygems/installer.rb', line 141

def copy_to(path)
end

#extract_files(destination_dir, pattern = '*')

[ GitHub ]

  
# File 'lib/rubygems/installer.rb', line 128

def extract_files(destination_dir, pattern = '*')
  FileUtils.mkdir_p destination_dir

  spec.files.each do |file|
    file = File.join destination_dir, file
    next if File.exist? file
    FileUtils.mkdir_p File.dirname(file)
    File.open file, 'w' do |fp|
      fp.puts "# #{file}"
    end
  end
end