Skip to content

Instantly share code, notes, and snippets.

@trivoallan
Created March 9, 2009 17:02
Show Gist options
  • Save trivoallan/76371 to your computer and use it in GitHub Desktop.
Save trivoallan/76371 to your computer and use it in GitHub Desktop.
module LdapTosca
def self.included(base)
RAILS_DEFAULT_LOGGER.info('included')
super(base)
if File.exist?(CONFIGURATION_FILE)
RAILS_DEFAULT_LOGGER.info('exists')
require 'ldap'
RAILS_DEFAULT_LOGGER.info(base)
base.extend(LdapToscaClassMethods)
RAILS_DEFAULT_LOGGER.info('extended')
end
end
module LdapToscaClassMethods
@@conf = nil
def inherited(subclass)
RAILS_DEFAULT_LOGGER.info('inherited')
super(subclass)
@@conf = YAML.load_file(CONFIGURATION_FILE)['ldap']
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment