Class: PackerFiles::CLI::OS

Inherits:
Thor
  • Object
show all
Defined in:
lib/PackerFiles/CLI/OS.rb

Instance Method Summary collapse

Instance Method Details

#initObject



32
33
34
35
36
37
38
39
# File 'lib/PackerFiles/CLI/OS.rb', line 32

def init
   klass = Finder.new.class_name(options[:name])
   if (File.exist?(options[:file]) && !options[:force])
      $stderr.puts "Cannot overwrite #{options[:file]} w/o --force"
      return 1
   end
   DocGenerator.new(klass, options[:file]).Generate
end

#listObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/PackerFiles/CLI/OS.rb', line 13

def list
  Finder.new.class_names.each do |cl|
     name = cl.name.gsub('PackerFiles::','')
     if cl.versions.empty?
 versions = 'Any'
     else
 versions = cl.versions.to_s
     end
     puts "#{name} => #{versions}"
  end
end