ldap-filter 0.0.1 → 0.0.2
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/CHANGELOG +6 -0
- data/lib/ldap/filter/compound.rb +2 -1
- data/lib/ldap/filter/version.rb +1 -1
- data/spec/filter/compound_spec.rb +6 -0
- data/spec/filter/or_filter_spec.rb +1 -1
- metadata +7 -5
data/CHANGELOG
ADDED
data/lib/ldap/filter/compound.rb
CHANGED
@@ -55,7 +55,8 @@ module LDAP
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def populate_from_values key, values
|
58
|
-
|
58
|
+
values = values.flatten
|
59
|
+
raise ArgumentError, "need more than one value for compound filter on the same key: #{key.inspect}, #{values.inspect}" if values.size < 2
|
59
60
|
@operator = '|' # Cannot &'d values on the same key
|
60
61
|
values.map { |value| Base.new(key, value) }
|
61
62
|
end
|
data/lib/ldap/filter/version.rb
CHANGED
@@ -47,6 +47,12 @@ module LDAP
|
|
47
47
|
filter.children.size.should eq 3
|
48
48
|
end
|
49
49
|
|
50
|
+
it "can figure out if an array is passed in instead of a splat" do
|
51
|
+
values = ['Mary', 'John', 'Tyler']
|
52
|
+
filter = Compound.new(operator, :givenName, values)
|
53
|
+
filter.children.size.should eq 3
|
54
|
+
end
|
55
|
+
|
50
56
|
it "so long as there is more than one value provided" do
|
51
57
|
expect { Compound.new('|', :givenName, 'Mary') }.to raise_error ArgumentError
|
52
58
|
end
|
@@ -4,7 +4,7 @@ module LDAP
|
|
4
4
|
module Filter
|
5
5
|
describe OrFilter do
|
6
6
|
|
7
|
-
it "subclases LDAP::Filter::Compound, defaulting the operator to
|
7
|
+
it "subclases LDAP::Filter::Compound, defaulting the operator to :|" do
|
8
8
|
filter = OrFilter.new(givenName: 'John', sn: 'Smith')
|
9
9
|
filter.operator.to_s.should eq '|'
|
10
10
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ldap-filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
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-02-
|
12
|
+
date: 2012-02-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70149773001600 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70149773001600
|
25
25
|
description: DSL for dynamically building complex LDAP filters without concern for
|
26
26
|
closing parentheses
|
27
27
|
email:
|
@@ -32,6 +32,7 @@ extra_rdoc_files: []
|
|
32
32
|
files:
|
33
33
|
- .gitignore
|
34
34
|
- .rspec
|
35
|
+
- CHANGELOG
|
35
36
|
- Gemfile
|
36
37
|
- README.md
|
37
38
|
- Rakefile
|
@@ -67,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
68
|
version: '0'
|
68
69
|
requirements: []
|
69
70
|
rubyforge_project:
|
70
|
-
rubygems_version: 1.8.
|
71
|
+
rubygems_version: 1.8.11
|
71
72
|
signing_key:
|
72
73
|
specification_version: 3
|
73
74
|
summary: DSL for building LDAP filters
|
@@ -76,3 +77,4 @@ test_files:
|
|
76
77
|
- spec/filter/base_spec.rb
|
77
78
|
- spec/filter/compound_spec.rb
|
78
79
|
- spec/filter/or_filter_spec.rb
|
80
|
+
has_rdoc:
|