Module: Ruboty
- Extended by:
- Mem
- Defined in:
- lib/ruboty/adapters/base.rb,
lib/ruboty.rb,
lib/ruboty/env.rb,
lib/ruboty/robot.rb,
lib/ruboty/action.rb,
lib/ruboty/message.rb,
lib/ruboty/version.rb,
lib/ruboty/brains/base.rb,
lib/ruboty/actions/base.rb,
lib/ruboty/actions/help.rb,
lib/ruboty/actions/ping.rb,
lib/ruboty/commands/run.rb,
lib/ruboty/brains/memory.rb,
lib/ruboty/commands/base.rb,
lib/ruboty/commands/help.rb,
lib/ruboty/handlers/base.rb,
lib/ruboty/handlers/help.rb,
lib/ruboty/handlers/ping.rb,
lib/ruboty/actions/whoami.rb,
lib/ruboty/adapters/shell.rb,
lib/ruboty/adapter_builder.rb,
lib/ruboty/command_builder.rb,
lib/ruboty/env/validatable.rb,
lib/ruboty/handlers/whoami.rb,
lib/ruboty/commands/generate.rb,
lib/ruboty/env/validation_error.rb,
lib/ruboty/env/missing_required_key_error.rb
Overview
Abstract class to be inherited from adapter class.
Defined Under Namespace
Modules: Actions, Adapters, Brains, Commands, Handlers
Classes: Action, AdapterBuilder, CommandBuilder, Env, Message, Robot
Constant Summary
collapse
- VERSION =
"1.3.1"
Class Method Summary
collapse
Class Method Details
.actions ⇒ Object
33
34
35
|
# File 'lib/ruboty.rb', line 33
def actions
handlers.map(&:actions).flatten.sort_by { |action| action.all? ? 1 : 0 }
end
|
.die(message) ⇒ Object
23
24
25
26
|
# File 'lib/ruboty.rb', line 23
def die(message)
logger.error("Error: #{message}")
exit(1)
end
|
.handlers ⇒ Object
28
29
30
|
# File 'lib/ruboty.rb', line 28
def handlers
[]
end
|
.logger ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/ruboty.rb', line 14
def logger
@logger ||= begin
$stdout.sync = true
logger = Logger.new($stdout)
logger.level = ENV["LOG_LEVEL"] ? ENV["LOG_LEVEL"].to_i : Logger::INFO
logger
end
end
|