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.
17 18 19 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 17 def cleanfiles @cleanfiles end |
.distcleanfiles ⇒ Array<String> (readonly)
Returns The files to clean when running the “distclean”task.
21 22 23 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 21 def distcleanfiles @distcleanfiles end |
.inventory ⇒ Inventory
Returns The default inventory to use for tasks.
10 11 12 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 10 def inventory @inventory end |
.mostlycleanfiles ⇒ Array<String> (readonly)
Returns The files to clean when running the “mostlyclean”task.
14 15 16 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 14 def mostlycleanfiles @mostlycleanfiles end |
Class Method Details
.define(inventory, options = {}) ⇒ self
34 35 36 37 38 39 40 41 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 34 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.
54 55 56 57 58 59 60 61 |
# File 'lib/inventory-rake-1.0/tasks.rb', line 54 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 |