Class: CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/teuton/cli.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *_args, &_block) ⇒ Object

These inputs are equivalents:

  • teuton dir/foo

  • teuton run dir/foo



98
99
100
# File 'lib/teuton/cli.rb', line 98

def method_missing(method, *_args, &_block)
  play(method.to_s)
end

Instance Method Details

#check(projectpath) ⇒ Object



37
38
39
# File 'lib/teuton/cli.rb', line 37

def check(projectpath)
  Teuton.check(projectpath, options)
end

#new(projectpath) ⇒ Object



13
14
15
# File 'lib/teuton/cli.rb', line 13

def new(projectpath)
  Teuton.create(projectpath)
end

#play(filepath) ⇒ Object



84
85
86
# File 'lib/teuton/cli.rb', line 84

def play(filepath)
  Teuton.run(filepath, options)
end

#readme(projectpath) ⇒ Object



53
54
55
56
# File 'lib/teuton/cli.rb', line 53

def readme(projectpath)
  # Create README from teuton test
  Teuton.readme(projectpath, options)
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


102
103
104
105
# File 'lib/teuton/cli.rb', line 102

def respond_to_missing?(method_name, include_private = false)
  # Respond to missing methods name
  super
end

#versionObject



90
91
92
# File 'lib/teuton/cli.rb', line 90

def version
  puts "#{Teuton::APPNAME} version #{Teuton::VERSION}"
end