Class: JarTools::Diff::ExtractedFile
- Inherits:
-
UniformFile
- Object
- UniformFile
- JarTools::Diff::ExtractedFile
- Defined in:
- lib/jartools/diff.rb
Instance Attribute Summary collapse
-
#entry_path ⇒ Object
readonly
Returns the value of attribute entry_path.
Instance Method Summary collapse
-
#initialize(zip_entry) ⇒ ExtractedFile
constructor
A new instance of ExtractedFile.
- #readable_filename ⇒ Object
Methods inherited from UniformFile
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_path ⇒ Object (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_filename ⇒ Object
173 174 175 |
# File 'lib/jartools/diff.rb', line 173 def readable_filename @temp_file.path end |