Class: Gamefic::Sdk::Shell

Inherits:
Thor
  • Object
show all
Defined in:
lib/gamefic-sdk/shell.rb

Instance Method Summary collapse

Instance Method Details

#diagram(type) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/gamefic-sdk/shell.rb', line 33

def diagram type
  main = Pathname.new(options[:directory]).join('main.rb').realpath.to_s
  require_relative main
  plot = Gamefic::Plot.new
  diagram = Gamefic::Sdk::Diagram.new(plot)
  puts diagram.get(type).to_json
end

#init(directory_name) ⇒ Object



18
19
20
21
22
# File 'lib/gamefic-sdk/shell.rb', line 18

def init(directory_name)
  scaffold = options[:gem] ? 'library' : 'project'
  Gamefic::Sdk::Scaffold.build scaffold, directory_name, specs: options[:specs]
  puts "Gamefic project initialized at #{File.realpath(directory_name)}"
end

#versionObject



10
11
12
13
# File 'lib/gamefic-sdk/shell.rb', line 10

def version
  puts "gamefic-sdk #{Gamefic::Sdk::VERSION}"
  puts "gamefic #{Gamefic::VERSION}"
end