Class: Videoreg::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/videoreg/base.rb

Direct Known Subclasses

Config, Registrar

Constant Summary collapse

@@logger =
::Logger.new(STDOUT)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.loggerObject



20
21
22
# File 'lib/videoreg/base.rb', line 20

def self.logger
  @@logger
end

.logger=(log) ⇒ Object



16
17
18
# File 'lib/videoreg/base.rb', line 16

def self.logger=(log)
  @@logger = log
end

Instance Method Details

#loggerObject



8
9
10
# File 'lib/videoreg/base.rb', line 8

def logger
  self.class.logger
end

#logger=(log) ⇒ Object



12
13
14
# File 'lib/videoreg/base.rb', line 12

def logger=(log)
  self.class.logger=log
end

#proc_alive?(pid) ⇒ Boolean

Check if process is alive

Returns:

  • (Boolean)


30
31
32
# File 'lib/videoreg/base.rb', line 30

def proc_alive?(pid)
  Videoreg::Util.proc_alive?(pid)
end

#tpl(str) ⇒ Object

Applies current context to the templated string



25
26
27
# File 'lib/videoreg/base.rb', line 25

def tpl(str)
  eval("\"#{str}\"")
end

#which(cmd) ⇒ Object

Cross-platform way of finding an executable in the $PATH.

which('ruby') #=> /usr/bin/ruby


37
38
39
# File 'lib/videoreg/base.rb', line 37

def which(cmd)
  Videoreg::Util.which(cmd)
end