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
295 296 297 298 299 |
# File 'lib/buildr/packaging/ziptask.rb', line 295 def exclude(*files) #:doc: @exclude ||= [] @exclude |= files self end |
#include(*files) ⇒ Object
See UnzipTask#include
288 289 290 291 292 |
# File 'lib/buildr/packaging/ziptask.rb', line 288 def include(*files) #:doc: @include ||= [] @include |= files self end |
#map(entries) ⇒ Object
301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/buildr/packaging/ziptask.rb', line 301 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.
317 318 319 |
# File 'lib/buildr/packaging/ziptask.rb', line 317 def root @unzip end |
#target ⇒ Object
The target directory to extract to.
322 323 324 |
# File 'lib/buildr/packaging/ziptask.rb', line 322 def target @unzip.target end |