Class: Railsbytes::Command

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/railsbytes/command.rb

Direct Known Subclasses

Railsbytes::Commands::Install

Instance Method Summary collapse

Instance Method Details

#command(**options) ⇒ Object

The external commands runner



36
37
38
39
# File 'lib/railsbytes/command.rb', line 36

def command(**options)
  require 'tty-command'
  TTY::Command.new(**options)
end

#executeObject

Execute this command

Raises:

  • (NotImplementedError)


14
15
16
17
18
19
# File 'lib/railsbytes/command.rb', line 14

def execute(*)
  raise(
    NotImplementedError,
    "#{self.class}##{__method__} must be implemented"
  )
end

#prompt(**options) ⇒ Object

The interactive prompt



26
27
28
29
# File 'lib/railsbytes/command.rb', line 26

def prompt(**options)
  require 'tty-prompt'
  TTY::Prompt.new(**options)
end