active_directory 1.5.0 → 1.5.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.5.0
1
+ 1.5.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{active_directory}
8
- s.version = "1.5.0"
8
+ s.version = "1.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adam T Kerr"]
@@ -531,19 +531,6 @@ module ActiveDirectory
531
531
  return value
532
532
  end
533
533
 
534
- ##
535
- # Reads the array of values for the provided attribute. The attribute name
536
- # is canonicalized prior to reading. Returns an empty array if the
537
- # attribute does not exist.
538
- def [](name)
539
- get_attr(name)
540
- end
541
-
542
- ##
543
- # Ensure that flattening works correctly
544
- def to_ary
545
- end
546
-
547
534
  def valid_attribute? name
548
535
  @attributes.has_key?(name) || @entry.attribute_names.include?(name)
549
536
  end
@@ -562,13 +549,27 @@ module ActiveDirectory
562
549
  end
563
550
  end
564
551
 
552
+ def set_attr(name, value)
553
+ @attributes[name.to_sym] = encode_field(name, value)
554
+ end
555
+
556
+ ##
557
+ # Reads the array of values for the provided attribute. The attribute name
558
+ # is canonicalized prior to reading. Returns an empty array if the
559
+ # attribute does not exist.
560
+ alias [] get_attr
561
+ alias []= set_attr
562
+
563
+ ##
564
+ # Weird fluke with flattening, probably because of above attribute
565
+ def to_ary
566
+ end
567
+
568
+
565
569
  def method_missing(name, args = []) # :nodoc:
566
570
  name = name.to_s.downcase
567
571
 
568
- if name[-1,1] == '='
569
- name.chop!
570
- @attributes[name.to_sym] = encode_field(name, args)
571
- end
572
+ return set_attr(name.chop, args) if name[-1] == '='
572
573
 
573
574
  if valid_attribute? name.to_sym
574
575
  get_attr(name)
@@ -25,7 +25,7 @@ module ActiveDirectory
25
25
  # Encodes a hex string into a GUID
26
26
  #
27
27
  def self.encode(hex_string)
28
- hex_string.to_a.pack("H*")
28
+ [hex_string].pack("H*")
29
29
  end
30
30
 
31
31
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_directory
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: net-ldap
17
- requirement: &2152460440 !ruby/object:Gem::Requirement
17
+ requirement: &2154136640 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: 0.1.1
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2152460440
25
+ version_requirements: *2154136640
26
26
  description: ActiveDirectory uses Net::LDAP to provide a means of accessing and modifying
27
27
  an Active Directory data store. This is a fork of the activedirectory gem.
28
28
  email: ajrkerr@gmail.com