Sha256: dd91aafa1802c2ffbfb146cd8c31f3c6ccf6bb5abfdb97f8692cbbb541e2e5c6

Contents?: true

Size: 823 Bytes

Versions: 6

Compression:

Stored size: 823 Bytes

Contents

require 'thor'
require_relative 'application'
require_relative 'project/project'
require_relative 'project/skeleton.rb'
require_relative 'cli/main'

##
# Command Line User Interface
class CLI < Thor
  map ['h', '-h', '--help'] => 'help'

  map ['c', '-c', '--create', 'create'] => 'new'
  desc 'new DIRECTORY', 'Create skeleton for a new project'
  long_desc <<-LONGDESC
  Create files for a new project.

  Example:

  #{$PROGRAM_NAME} create dir/foo
  LONGDESC
  ##
  # Command: create new Teuton project
  def new(path_to_new_dir)
    Skeleton.create(path_to_new_dir)
  end

  ##
  # These inputs are equivalents:
  # * teuton dir/foo
  # * teuton play dir/foo
  def method_missing(method, *_args, &_block)
    play(method.to_s)
  end

  def respond_to_missing?(method_name, include_private = false)
    super
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
teuton-2.1.8 lib/teuton/cli.rb
teuton-2.1.8dev1 lib/teuton/cli.rb
teuton-2.1.7 lib/teuton/cli.rb
teuton-2.1.6 lib/teuton/cli.rb
teuton-2.1.5dev lib/teuton/cli.rb
teuton-2.1.4 lib/teuton/cli.rb