dm-ldap-adapter 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ require 'spec/rake/spectask'
9
9
  require 'pathname'
10
10
 
11
11
  Hoe.spec('dm-ldap-adapter') do |p|
12
- p.version = "0.4.0"
12
+ p.version = "0.4.1"
13
13
  p.description = "ldap adapter for datamapper which uses either net-ldap or ruby-ldap"
14
14
  p.developer('mkristian', 'm.kristian@web.de')
15
15
  p.url = "http://dm-ldap-adapter.rubyforge.org"
@@ -347,7 +347,7 @@ module DataMapper
347
347
  value
348
348
  else
349
349
  prop = props[f.field.to_sym].first
350
- f.primitive == Integer ? prop.to_i : prop
350
+ f.primitive == Integer ? prop.to_i : prop.join
351
351
  end
352
352
  end
353
353
  props_result << values
data/lib/ldap/array.rb CHANGED
@@ -57,7 +57,7 @@ module Ldap
57
57
 
58
58
  def load(value)
59
59
  result = case value
60
- when ::String then value.gsub(/^.|.$/,'').split('","').to_a.freeze
60
+ when ::String then value[1, value.size-2].split('","').to_a.freeze
61
61
  when ::Array then value.freeze
62
62
  else
63
63
  []
@@ -149,5 +149,14 @@ describe DataMapper.repository(:ldap).adapter.class do
149
149
  TestContact.all(:mail => "email1").first.should == @contact
150
150
  end
151
151
  end
152
+
153
+ it 'should be able to use multilines with LdapArray' do
154
+ pending "not working for net-ldap" if DataMapper.repository(:ldap).adapter.ldap.class.to_s == 'Ldap::NetLdapFacade'
155
+ DataMapper.repository(:ldap) do
156
+ @contact.mail = ["email1\nmail2\nmail2\nmail4", "email1"]
157
+ @contact.save
158
+ TestContact.get(@contact.id).mail.should == ["email1\nmail2\nmail2\nmail4", "email1"]
159
+ end
160
+ end
152
161
  end
153
162
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-ldap-adapter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - mkristian