Sha256: 431ea251ad3319636e67753e8b428329d8d0a8f5c0dd46eecb010f0c9085aa45

Contents?: true

Size: 492 Bytes

Versions: 8

Compression:

Stored size: 492 Bytes

Contents

module Slappy
  class CLI < Thor
    desc 'start', 'slappy start'
    def start
      build_command(:run).call
    end

    desc 'new [DIR_NAME]', 'create new slappy project'
    def new(dir_name = nil)
      build_command(:generator).call(dir_name)
    end

    desc 'version', 'show version number'
    def version
      puts Slappy::VERSION
    end

    private

    def build_command(command_name)
      "Slappy::Commands::#{command_name.to_s.camelize}".constantize.new
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
slappy-0.6.3 lib/slappy/cli.rb
slappy-0.6.2 lib/slappy/cli.rb
slappy-0.6.1 lib/slappy/cli.rb
slappy-0.6.0 lib/slappy/cli.rb
slappy-0.5.2 lib/slappy/cli.rb
slappy-0.5.1 lib/slappy/cli.rb
slappy-0.5.0 lib/slappy/cli.rb
slappy-0.4.0 lib/slappy/cli.rb