Class: Wordword::CLI
- Inherits:
-
Thor
- Object
- Thor
- Wordword::CLI
- Defined in:
- lib/wordword/cli.rb
Overview
Handle the application command line parsing and the dispatch to various command objects
Constant Summary collapse
- Error =
Error raised by this runner
Class.new(StandardError)
Instance Method Summary collapse
Instance Method Details
#compose ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/wordword/cli.rb', line 27 def compose(*) if [:help] invoke :help, ["compose"] else require_relative "commands/compose" Wordword::Commands::Compose.new().execute end end |
#train(file = nil) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/wordword/cli.rb', line 41 def train(file = nil) if [:help] invoke :help, ["train"] else require_relative "commands/train" Wordword::Commands::Train.new(file, ).execute end end |
#version ⇒ Object
17 18 19 20 21 |
# File 'lib/wordword/cli.rb', line 17 def version require_relative "version" puts File.read(File.join(File.dirname(__FILE__), "..", "..", "assets/logo.txt")) puts "v#{Wordword::VERSION}" end |