Module: Inventory::Rake::Tasks
- Defined in:
- lib/inventory-rake-1.0/tasks.rb
Overview
Namespace for Rake tasks using an Inventory.
Defined Under Namespace
Classes: Clean, Compile, Gem, Inventory
Class Attribute Summary collapse
-
.cleanfiles ⇒ Array<String>
readonly
The files to clean when running the “clean” task.
-
.distcleanfiles ⇒ Array<String>
readonly
The files to clean when running the “distclean” task.
-
.inventory ⇒ Inventory
The default inventory to use for tasks.
-
.mostlycleanfiles ⇒ Array<String>
readonly
The files to clean when running the “mostlyclean” task.
Class Method Summary collapse
-
.define(inventory, options = {}) ⇒ self
Sets the default Tasks.inventory to INVENTORY, then defines Clean, Compile, Inventory, and Gem tasks.
-
.unless_installing_dependencies {|?| ... } ⇒ self
Yields if the top-level tasks that Rake’s running don’t include any of.
Class Attribute Details
.cleanfiles ⇒ Array<String> (readonly)
Returns The files to clean when running the “clean” task.
16 17 18 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 16 def cleanfiles @cleanfiles end |
.distcleanfiles ⇒ Array<String> (readonly)
Returns The files to clean when running the “distclean” task.
20 21 22 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 20 def distcleanfiles @distcleanfiles end |
.inventory ⇒ Inventory
Returns The default inventory to use for tasks.
9 10 11 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 9 def inventory @inventory end |
.mostlycleanfiles ⇒ Array<String> (readonly)
Returns The files to clean when running the “mostlyclean” task.
13 14 15 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 13 def mostlycleanfiles @mostlycleanfiles end |
Class Method Details
.define(inventory, options = {}) ⇒ self
33 34 35 36 37 38 39 40 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 33 def define(inventory, = {}) self.inventory = inventory Clean.define Compile.new :inventory => inventory Inventory.new :inventory => inventory Gem.new(:inventory => inventory, &.fetch(:gem, proc{})) self end |
.unless_installing_dependencies {|?| ... } ⇒ self
Yields if the top-level tasks that Rake’s running don’t include any of
- deps:install
- deps:install:user
- gem:deps:install
- gem:deps:install:user
that is, Rake’s not being run to install the inventory’s dependencies.
53 54 55 56 57 58 59 60 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 53 def unless_installing_dependencies yield if (%w'deps:install deps:install:user gem:deps:install gem:deps:install:user' & Rake.application.top_level_tasks).empty? self end |