Class: Pieces::CLI

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

Instance Method Summary collapse

Instance Method Details

#build(path = '.') ⇒ Object


17
18
19
20
21
# File 'lib/pieces/cli.rb', line 17

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

#init(path = '.') ⇒ Object


10
11
12
13
14
# File 'lib/pieces/cli.rb', line 10

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

#server(path = Dir.pwd) ⇒ Object


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

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

#versionObject


34
35
36
# File 'lib/pieces/cli.rb', line 34

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