mxhero-api 0.1.21 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjU1ODFlNjY2YTMyZWRkODFlN2YxMTQwM2M2NDUwM2VmMjVmNWVhMA==
4
+ YTU2MzgzYTcyNzVhODRmOTM5MGU5MDZkN2Y0ZmVjM2JhYjg0YjA2Mg==
5
5
  data.tar.gz: !binary |-
6
- ODNlZjQ2ZWE3ZDcwNDQ2MzU0NmZkNzNiNTgwYTVjY2I3ZjIwOTE2NA==
6
+ NjQ5MDE2MmNlYjE2YjJhOGY3ZDQ4NmMxMjhjMjk5MWRhYzMzNjY4MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzQzYTA4M2UxOWI3ZjdkNjM4ZjAzZmFhMzJiMzM0ZmE1YWY0NWNjZDQxZjg0
10
- ZWVkZWFlMTRmN2NiOGFhMDIxYjQ2ODA5YTY4MDFiYjBkYzBmMThmNmZmYzBi
11
- MmFmZDMzNmUzZTM1ODA0ZTc0NmRhNTNlOTE1N2RkNjk0MTYwYWQ=
9
+ YzJlZGNjZTUzZmZkNGViY2VkY2Q2ZjA5ZjkwYzE5MGRhY2VlMDE4Yzk2OWM1
10
+ N2RlMmJhMjA1YzI1MzczMzQwMzY3OWJiZjdjYWFjMDllNDE1YzJmMjVhN2Vl
11
+ ZjFlNDkzMDEwZDc2ZDY2YmNhNmIzZDYyZDQzNGNhNThiN2E4OTE=
12
12
  data.tar.gz: !binary |-
13
- ODUxYTZiY2Y2M2I1ZjM0MmI2Y2FiMmI4OWRmZDE4ZjEyOWYwMjExNmZkMjk4
14
- ZTYwODIzN2M0NGRmNjc3Y2FhZGEwYzcyMDgxMDRlY2MxMzk4NWZkMGRmODUw
15
- Y2I1YmY0MjIwNTE1ODI0MTY3NjkzN2M3YWQ0ZTg2ZDJiNTAxNTg=
13
+ NGY4NjVjOWUzYTI1ZDQ1OWExZDZiOWJiNzU3ZmQ4NmU1M2ZjOTkzN2Y5ZDY3
14
+ NzUzZTM0M2UzMjMxNjcwN2M4MjI0NTFjNjVlNjM3MTNiNmUyOGIyYzQyM2Mz
15
+ ZDgzNjllMzMwZGM2ZTI2NjJkNDVjNjk5ZjkwYzRhYTdiMWNmMzM=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.21
1
+ 0.1.22
data/lib/directories.rb CHANGED
@@ -34,6 +34,10 @@ module MxHero::API
34
34
  parse_update_dates(:next_update, date)
35
35
  end
36
36
 
37
+ def update_properties(properties)
38
+ properties.each { |prop, value| send("#{prop}=", value) if respond_to?("#{prop}=") }
39
+ end
40
+
37
41
  def to_json
38
42
  {
39
43
  domain: domain,
data/mxhero-api.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: mxhero-api 0.1.21 ruby lib
2
+ # stub: mxhero-api 0.1.22 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mxhero-api"
6
- s.version = "0.1.21"
6
+ s.version = "0.1.22"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Maximiliano Dello Russo", "Juan Pablo Royo", "mxHero"]
@@ -92,5 +92,21 @@ class DirectoriesTest < MiniTest::Unit::TestCase
92
92
  assert_equal expected, directory.next_update.to_s #23-09-2013 12:22
93
93
  assert_equal expected, directory.last_update.to_s #23-09-2013 12:22
94
94
  end
95
+
96
+ def test_update_properties
97
+ directory = MxHero::API::Directory.new domain: domain,
98
+ type: 'gapps', address: nil, port: nil, ssl: false,
99
+ user: 'test_user', password: 'password', filter: nil,
100
+ base: nil, next_update: 1379949740000, last_update: 1379949740000,
101
+ override: false, dn_authenticate: nil
102
+ changes = {
103
+ type: 'ldap', address: 'ldap.mxhero.com', port: 1234, ssl: true,
104
+ user: 'mxhero_user', password: 'xxx', filter: 'filter',
105
+ base: 'base', next_update: Date.new, last_update: nil,
106
+ override: true, dn_authenticate: 'dn_autheticate message'
107
+ }
108
+ directory.update_properties changes
109
+ changes.keys.each { |prop| assert_equal changes[prop], directory.send(prop) }
110
+ end
95
111
  end
96
112
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mxhero-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maximiliano Dello Russo