Class: JarTools::Diff::ExtractedFile

Inherits:
UniformFile show all
Defined in:
lib/jartools/diff.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from UniformFile

#contents, #sha1

Constructor Details

#initialize(zip_entry) ⇒ ExtractedFile

Returns a new instance of ExtractedFile.



163
164
165
166
167
168
169
170
171
# File 'lib/jartools/diff.rb', line 163

def initialize(zip_entry)
  @entry_path = zip_entry.name
  @temp_file = Tempfile.new(File.basename(@entry_path))
  File.open(@temp_file.path, 'w') do |f|
    zip_entry.get_input_stream do |ze|
      f.write ze.read
    end
  end
end

Instance Attribute Details

#entry_pathObject (readonly)

Returns the value of attribute entry_path.



161
162
163
# File 'lib/jartools/diff.rb', line 161

def entry_path
  @entry_path
end

Instance Method Details

#readable_filenameObject



173
174
175
# File 'lib/jartools/diff.rb', line 173

def readable_filename
  @temp_file.path
end