Class: Prometheus::Base

Inherits:
Thor
  • Object
show all
Extended by:
PluginDSL
Defined in:
lib/prometheus/base.rb

Direct Known Subclasses

Commands, ConfigCommands, Plugin, PrometheusApp::App

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PluginDSL

configurable, full_name, readme, start

Class Method Details



12
13
14
# File 'lib/prometheus/base.rb', line 12

def banner(task, namespace = true, subcommand = false)
  "#{task.formatted_usage(self, false, subcommand)}"
end

.repl_bannerObject



8
9
10
# File 'lib/prometheus/base.rb', line 8

def repl_banner
  "\e[34m#{self.full_name} \e[0m- Interactive mode, try 'exit' or 'help' for usage"
end

Instance Method Details

#help(task = nil, subcommand = false) ⇒ Object



26
27
28
29
30
31
# File 'lib/prometheus/base.rb', line 26

def help(task = nil, subcommand = false)
  unless task && subcommand
    say self.class.readme, :green
  end
  super(task, subcommand)
end

#replObject



18
19
20
21
22
# File 'lib/prometheus/base.rb', line 18

def repl
  $interactive = true
  Repl.start self
  $interactive = false
end