Module: CiInACan::Bash

Defined in:
lib/ci_in_a_can/bash.rb

Class Method Summary collapse

Class Method Details

.backtick(command) ⇒ Object



10
11
12
# File 'lib/ci_in_a_can/bash.rb', line 10

def self.backtick command
  `#{command}`
end

.run(command) ⇒ Object



5
6
7
8
# File 'lib/ci_in_a_can/bash.rb', line 5

def self.run command
  CiInACan::BashResult.new(output:    backtick(command),
                           exit_code: the_exit_code)
end

.the_exit_codeObject



14
15
16
# File 'lib/ci_in_a_can/bash.rb', line 14

def self.the_exit_code
  $?.to_i
end