Sha256: 5a7f1a7308a3333fc07f8e7775235a038a5acd79cd3c1bfb19142aaa931e408e

Contents?: true

Size: 800 Bytes

Versions: 1

Compression:

Stored size: 800 Bytes

Contents

require 'thor'
require 'pieces'

module Pieces
  class CLI < Thor
    desc 'init DIR', 'create new pieces app in DIR'
    def init(path = '.')
      print "Placing new pieces in #{path}... "
      Pieces::Generator.init(path: path)
      puts 'done.'
    end

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

    map %w(s) => :server

    desc 'server DIR', 'serve application in DIR'
    def server(path = Dir.pwd)
      puts "Serving pieces from #{path}... "
      Pieces::Server.start(path: path)
    end

    map %w(--version -v) => :version

    desc '--version', 'get pieces version'
    def version
      puts "pieces v#{Pieces::VERSION}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pieces-0.6.0 lib/pieces/cli.rb