matterhorn_whymper 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/matterhorn/endpoint/group.rb +11 -4
- data/lib/matterhorn/endpoint/user.rb +11 -3
- data/lib/matterhorn_whymper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTlkZDU4YmUzMDM0ZWZiMDY5MjcxNWQwZjg3YWVkNTM1YzE4YzJhOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGVjOTcyYTUxNGNmMTU3NTM1YmI0ODkwMjU0ZDExN2U5ZmYyNDYzMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmNlOGIxZjRmMzgzZjhlYTg4OTc2NjI5ZmM5NWJmNDQ5ZTkxNzU5M2E3M2Mw
|
10
|
+
N2I1NTgwMjg2ODBkMDJiMmY4Yjg3ZDZhN2FmNGZlNmYzNGFhNGI2ZmMxNGVh
|
11
|
+
MzYzN2RiMDc0ZWQyZWQxYTNmYWM2Mzk0ODgyNzE1NGU0NmUwYzI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2VjZmNiODY5ODZlYjU1NDdiNDUzNzk1YzBiMzNjMmQ2MGE2ODRhYzYxMWVj
|
14
|
+
Y2E1YzdmNWY3NGQzNDVjMjFhNmE1NzhiOGQwZWJmNTZmODIxYjE3YzlmYzFm
|
15
|
+
NmMzNDczMzg0MjQxY2RhMDM3YTYxMmUwNTM4NjUwODBmNTY5NDQ=
|
@@ -131,11 +131,18 @@ class Matterhorn::Endpoint::Group < Matterhorn::Endpoint
|
|
131
131
|
|
132
132
|
|
133
133
|
def filter_groups(respons_hash)
|
134
|
-
unless respons_hash['groups']['group'].kind_of?(Array)
|
135
|
-
respons_hash['groups']['group'] = [ respons_hash['groups']['group'] ]
|
136
|
-
end
|
137
134
|
groups = { 'groups' => { 'group' => [] } }
|
138
|
-
respons_hash
|
135
|
+
return groups if respons_hash.nil? ||
|
136
|
+
!respons_hash.kind_of?(Hash) ||
|
137
|
+
respons_hash['groups'].nil?
|
138
|
+
groups_hash = respons_hash['groups']
|
139
|
+
return groups if groups_hash.nil? ||
|
140
|
+
!groups_hash.kind_of?(Hash) ||
|
141
|
+
groups_hash['group'].nil?
|
142
|
+
unless groups_hash['group'].kind_of?(Array)
|
143
|
+
groups_hash['group'] = [ groups_hash['group'] ]
|
144
|
+
end
|
145
|
+
groups_hash['group'].each do |group_hash|
|
139
146
|
next unless group_hash.kind_of?(Hash)
|
140
147
|
groups['groups']['group'] << {
|
141
148
|
'id' => group_hash['id'],
|
@@ -141,11 +141,19 @@ class Matterhorn::Endpoint::User < Matterhorn::Endpoint
|
|
141
141
|
|
142
142
|
|
143
143
|
def filter_users(respons_hash)
|
144
|
-
|
145
|
-
|
144
|
+
users = { 'users' => { 'user' => [] } }
|
145
|
+
return users if respons_hash.nil? ||
|
146
|
+
!respons_hash.kind_of?(Hash) ||
|
147
|
+
respons_hash['users'].nil?
|
148
|
+
users_hash = respons_hash['users']
|
149
|
+
return users if users_hash.nil? ||
|
150
|
+
!users_hash.kind_of?(Hash) ||
|
151
|
+
users_hash['user'].nil?
|
152
|
+
unless users_hash['user'].kind_of?(Array)
|
153
|
+
users_hash['user'] = [ users_hash['user'] ]
|
146
154
|
end
|
147
155
|
users = { 'users' => { 'user' => [] } }
|
148
|
-
|
156
|
+
users_hash['user'].each do |user_hash|
|
149
157
|
next unless user_hash.kind_of?(Hash)
|
150
158
|
users['users']['user'] << filter_user(user_hash)
|
151
159
|
end
|
@@ -5,7 +5,7 @@ module MatterhornWhymper
|
|
5
5
|
|
6
6
|
# -------------------------------------------------------------------------- const definitions ---
|
7
7
|
|
8
|
-
VERSION = "1.7.
|
8
|
+
VERSION = "1.7.1"
|
9
9
|
|
10
10
|
|
11
11
|
end # -------------------------------------------------------------------- end MatterhornWhymper ---
|