Sha256: 0f3ed65ca8ee858c9a1e909ceb4de11c29aae51e2c99fb12253d1c5c4249cd65

Contents?: true

Size: 1.52 KB

Versions: 6

Compression:

Stored size: 1.52 KB

Contents

#
# Description
#
# Author:: Robert Sharp
# Copyright:: Copyright (c) 2010 Robert Sharp
# License:: Open Software Licence v3.0
#
# This software is licensed for use under the Open Software Licence v. 3.0
# The terms of this licence can be found at http://www.opensource.org/licenses/osl-3.0.php
# and in the file copyright.txt. Under the terms of this licence, all derivative works
# must themselves be licensed under the Open Software Licence v. 3.0
# 
#


module JerbilService

  # Support methods that should be used to extend a service module
  #
  #   module RubyTest
  #     extend JerbilService::Support
  #
  #     class Service ...
  #
  #
  module Support

    # 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.
    #
    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

    # get the identity of this module, assuming this has been
    # set up and is maintained by Jevoom
    # Returns 'n/a' otherwise
    def ident
      return self::Ident
    rescue
      return 'n/a'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jerbil-1.4.8 lib/jerbil/jerbil_service/support.rb
jerbil-1.4.7 lib/jerbil/jerbil_service/support.rb
jerbil-1.4.6 lib/jerbil/jerbil_service/support.rb
jerbil-1.4.5 lib/jerbil/jerbil_service/support.rb
jerbil-1.3.3 lib/jerbil/jerbil_service/support.rb
jerbil-1.2.2 lib/jerbil/jerbil_service/support.rb