sheffield_ldap_lookup 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,13 @@
1
1
  require 'net/ldap'
2
2
  module SheffieldLdapLookup
3
- class LdapFinder < Struct.new(:keyword)
3
+ class LdapFinder
4
+ attr_accessor :keyword
5
+
6
+ def initialize(keyword = nil, config_prefix = nil)
7
+ self.keyword = keyword
8
+ @config_prefix = config_prefix
9
+ end
10
+
4
11
  class << self
5
12
  attr_accessor :ldap_config
6
13
  end
@@ -26,7 +33,7 @@ module SheffieldLdapLookup
26
33
  end
27
34
 
28
35
  def connection(ldap_class = Net::LDAP)
29
- @connection ||= ldap_class.new(host: ldap_config['host'], port: ldap_config['port'], base: ldap_config['base'])
36
+ @connection ||= ldap_class.new(host: ldap_config["#{@config_prefix}host"], port: ldap_config["#{@config_prefix}port"], base: ldap_config["#{@config_prefix}base"])
30
37
  end
31
38
  end
32
39
  end
@@ -1,3 +1,3 @@
1
1
  module SheffieldLdapLookup
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sheffield_ldap_lookup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-09 00:00:00.000000000 Z
12
+ date: 2013-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ldap
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  segments:
113
113
  - 0
114
- hash: -4032560973816351922
114
+ hash: -2227935076351519590
115
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
@@ -120,10 +120,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  segments:
122
122
  - 0
123
- hash: -4032560973816351922
123
+ hash: -2227935076351519590
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 1.8.24
126
+ rubygems_version: 1.8.23
127
127
  signing_key:
128
128
  specification_version: 3
129
129
  summary: LDAP lookup