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/logger.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, Logger, Message, Robot

Constant Summary collapse

VERSION =
"1.1.6"

Class Method Summary collapse

Class Method Details

.actionsObject



31
32
33
# File 'lib/ruboty.rb', line 31

def actions
  handlers.map(&:actions).flatten.sort_by { |action| action.all? ? 1 : 0 }
end

.die(message) ⇒ Object



21
22
23
24
# File 'lib/ruboty.rb', line 21

def die(message)
  logger.error("Error: #{message}")
  exit(1)
end

.handlersObject



26
27
28
# File 'lib/ruboty.rb', line 26

def handlers
  []
end

.loggerObject



13
14
15
16
17
18
19
# File 'lib/ruboty.rb', line 13

def logger
  @logger ||= begin
    logger = Ruboty::Logger.new($stdout)
    logger.level = ENV["LOG_LEVEL"] ? ENV["LOG_LEVEL"].to_i : Logger::ERROR
    logger
  end
end