Sha256: 9e1caa8979109898ce2d8fcfe041212cb9791549c36dbc1b7e935bbe26b85e61

Contents?: true

Size: 848 Bytes

Versions: 3

Compression:

Stored size: 848 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 run 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

3 entries across 3 versions & 1 rubygems

Version Path
teuton-2.1.11 lib/teuton/cli.rb
teuton-2.1.10 lib/teuton/cli.rb
teuton-2.1.9 lib/teuton/cli.rb