Class: Buildr::Unzip::FromPath
- Defined in:
- lib/buildr/packaging/ziptask.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#exclude(*files) ⇒ Object
See UnzipTask#exclude.
-
#include(*files) ⇒ Object
See UnzipTask#include.
-
#initialize(unzip, path) ⇒ FromPath
constructor
A new instance of FromPath.
- #map(entries) ⇒ Object
-
#root ⇒ Object
Documented in Unzip.
-
#target ⇒ Object
The target directory to extract to.
Constructor Details
Instance Method Details
#exclude(*files) ⇒ Object
See UnzipTask#exclude
326 327 328 329 330 |
# File 'lib/buildr/packaging/ziptask.rb', line 326 def exclude(*files) #:doc: @exclude ||= [] @exclude |= files self end |
#include(*files) ⇒ Object
See UnzipTask#include
319 320 321 322 323 |
# File 'lib/buildr/packaging/ziptask.rb', line 319 def include(*files) #:doc: @include ||= [] @include |= files self end |
#map(entries) ⇒ Object
332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
# File 'lib/buildr/packaging/ziptask.rb', line 332 def map(entries) includes = @include || ['*'] excludes = @exclude || [] entries.inject({}) do |map, entry| if entry.name =~ /^#{@path}/ short = entry.name.sub(@path, '') if includes.any? { |pat| File.fnmatch(pat, short) } && !excludes.any? { |pat| File.fnmatch(pat, short) } map[short] = entry end end map end end |
#root ⇒ Object
Documented in Unzip.
348 349 350 |
# File 'lib/buildr/packaging/ziptask.rb', line 348 def root @unzip end |
#target ⇒ Object
The target directory to extract to.
353 354 355 |
# File 'lib/buildr/packaging/ziptask.rb', line 353 def target @unzip.target end |