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
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/iesd/utility/pkgutil.rb', line 2 def self.read input Dir.mktmpdir { |tmp| tmp = File.join tmp, File.basename(input) input, tmp if block_given? yield tmp else shell tmp end } end |
.write(input, output = input) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/iesd/utility/pkgutil.rb', line 14 def self.write input, output = input Dir.mktmpdir { |tmp| tmp = File.join tmp, File.basename(input) input, tmp if block_given? yield tmp else shell tmp end flatten tmp, output } end |