Sha256: 313c22482b5ab50834cdb54df553b827e022f0726fb3569fa515c3c9118486b7

Contents?: true

Size: 806 Bytes

Versions: 13

Compression:

Stored size: 806 Bytes

Contents

require 'pieces'
require 'thor'

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}/build... "
      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

13 entries across 13 versions & 1 rubygems

Version Path
pieces-0.4.2 lib/pieces/cli.rb
pieces-0.4.1 lib/pieces/cli.rb
pieces-0.4.0 lib/pieces/cli.rb
pieces-0.3.11 lib/pieces/cli.rb
pieces-0.3.10 lib/pieces/cli.rb
pieces-0.3.9 lib/pieces/cli.rb
pieces-0.3.8 lib/pieces/cli.rb
pieces-0.3.7 lib/pieces/cli.rb
pieces-0.3.6 lib/pieces/cli.rb
pieces-0.3.5 lib/pieces/cli.rb
pieces-0.3.3 lib/pieces/cli.rb
pieces-0.3.2 lib/pieces/cli.rb
pieces-0.3.1 lib/pieces/cli.rb