Class: Dmcli::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/dmcli/cli.rb

Overview

CLI Command-line options and commands are set in the CLI class

Instance Method Summary collapse

Instance Method Details

#monstersObject



27
28
29
# File 'lib/dmcli/cli.rb', line 27

def monsters
  puts "Not implemented"
end

#packageObject



34
35
36
37
38
39
40
# File 'lib/dmcli/cli.rb', line 34

def package
  xml = XmlExporter.new
  output = options.output? ? options.output : "output.xml"
  filepath = options.filepath? ? options.filepath : "."

  xml.builder(filepath, output)
end

#spellsObject



15
16
17
18
19
20
21
22
# File 'lib/dmcli/cli.rb', line 15

def spells
  caster = options.caster? ? options.caster : "any"
  level = options.level? ? options.level : "any"
  @filepath = options.filepath? ? options.filepath : "."

  loader = DndDataLoader.new
  puts loader.load_spells(@filepath, "BECMI", caster, level)
end

#versionObject



43
44
45
# File 'lib/dmcli/cli.rb', line 43

def version
  puts "dmcli version #{VERSION}"
end