Class: Buildr::ResourcesTask
- Inherits:
-
Rake::Task
- Object
- Rake::Task
- Buildr::ResourcesTask
- Defined in:
- lib/buildr/core/compile.rb
Overview
The resources task is executed by the compile task to copy resource files over to the target directory. You can enhance this task in the normal way, but mostly you will use the task’s filter.
For example:
resources.filter.using 'Copyright'=>'Acme Inc, 2007'
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the filter used to copy resources over.
Instance Method Summary collapse
-
#exclude(*files) ⇒ Object
:call-seq: exclude(*files) => self.
-
#from(*sources) ⇒ Object
:call-seq: from(*sources) => self.
-
#include(*files) ⇒ Object
:call-seq: include(*files) => self.
-
#initialize(*args) ⇒ ResourcesTask
constructor
:nodoc:.
-
#prerequisites ⇒ Object
:nodoc:.
-
#sources ⇒ Object
Returns the list of source directories (each being a file task).
-
#target ⇒ Object
:call-seq: target => task.
Methods inherited from Rake::Task
#invoke, #invoke_with_call_chain
Constructor Details
#initialize(*args) ⇒ ResourcesTask
:nodoc:
405 406 407 408 409 410 411 412 |
# File 'lib/buildr/core/compile.rb', line 405 def initialize(*args) #:nodoc: super @filter = Buildr::Filter.new @filter.using Buildr.settings.profile['filter'] if Hash === Buildr.settings.profile['filter'] enhance do target.invoke if target end end |
Instance Attribute Details
Instance Method Details
#exclude(*files) ⇒ Object
:call-seq:
exclude(*files) => self
Excludes the specified files in the filter and returns self.
427 428 429 430 |
# File 'lib/buildr/core/compile.rb', line 427 def exclude(*files) filter.exclude *files self end |
#from(*sources) ⇒ Object
:call-seq:
from(*sources) => self
Adds additional directories from which to copy resources.
For example:
resources.from _('src/etc')
439 440 441 442 |
# File 'lib/buildr/core/compile.rb', line 439 def from(*sources) filter.from *sources self end |
#include(*files) ⇒ Object
:call-seq:
include(*files) => self
Includes the specified files in the filter and returns self.
418 419 420 421 |
# File 'lib/buildr/core/compile.rb', line 418 def include(*files) filter.include *files self end |
#prerequisites ⇒ Object
:nodoc:
458 459 460 |
# File 'lib/buildr/core/compile.rb', line 458 def prerequisites #:nodoc: super + filter.sources.flatten end |