treequel 1.5.1 → 1.5.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.tar.gz.sig CHANGED
Binary file
data/ChangeLog CHANGED
@@ -1,8 +1,65 @@
1
+ 2011-03-17 Michael Granger <ged@FaerieMUD.org>
2
+
3
+ * .hgtags:
4
+ Added tag v1.5.2 for changeset 93550dca4121
5
+ [5132c59e6e3b] [tip]
6
+
7
+ * .hgsigs:
8
+ Added signature for changeset 585d3733441e
9
+ [93550dca4121] [v1.5.2]
10
+
11
+ * spec/treequel/model_spec.rb:
12
+ Fixing identity comparison failure under FreeBSD.
13
+ [585d3733441e]
14
+
15
+ * History.md, README.md, Rakefile, lib/treequel.rb:
16
+ Prep for release.
17
+ [ea0680256a65]
18
+
19
+ * docs/Treequel Manual Diagrams.graffle, docs/openldap-oids.txt, docs
20
+ /treequel-blue.svgz, docs/treequel-favicon.png, docs/treequel-red-
21
+ medium.png, docs/treequel-red-small.png, docs/treequel-red.png, docs
22
+ /treequel-red.svg, docs/treequel.svg, docs/treequel.svgz,
23
+ manual/layouts/default.erb, manual/resources/css/manual.css,
24
+ manual/resources/images/Treequel Manual Diagrams.graffle,
25
+ manual/resources/images/treequel-blue.svgz, manual/resources/images
26
+ /treequel-favicon.png, manual/resources/images/treequel-red-
27
+ medium.png, manual/resources/images/treequel-red-small.png,
28
+ manual/resources/images/treequel-red.png, manual/resources/images
29
+ /treequel-red.svg, manual/resources/images/treequel.svg,
30
+ manual/resources/images/treequel.svgz,
31
+ manual/resources/js/manual.js, manual/resources/js/sh.js,
32
+ manual/resources/swf/clipboard.swf, manual/src/models.page:
33
+ More work on the manual
34
+ [38a9eb41200a]
35
+
36
+ * manual/lib/api-filter.rb, manual/lib/editorial-filter.rb, manual/lib
37
+ /examples-filter.rb, manual/lib/links-filter.rb:
38
+ Updated for hoe-manualgen 0.1.0
39
+ [eccf310a6e3b]
40
+
41
+ 2011-03-15 Michael Granger <ged@FaerieMUD.org>
42
+
43
+ * spec/treequel/monkeypatches_spec.rb:
44
+ Fixing bad time tests uncovered by the DST switch
45
+ [63ac5e6f0b10] [master]
46
+
47
+ 2011-03-08 Michael Granger <ged@FaerieMUD.org>
48
+
49
+ * spec/data/ad_schema.yml:
50
+ Adding an ActiveDirectory schema dump for testing
51
+ [8fe97e62d953]
52
+
53
+ * lib/treequel/branch.rb, lib/treequel/model/schemavalidations.rb,
54
+ lib/treequel/schema/attributetype.rb, spec/treequel/schema_spec.rb:
55
+ Fix for Github issue [ged/treequel GH-1] (closes #7)
56
+ [46745dfb2504]
57
+
1
58
  2011-02-25 Michael Granger <ged@FaerieMUD.org>
2
59
 
3
60
  * .hgtags:
4
61
  Added tag v1.5.1 for changeset b0945a1e6ee0
5
- [f3dbf7033b58] [master, tip]
62
+ [f3dbf7033b58] [github/master]
6
63
 
7
64
  * .hgsigs:
8
65
  Added signature for changeset 01662c7a2a07
@@ -49,7 +106,7 @@
49
106
  * lib/treequel/model/objectclass.rb,
50
107
  spec/treequel/model/objectclass_spec.rb:
51
108
  Make Treequel::Model::ObjectClass Enumerable, fix a spec error.
52
- [76473835cff3] [github/master]
109
+ [76473835cff3]
53
110
 
54
111
  * lib/treequel.rb, lib/treequel/branch.rb, lib/treequel/model.rb,
55
112
  lib/treequel/model/objectclass.rb,
data/History.md CHANGED
@@ -1,3 +1,38 @@
1
+ ## 1.5.2 [2011-03-17] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ * Manual updates
4
+ * Fixing bad time tests uncovered by the DST switch
5
+ * Adding an ActiveDirectory schema dump for testing
6
+ * Fix for Github issue [ged/treequel GH-1] (closes #7)
7
+
8
+
9
+ ## 1.5.1 [2011-02-25] Michael Granger <ged@FaerieMUD.org>
10
+
11
+ * Adding handling of operational attributes to Treequel::Model schema
12
+ validations, updated the subschema test data to a recent OpenLDAP.
13
+
14
+
15
+ ## 1.5.0 [2011-02-24] Michael Granger <ged@FaerieMUD.org>
16
+
17
+ * Make Treequel::Model::ObjectClass Enumerable
18
+ * Add a default directory to Treequel::Model for creating and
19
+ searching
20
+ * Fix delegation to a method that takes a block for
21
+ Treequel::Delegation
22
+ * Consistently delete the DN from the entry hash when constructing
23
+ branches and model objects
24
+ * Fix Treequel::Branch#-
25
+ * Fix Treequel::Branchset#to_hash
26
+ * Make dependencies not so pessimistic.
27
+
28
+
29
+ ## 1.4.4 [2011-02-10] Michael Granger <ged@FaerieMUD.org>
30
+
31
+ * Add the .gemtest and Manifest to the manifest, bump patch version.
32
+ * Make Treequel testable via Gem Testers
33
+ * Hack to work around the pointer-mismanagement of LDAP::Mod
34
+
35
+
1
36
  ## 1.4.3 [2011-02-10] Michael Granger <ged@FaerieMUD.org>
2
37
 
3
38
  * Added gem-testers support
data/README.md CHANGED
@@ -110,6 +110,10 @@ the following license terms:
110
110
  A special thanks to Ben Bleything, who was part of the initial brainstorm that
111
111
  led to the creation of this library.
112
112
 
113
+ Thanks also to Ben Cooksley of the KDE project, who has been full of great
114
+ ideas for the Model side of Treequel; it's vastly better for his
115
+ suggestions.
116
+
113
117
 
114
118
  [examples]:http://deveiate.org/projects/Treequel/browser/examples
115
119
  [hgrepo]:http://repo.deveiate.org/Treequel
data/Rakefile CHANGED
@@ -3,7 +3,6 @@
3
3
  require 'hoe'
4
4
 
5
5
  Hoe.plugin :mercurial
6
- Hoe.plugin :yard
7
6
  Hoe.plugin :signing
8
7
  Hoe.plugin :manualgen
9
8
 
@@ -25,7 +25,7 @@ end
25
25
 
26
26
  # A library for interacting with LDAP modelled after Sequel.
27
27
  #
28
- # @version 1.5.1
28
+ # @version 1.5.2
29
29
  #
30
30
  # @example
31
31
  # # Connect to the directory at the specified URL
@@ -53,10 +53,10 @@ end
53
53
  module Treequel
54
54
 
55
55
  # Library version
56
- VERSION = '1.5.1'
56
+ VERSION = '1.5.2'
57
57
 
58
58
  # VCS revision
59
- REVISION = %q$Revision: 01662c7a2a07 $
59
+ REVISION = %q$Revision: ea0680256a65 $
60
60
 
61
61
  # Common paths for ldap.conf
62
62
  COMMON_LDAP_CONF_PATHS = %w[
@@ -806,7 +806,7 @@ class Treequel::Branch
806
806
  value = self.entry ? self.entry[ attrsym.to_s ] : nil
807
807
 
808
808
  if attribute = self.directory.schema.attribute_types[ attrsym ]
809
- syntax_oid = attribute.syntax.oid
809
+ syntax_oid = attribute.syntax_oid
810
810
 
811
811
  if attribute.single?
812
812
  value = self.directory.convert_to_object( syntax_oid, value.first ) if value
@@ -828,8 +828,8 @@ class Treequel::Branch
828
828
  def get_converted_attribute( attrsym, object )
829
829
  if attribute = self.directory.schema.attribute_types[ attrsym ]
830
830
  self.log.debug "converting %p object (a %p) to a %p attribute" %
831
- [ attrsym, object.class, attribute.syntax.desc ]
832
- return self.directory.convert_to_attribute( attribute.syntax.oid, object )
831
+ [ attrsym, object.class, attribute.syntax_oid ]
832
+ return self.directory.convert_to_attribute( attribute.syntax_oid, object )
833
833
  else
834
834
  self.log.info "no attributeType for %p" % [ attrsym ]
835
835
  return object.to_s
@@ -78,7 +78,8 @@ module Treequel::Model::SchemaValidations
78
78
  self.log.error "validation for %p failed: %s: %s" %
79
79
  [ attribute, err.class.name, err.message ]
80
80
  attrtype = self.find_attribute_type( attribute )
81
- self.errors.add( attribute, "isn't a valid %s value" % [attrtype.syntax.desc] )
81
+ self.errors.add( attribute, "isn't a valid %s value" %
82
+ [ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )
82
83
  end
83
84
  end
84
85
  end
@@ -69,6 +69,7 @@ class Treequel::Schema::AttributeType
69
69
  # Normalize the attributes
70
70
  names = Treequel::Schema.parse_names( names )
71
71
  desc = Treequel::Schema.unquote_desc( desc )
72
+ # syntax_oid = Treequel::Schema.unquote_desc( syntax_oid ) # For AD
72
73
 
73
74
  sup_oid = Treequel::Schema.parse_oid( sup_oid ) if sup_oid
74
75
  eqmatch_oid = Treequel::Schema.parse_oid( eqmatch_oid ) if eqmatch_oid
@@ -243,7 +244,7 @@ class Treequel::Schema::AttributeType
243
244
  self.oid,
244
245
  self.desc,
245
246
  self.is_single? ? '(SINGLE) ' : '',
246
- self.syntax,
247
+ self.syntax || self.syntax_oid,
247
248
  self.syntax_len ? self.syntax_len : 'unlimited',
248
249
  ]
249
250
  end
@@ -340,7 +340,7 @@ describe Treequel::Model do
340
340
  end
341
341
 
342
342
  it "provides writers for valid singular attributes" do
343
- @obj.logonTime.should equal( 1293167318 )
343
+ @obj.logonTime.should == 1293167318
344
344
  end
345
345
 
346
346
  it "provides writers for valid non-singular attributes that accept a non-array" do
@@ -130,7 +130,7 @@ describe Treequel::DateExtensions do
130
130
  before( :all ) do
131
131
  # Make the local timezone PDT so offsets show up correctly
132
132
  @real_tz = ENV['TZ']
133
- ENV['TZ'] = ':PST8PDT'
133
+ ENV['TZ'] = ':GMT'
134
134
  end
135
135
 
136
136
  before( :each ) do
@@ -144,19 +144,19 @@ describe Treequel::DateExtensions do
144
144
  describe "RFC4517 LDAP Generalized Time method" do
145
145
 
146
146
  it "returns the time in 'Generalized Time' format" do
147
- @date.ldap_generalized.should == "20100805000001-0800"
147
+ @date.ldap_generalized.should == "20100805000001+0000"
148
148
  end
149
149
 
150
150
  it "can include fractional seconds if the optional fractional digits argument is given" do
151
- @date.ldap_generalized( 3 ).should == "20100805000001.000-0800"
151
+ @date.ldap_generalized( 3 ).should == "20100805000001.000+0000"
152
152
  end
153
153
 
154
154
  it "doesn't include the decimal if fractional digits is specified but zero" do
155
- @date.ldap_generalized( 0 ).should == "20100805000001-0800"
155
+ @date.ldap_generalized( 0 ).should == "20100805000001+0000"
156
156
  end
157
157
 
158
158
  it "zero-fills any digits after six in the fractional digits" do
159
- @date.ldap_generalized( 11 ).should == "20100805000001.00000000000-0800"
159
+ @date.ldap_generalized( 11 ).should == "20100805000001.00000000000+0000"
160
160
  end
161
161
 
162
162
  end
@@ -164,7 +164,7 @@ describe Treequel::DateExtensions do
164
164
  describe "RFC4517 UTC Time method" do
165
165
 
166
166
  it "returns the time in 'UTC Time' format" do
167
- @date.ldap_utc.should == "100805000001-0800"
167
+ @date.ldap_utc.should == "100805000001+0000"
168
168
  end
169
169
 
170
170
  end
@@ -44,42 +44,68 @@ describe Treequel::Schema do
44
44
  TEST_DESCR = 'objectClass'
45
45
  TEST_OIDLIST = %:( #{TEST_DESCR} $ objectCaste $ #{TEST_NUMERICOID} ) :
46
46
 
47
- it "can parse the schema structure returned from LDAP::Conn#schema" do
48
- schema_dumpfile = @datadir + 'schema.yml'
49
- hash = YAML.load_file( schema_dumpfile )
50
- schemahash = LDAP::Schema.new( hash )
51
-
52
- schema = Treequel::Schema.new( schemahash )
53
-
54
- schema.object_classes.should have( 308 ).members
55
- schema.attribute_types.should have( 1193 ).members
56
- schema.matching_rules.should have( 74 ).members
57
- schema.matching_rule_uses.should have( 54 ).members
58
- schema.ldap_syntaxes.should have( 32 ).members
59
-
60
- schema.operational_attribute_types.should have( 34 ).members
47
+ context "OpenLDAP schema" do
48
+ before( :all ) do
49
+ @schema_dumpfile = @datadir + 'schema.yml'
50
+ @hash = YAML.load_file( @schema_dumpfile )
51
+ @schemahash = LDAP::Schema.new( @hash )
52
+ @schemahash.freeze
53
+ @schema = Treequel::Schema.new( @schemahash )
54
+ end
55
+
56
+ it "can parse the schema structure returned from LDAP::Conn#schema" do
57
+ @schema.object_classes.values.uniq.should have( @hash['objectClasses'].length ).members
58
+ @schema.attribute_types.values.uniq.should have( @hash['attributeTypes'].length ).members
59
+ @schema.matching_rules.values.uniq.should have( @hash['matchingRules'].length ).members
60
+ @schema.matching_rule_uses.values.uniq.should have( @hash['matchingRuleUse'].length ).members
61
+ @schema.ldap_syntaxes.values.uniq.should have( @hash['ldapSyntaxes'].length ).members
62
+
63
+ dirop_count = @hash['attributeTypes'].
64
+ count {|type| type.index('USAGE directoryOperation') }
65
+ dsaop_count = @hash['attributeTypes'].
66
+ count {|type| type.index('USAGE dSAOperation') }
67
+ distop_count = @hash['attributeTypes'].
68
+ count {|type| type.index('USAGE distributedOperation') }
69
+ op_attrcount = dirop_count + dsaop_count + distop_count
70
+
71
+ @schema.operational_attribute_types.should have( op_attrcount ).members
72
+ end
73
+
74
+
75
+ it "can parse the schema structure returned from LDAP::Conn#schema even under $SAFE >= 1" do
76
+ schema = nil
77
+ Thread.new do
78
+ Thread.current.abort_on_exception = true
79
+ $SAFE = 1
80
+ schemahash = LDAP::Schema.new( @hash )
81
+ schema = Treequel::Schema.new( schemahash )
82
+ end.join
83
+
84
+ schema.should be_an_instance_of( Treequel::Schema )
85
+ end
61
86
  end
62
87
 
88
+ context "ActiveDirectory schema" do
89
+
90
+ before( :all ) do
91
+ @schema_dumpfile = @datadir + 'ad_schema.yml'
92
+ @hash = YAML.load_file( @schema_dumpfile )
93
+ @schemahash = LDAP::Schema.new( @hash )
94
+ @schema = Treequel::Schema.new( @schemahash )
95
+ end
63
96
 
64
- it "can parse the schema structure returned from LDAP::Conn#schema even under $SAFE >= 1" do
65
- schema_dumpfile = @datadir + 'schema.yml'
66
- hash = YAML.load_file( schema_dumpfile )
97
+ it "can parse an ActiveDirectory schema structure, too" do
98
+ @schema.object_classes.values.uniq.should have( @hash['objectClasses'].length ).members
99
+ @schema.attribute_types.values.uniq.should have( @hash['attributeTypes'].length ).members
67
100
 
68
- schema = nil
69
- Thread.new do
70
- Thread.current.abort_on_exception = true
71
- $SAFE = 1
72
- schemahash = LDAP::Schema.new( hash )
73
- schema = Treequel::Schema.new( schemahash )
74
- end.join
101
+ # AD doesn't have these in its subSchema
102
+ @schema.matching_rules.should be_empty()
103
+ @schema.matching_rule_uses.should be_empty()
104
+ @schema.ldap_syntaxes.should be_empty()
105
+ @schema.operational_attribute_types.should be_empty()
106
+ end
75
107
 
76
- schema.object_classes.should have( 308 ).members
77
- schema.attribute_types.should have( 1193 ).members
78
- schema.matching_rules.should have( 74 ).members
79
- schema.matching_rule_uses.should have( 54 ).members
80
- schema.ldap_syntaxes.should have( 32 ).members
81
108
 
82
- schema.operational_attribute_types.should have( 34 ).members
83
109
  end
84
110
 
85
111
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: treequel
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.5.1
5
+ version: 1.5.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michael Granger
@@ -31,7 +31,7 @@ cert_chain:
31
31
  cmlhXe46pZNJgWKbxZah85jIjx95hR8vOI+NAM5iH9kOqK13DrxacTKPhqj5PjwF
32
32
  -----END CERTIFICATE-----
33
33
 
34
- date: 2011-02-25 00:00:00 -08:00
34
+ date: 2011-03-17 00:00:00 -07:00
35
35
  default_executable:
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
@@ -67,94 +67,83 @@ dependencies:
67
67
  version: 1.2.1
68
68
  type: :development
69
69
  version_requirements: *id003
70
- - !ruby/object:Gem::Dependency
71
- name: hoe-yard
72
- prerelease: false
73
- requirement: &id004 !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- version: 0.1.2
79
- type: :development
80
- version_requirements: *id004
81
70
  - !ruby/object:Gem::Dependency
82
71
  name: rspec
83
72
  prerelease: false
84
- requirement: &id005 !ruby/object:Gem::Requirement
73
+ requirement: &id004 !ruby/object:Gem::Requirement
85
74
  none: false
86
75
  requirements:
87
76
  - - ~>
88
77
  - !ruby/object:Gem::Version
89
78
  version: "2.4"
90
79
  type: :development
91
- version_requirements: *id005
80
+ version_requirements: *id004
92
81
  - !ruby/object:Gem::Dependency
93
82
  name: ruby-termios
94
83
  prerelease: false
95
- requirement: &id006 !ruby/object:Gem::Requirement
84
+ requirement: &id005 !ruby/object:Gem::Requirement
96
85
  none: false
97
86
  requirements:
98
87
  - - ~>
99
88
  - !ruby/object:Gem::Version
100
89
  version: "0.9"
101
90
  type: :development
102
- version_requirements: *id006
91
+ version_requirements: *id005
103
92
  - !ruby/object:Gem::Dependency
104
93
  name: ruby-terminfo
105
94
  prerelease: false
106
- requirement: &id007 !ruby/object:Gem::Requirement
95
+ requirement: &id006 !ruby/object:Gem::Requirement
107
96
  none: false
108
97
  requirements:
109
98
  - - ~>
110
99
  - !ruby/object:Gem::Version
111
100
  version: "0.1"
112
101
  type: :development
113
- version_requirements: *id007
102
+ version_requirements: *id006
114
103
  - !ruby/object:Gem::Dependency
115
104
  name: columnize
116
105
  prerelease: false
117
- requirement: &id008 !ruby/object:Gem::Requirement
106
+ requirement: &id007 !ruby/object:Gem::Requirement
118
107
  none: false
119
108
  requirements:
120
109
  - - ~>
121
110
  - !ruby/object:Gem::Version
122
111
  version: "0.3"
123
112
  type: :development
124
- version_requirements: *id008
113
+ version_requirements: *id007
125
114
  - !ruby/object:Gem::Dependency
126
115
  name: sysexits
127
116
  prerelease: false
128
- requirement: &id009 !ruby/object:Gem::Requirement
117
+ requirement: &id008 !ruby/object:Gem::Requirement
129
118
  none: false
130
119
  requirements:
131
120
  - - ~>
132
121
  - !ruby/object:Gem::Version
133
122
  version: "1.0"
134
123
  type: :development
135
- version_requirements: *id009
124
+ version_requirements: *id008
136
125
  - !ruby/object:Gem::Dependency
137
126
  name: sequel
138
127
  prerelease: false
139
- requirement: &id010 !ruby/object:Gem::Requirement
128
+ requirement: &id009 !ruby/object:Gem::Requirement
140
129
  none: false
141
130
  requirements:
142
131
  - - ~>
143
132
  - !ruby/object:Gem::Version
144
133
  version: "3.20"
145
134
  type: :development
146
- version_requirements: *id010
135
+ version_requirements: *id009
147
136
  - !ruby/object:Gem::Dependency
148
137
  name: hoe
149
138
  prerelease: false
150
- requirement: &id011 !ruby/object:Gem::Requirement
139
+ requirement: &id010 !ruby/object:Gem::Requirement
151
140
  none: false
152
141
  requirements:
153
142
  - - ">="
154
143
  - !ruby/object:Gem::Version
155
144
  version: 2.9.1
156
145
  type: :development
157
- version_requirements: *id011
146
+ version_requirements: *id010
158
147
  description: |-
159
148
  Treequel is an LDAP toolkit for Ruby. It is intended to allow quick, easy
160
149
  access to LDAP directories in a manner consistent with LDAP's hierarchical,
@@ -173,7 +162,6 @@ extensions: []
173
162
 
174
163
  extra_rdoc_files:
175
164
  - Manifest.txt
176
- - History.md
177
165
  files:
178
166
  - .gemtest
179
167
  - ChangeLog
@@ -260,9 +248,8 @@ post_install_message: |-
260
248
  You can install them automatically if you use the --development flag when
261
249
  installing Treequel.
262
250
  rdoc_options:
263
- - --title
264
- - Treequel Documentation
265
- - --quiet
251
+ - --main
252
+ - README.md
266
253
  require_paths:
267
254
  - lib
268
255
  required_ruby_version: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file