Module: PKGUtil

Defined in:
lib/iesd/utility/pkgutil.rb,
lib/iesd/utility/pkgutil.rb

Defined Under Namespace

Classes: PKG

Class Method Summary collapse

Class Method Details

.read(input) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/iesd/utility/pkgutil.rb', line 5

def self.read input
  Dir.mktmpdir { |tmp|
    tmp = File.join tmp, File.basename(input)
    expand input, tmp
    if block_given?
      yield tmp
    else
      shell tmp
    end
  }
end

.write(input, output = input) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/iesd/utility/pkgutil.rb', line 17

def self.write input, output = input
  Dir.mktmpdir { |tmp|
    tmp = File.join tmp, File.basename(input)
    expand input, tmp
    if block_given?
      yield tmp
    else
      shell tmp
    end
    flatten tmp, output
  }
end