mit-ldap 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -3
- data/lib/mit/ldap.rb +4 -4
- data/lib/mit/ldap/version.rb +1 -1
- data/spec/ldap_spec.rb +4 -4
- metadata +8 -8
data/README.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# mit-ldap
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
Ruby wrapper for the MIT LDAP server. Can only be used if on MIT campus network. Leverages tpope's wonderful [Ldaptic](https://github.com/tpope/ldaptic)
|
4
|
+
|
5
|
+
## Installation:
|
6
|
+
|
7
|
+
```
|
8
|
+
gem 'mit-ldap'
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'mit-ldap'
|
15
|
+
MIT::LDAP.connect!
|
16
|
+
MIT::LDAP.search(:filter => '(uid=mrhalp)') # any Ldaptic syntax
|
17
|
+
```
|
data/lib/mit/ldap.rb
CHANGED
@@ -10,10 +10,10 @@ module MIT
|
|
10
10
|
self.connection = ::LDAP::Conn.new('ldap-too.mit.edu')
|
11
11
|
singleton_class.send(:include,
|
12
12
|
Ldaptic::Module(
|
13
|
-
adapter
|
14
|
-
connection
|
15
|
-
host
|
16
|
-
base
|
13
|
+
:adapter => :ldap_conn,
|
14
|
+
:connection => connection,
|
15
|
+
:host => 'ldap-too.mit.edu',
|
16
|
+
:base => 'dc=mit,dc=edu',
|
17
17
|
)
|
18
18
|
)
|
19
19
|
end
|
data/lib/mit/ldap/version.rb
CHANGED
data/spec/ldap_spec.rb
CHANGED
@@ -41,10 +41,10 @@ module MIT
|
|
41
41
|
|
42
42
|
it "includes Ldaptic::Module" do
|
43
43
|
Ldaptic.should_receive(:Module).
|
44
|
-
with(adapter
|
45
|
-
base
|
46
|
-
connection
|
47
|
-
host
|
44
|
+
with(:adapter => :ldap_conn,
|
45
|
+
:base => 'dc=mit,dc=edu',
|
46
|
+
:connection => @connection,
|
47
|
+
:host => 'ldap-too.mit.edu'
|
48
48
|
)
|
49
49
|
LDAP.connect!
|
50
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mit-ldap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ldaptic
|
16
|
-
requirement: &
|
16
|
+
requirement: &70314214948620 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70314214948620
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: ruby-ldap
|
27
|
-
requirement: &
|
27
|
+
requirement: &70314214948120 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0.9'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70314214948120
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70314214947620 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '2.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70314214947620
|
47
47
|
description: Ruby interface for querying MIT LDAP server (only if you're on MITnet)
|
48
48
|
email:
|
49
49
|
- edd_d@mit.edu
|