Sha256: de86d2c0f413147ea326f3a4f8c86146b0a8807b3557d75571a345b68e9c76bc

Contents?: true

Size: 1016 Bytes

Versions: 35

Compression:

Stored size: 1016 Bytes

Contents

#!/usr/bin/env ruby

BEGIN {
	require 'pathname'
	basedir = Pathname( __FILE__ ).dirname.parent
	libdir = basedir + 'lib'

	$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
}

require 'configurability'
require 'sequel'
require 'treequel'


class DatabaseAdapter
	extend Configurability

	config_key :db

	### Configure the database
	def self::configure( dbconfig )
		$stderr.puts "Configuring database adapter: %p" % [ dbconfig ]
		@database = Sequel.connect( dbconfig )
	end

end # class DatabaseAdapter

class LdapAdapter
	extend Configurability

	config_key :ldap

	def self::configure( ldapconfig )
		$stderr.puts "Configuring LDAP adapter: %p" % [ ldapconfig ]
		@ldap = Treequel.directory( ldapconfig )
	end

end # class LdapAdapter


config = YAML.load( DATA )
Configurability.configure_objects( config )


__END__

:db:
  :adapter: postgres
  :host: localhost
  :database: test
  :user: test

:ldap:
  :host: localhost
  :port: 389
  :connect_type: tls
  :base_dn: dc=acme,dc=com

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
configurability-5.0.0 examples/basicconfig.rb
configurability-4.2.0 examples/basicconfig.rb
configurability-4.1.0 examples/basicconfig.rb
configurability-4.0.0 examples/basicconfig.rb
configurability-3.4.1 examples/basicconfig.rb
configurability-3.3.0 examples/basicconfig.rb
configurability-3.2.0 examples/basicconfig.rb
configurability-3.2.0.pre20170417124946 examples/basicconfig.rb
configurability-3.1.2 examples/basicconfig.rb
configurability-3.1.1 examples/basicconfig.rb
configurability-3.1.0 examples/basicconfig.rb
configurability-3.1.0.pre20170103085451 examples/basicconfig.rb
configurability-3.0.0 examples/basicconfig.rb
configurability-3.0.0.pre20161130174408 examples/basicconfig.rb
configurability-3.0.0.pre20161130173417 examples/basicconfig.rb
configurability-3.0.0.pre20161130162622 examples/basicconfig.rb
configurability-3.0.0.pre20161123172826 examples/basicconfig.rb
configurability-2.3.0.pre20161121123955 examples/basicconfig.rb
configurability-2.2.2 examples/basicconfig.rb
configurability-2.2.1 examples/basicconfig.rb