Class: Railsdock::Command

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

Direct Known Subclasses

Railsdock::Commands::Install

Instance Method Summary collapse

Instance Method Details

#cmd(**options) ⇒ Object

The external commands runner



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

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

#colorObject



61
62
63
64
# File 'lib/railsdock/command.rb', line 61

def color
  require 'pastel'
  Pastel.new
end

#executeObject

Execute this command

Raises:

  • (NotImplementedError)


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

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

#fileObject

File manipulation utility methods.



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

def file
  require 'tty-file'
  TTY::File
end

#platformObject

Terminal platform and OS properties



46
47
48
49
# File 'lib/railsdock/command.rb', line 46

def platform
  require 'tty-platform'
  TTY::Platform.new
end

#prompt(**options) ⇒ Object

The interactive prompt



56
57
58
59
# File 'lib/railsdock/command.rb', line 56

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