module RBatch

Constants

VERSION

Public Instance Methods

cmd(cmd_str,opt=nil) click to toggle source

Shortcut of RBatch::Cmd.new(cmd_str,opt).run @see RBatch::Cmd @example

r = RBatch.cmd("ls")
p r.stdout # => "fileA\nfileB\n"
p r.stderr # => ""
p r.status # => 0

@example

r = RBatch.cmd("rsync /foo /bar",{:timeout => 10})
# File lib/rbatch.rb, line 62
def cmd(cmd_str,opt=nil) ; @@ctrl.cmd(cmd_str,opt) ; end
common_config() click to toggle source

Return Common-Config Object @raise [RBatch::ConfigException] @return [RBatch::Config] @example RB_HOME/conf/common.yaml

key: value
array:
 - item1
 - item2
 - item3

@example ${RB_HOME}/bin/hoge.rb

p RBatch.common_config["key"]   # => "value"
p RBatch.common_config["array"] # => ["item1", "item2", "item3"]
p RBatch.common_config["not_exist"] # => Raise RBatch::ConfigException
# File lib/rbatch.rb, line 51
def common_config        ; @@ctrl.common_config ; end
config() click to toggle source

Return Config Object @raise [RBatch::ConfigException] @return [RBatch::Config] @example RB_HOME/conf/hoge.yaml

key: value
array:
 - item1
 - item2
 - item3

@example ${RB_HOME}/bin/hoge.rb

p RBatch.config["key"]   # => "value"
p RBatch.config["array"] # => ["item1", "item2", "item3"]
p RBatch.config["not_exist"] # => Raise RBatch::ConfigException
# File lib/rbatch.rb, line 36
def config               ; @@ctrl.config ; end
ctrl() click to toggle source

@private

# File lib/rbatch.rb, line 18
def ctrl ; @@ctrl ; end
init() click to toggle source

@private

# File lib/rbatch.rb, line 12
def init
  @@ctrl = RBatch::Controller.new
  @@ctrl.load_lib
end
vars() click to toggle source

@private

# File lib/rbatch.rb, line 21
def vars ; @@ctrl.vars ; end