Module: JerbilService::Support

Defined in:
lib/jerbil/jerbil_service/support.rb

Overview

Support methods that should be used to extend a service module

module RubyTest
  extend JerbilService::Support

  class Service ...

Instance Method Summary collapse

Instance Method Details

#get_config(config_file = nil) ⇒ Object

get the config settings for the given service module.

This uses Jeckyl configuration and defaults to the conf file for the service module in the location defined by Jeckyl::ConfigRoot.

e.g. for RubyTest, it will default to /etc/jermine/rubytest.rb

Provide a different filename to change this.



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/jerbil/jerbil_service/support.rb', line 37

def get_config(config_file=nil)
  # check that the config_file has been specified
  if config_file.nil? then
    # no, so set the default
    config_file = Jeckyl::ConfigRoot + "/#{self.to_s.downcase}.rb"
  end

  # read the config file
  return self::Config.new(config_file)

end

#identObject

get the identity of this module, assuming this has been set up and is maintained by Jevoom Returns ‘n/a’ otherwise



52
53
54
55
56
# File 'lib/jerbil/jerbil_service/support.rb', line 52

def ident
  return self::Ident
rescue
  return 'n/a'
end