Class: Pieces::CLI

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

Instance Method Summary collapse

Instance Method Details

#build(path = '.') ⇒ Object



14
15
16
17
18
# File 'lib/pieces/cli.rb', line 14

def build(path = '.')
  print "Building pieces into #{path}... "
  Pieces::Builder.build(path: path)
  puts 'done.'
end

#init(path = '.') ⇒ Object



7
8
9
10
11
# File 'lib/pieces/cli.rb', line 7

def init(path = '.')
  print "Placing new pieces in #{path}... "
  Pieces::Generator.init(path: path)
  puts 'done.'
end

#server(path = Dir.pwd) ⇒ Object



23
24
25
26
# File 'lib/pieces/cli.rb', line 23

def server(path = Dir.pwd)
  puts "Serving pieces from #{path}/build... "
  Pieces::Server.start(path: path)
end

#versionObject



31
32
33
# File 'lib/pieces/cli.rb', line 31

def version
  puts "pieces v#{Pieces::VERSION}"
end