Class: DotUsage::Target
- Inherits:
-
Object
- Object
- DotUsage::Target
- Defined in:
- lib/dot_usage.rb
Instance Method Summary collapse
-
#initialize(name) ⇒ Target
constructor
A new instance of Target.
- #recipe(options) ⇒ Object
- #run(options) ⇒ Object
Constructor Details
#initialize(name) ⇒ Target
Returns a new instance of Target.
44 45 46 |
# File 'lib/dot_usage.rb', line 44 def initialize(name) @name = name end |
Instance Method Details
#recipe(options) ⇒ Object
48 49 50 51 52 |
# File 'lib/dot_usage.rb', line 48 def recipe() file = DotUsageFile.new(.file) file.recipe @name end |
#run(options) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/dot_usage.rb', line 54 def run() recipe().each do |cmd| status = Command.new(cmd).run() unless status STDERR.puts '> Command failed. Aborting!' return 1 end end 0 end |