Class: Nake::Rule
- Inherits:
-
AbstractTask
- Object
- AbstractTask
- Nake::Rule
- Defined in:
- lib/nake/rule.rb
Instance Attribute Summary
Attributes inherited from AbstractTask
#blocks, #config, #dependencies, #description, #hidden, #name, #original_args
Class Method Summary collapse
-
.[](file) ⇒ Object
Rule # => rule with pattern “.o”.
- .[]=(pattern, rule) ⇒ Object
- .rules ⇒ Object
Instance Method Summary collapse
Methods inherited from AbstractTask
#boot, boot, #boot!, #boot_dependencies, #booted?, #bootloaders, #call, #define, #hidden?, #initialize, new, #reset!, #run, #setup, tasks
Constructor Details
This class inherits a constructor from Nake::AbstractTask
Class Method Details
.[](file) ⇒ Object
Rule # => rule with pattern “.o”
18 19 20 |
# File 'lib/nake/rule.rb', line 18 def self.[](file) self.rules.find { |rule| rule.match?(file.to_s) } end |
.[]=(pattern, rule) ⇒ Object
22 23 24 |
# File 'lib/nake/rule.rb', line 22 def self.[]=(pattern, rule) self.rules[pattern.to_s] = rule end |
.rules ⇒ Object
12 13 14 |
# File 'lib/nake/rule.rb', line 12 def self.rules @@rules ||= Hash.new end |
Instance Method Details
#match?(file) ⇒ Boolean
27 28 29 |
# File 'lib/nake/rule.rb', line 27 def match?(file) # end |