Class: Gem::Installer::FakePackage

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygems/installer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ FakePackage

Returns a new instance of FakePackage.



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

def initialize(spec)
  @spec = spec
end

Instance Attribute Details

#data_modeObject

Returns the value of attribute data_mode.



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

def data_mode
  @data_mode
end

#dir_modeObject

Returns the value of attribute dir_mode.



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

def dir_mode
  @dir_mode
end

#prog_modeObject

Returns the value of attribute prog_mode.



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

def prog_mode
  @prog_mode
end

#specObject

Returns the value of attribute spec.



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

def spec
  @spec
end

Instance Method Details

#copy_to(path) ⇒ Object



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

def copy_to(path)
end

#extract_files(destination_dir, pattern = '*') ⇒ Object



128
129
130
131
132
133
134
135
136
137
138
139
# 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