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



108
109
110
# File 'lib/teuton/cli.rb', line 108

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

Instance Method Details

#check(projectpath) ⇒ Object



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

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

#config(projectpath) ⇒ Object



45
46
47
48
49
# File 'lib/teuton/cli.rb', line 45

def config(projectpath)
  # Check Test: suggest the content of the configuration file based on the test
  opt = {"onlyconfig" => true}
  Teuton.check(projectpath, opt)
end

#new(projectpath) ⇒ Object



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

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

#play(filepath) ⇒ Object



94
95
96
# File 'lib/teuton/cli.rb', line 94

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

#readme(projectpath) ⇒ Object



63
64
65
66
# File 'lib/teuton/cli.rb', line 63

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

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

Returns:

  • (Boolean)


112
113
114
115
# File 'lib/teuton/cli.rb', line 112

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

#versionObject



100
101
102
# File 'lib/teuton/cli.rb', line 100

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