Class: PrePackager::Package
- Inherits:
-
Object
- Object
- PrePackager::Package
- Includes:
- Executor
- Defined in:
- lib/pre-packager.rb
Defined Under Namespace
Classes: Context
Constant Summary collapse
Instance Method Summary collapse
- #extract(target, opts) {|Content.new ctx| ... } ⇒ Object
-
#initialize(path, interpolator = Interpolator.new) ⇒ Package
constructor
A new instance of Package.
Methods included from Executor
Constructor Details
#initialize(path, interpolator = Interpolator.new) ⇒ Package
Returns a new instance of Package.
69 70 71 72 |
# File 'lib/pre-packager.rb', line 69 def initialize path, interpolator=Interpolator.new @interpolator = interpolator @file = path end |
Instance Method Details
#extract(target, opts) {|Content.new ctx| ... } ⇒ Object
90 91 92 93 94 95 96 97 98 |
# File 'lib/pre-packager.rb', line 90 def extract target, opts ctx = Context.new target, @interpolator, opts strip = opts[:strip] || 0 FileUtils.mkdir_p ctx.local_base execute "tar -xf #{@file} -C #{ctx.local_base} --strip #{strip}" yield Content.new ctx end |