class Lita::Handlers::JenkinsClient::BaseAction
Public Class Methods
commands()
click to toggle source
Calls superclass method
Lita::Handlers::JenkinsClient::Action::commands
# File lib/lita/handlers/jenkins_client/base_action.rb, line 10 def self.commands super.merge ({ version: Command.new(name: 'version', matcher: 'version', help: 'get jenkins version.'), cli: Command.new(name: 'cli', matcher: 'cli', help: 'executes the jenkins cli.', usage: 'cli [command]'), running?: Command.new(name: 'running?', matcher: 'running', help: 'Show if jenkins is running.'), }) end
Public Instance Methods
cli(res)
click to toggle source
# File lib/lita/handlers/jenkins_client/base_action.rb, line 24 def cli(res) if res.args.length < 2 res.reply 'Please provide at least one command' return end res.reply api_exec(usage(:cli)) { client.exec_cli(res.args.slice(1...res.args.length).join(' ')) } end
running?(res)
click to toggle source
# File lib/lita/handlers/jenkins_client/base_action.rb, line 34 def running?(res) res.reply api_exec { client.get_root.inspect "Running" } end
version(res)
click to toggle source
# File lib/lita/handlers/jenkins_client/base_action.rb, line 18 def version(res) res.reply api_exec { client.get_jenkins_version } end