Module: DotUsage

Defined in:
lib/dot_usage.rb,
lib/dot_usage/version.rb

Defined Under Namespace

Classes: Command, DotUsageFile, Target

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.list_targets(options) ⇒ Object

List targets



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/dot_usage.rb', line 118

def self.list_targets(options)
  file = DotUsageFile.new options.file

  puts "Available targets:"
  file.targets.each do |target|
    puts " - #{target}"

    if options.verbose
      Target.new(target).recipe(options).each do |cmd|
        puts "     `#{cmd}`"
      end
    end
  end

  0
end

.run_target(target, options) ⇒ Object

Run a given target



138
139
140
141
142
# File 'lib/dot_usage.rb', line 138

def self.run_target(target, options)
  target = Target.new target

  target.run options
end