Class: Lagunitas::IPA

Inherits:
Object
  • Object
show all
Defined in:
lib/lagunitas.ext.rb,
lib/lagunitas.patch.rb

Instance Method Summary collapse

Instance Method Details

#appObject



34
35
36
# File 'lib/lagunitas.patch.rb', line 34

def app
  @app ||= App.new app_path, root_path
end

#contentsObject



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/lagunitas.patch.rb', line 37

def contents
  @contents ||= begin
    tmp_path = "tmp/lagunitas-#{SecureRandom.hex}"
    Zip::ZipFile.open @path do |zip_file|
      zip_file.each do |f|
        f_path = File.join tmp_path, f.name
        FileUtils.mkdir_p File.dirname f_path
        zip_file.extract f, f_path unless File.file? f_path
      end
    end
    tmp_path
  end
end

#root_pathObject



52
53
54
# File 'lib/lagunitas.ext.rb', line 52

def root_path
  contents
end