cornell_ldap 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
data/cornell_ldap.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cornell_ldap}
8
- s.version = "1.3.0"
8
+ s.version = "1.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ari Epstein"]
data/lib/cornell_ldap.rb CHANGED
@@ -20,12 +20,16 @@ module CornellLdap
20
20
  CONNECTION_PARAMETERS = [ :port, :host, :auth ]
21
21
 
22
22
  def self.setup_connection( params )
23
- @@connection_params = params
24
- con = {}
25
- CONNECTION_PARAMETERS.each do |setting|
26
- con[setting] = @@connection_params[setting] if params.key? setting
23
+ @@connection_params = params.inject({}) do |memo, (k, v)|
24
+ memo[k.to_sym] = v
25
+ memo
27
26
  end
28
- @@connection = Net::LDAP.new( con )
27
+ @@connection = Net::LDAP.new(
28
+ @@connection_params.inject({}) do |memo, (k, v)|
29
+ memo[k] = v if CONNECTION_PARAMETERS.include? k
30
+ memo
31
+ end
32
+ )
29
33
  end
30
34
 
31
35
  def self.connection
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 3
8
- - 0
9
- version: 1.3.0
8
+ - 1
9
+ version: 1.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ari Epstein