gaah 0.1.4.1 → 0.1.5
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.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/lib/gaah/provisioning/api.rb +18 -4
- data/lib/gaah/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
|
+
YTBkODhhM2NlNjc3ZTFjMDA2OWMwMmY3NTU2Y2I4NjVhNTZkMzQ2MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjhiNTE1NzZjNjlmZTBkNjNmZGFkOWViMDU2ODI5YTdlNjRmNjFlZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzA0YjBjY2EyMzE4NTI5M2VmY2VmOGFmMzUxYjJjY2E2OGRlYjU2NzhmMzIw
|
10
|
+
YzUzMzdkYTJhYTgyNjMxNzQ2NWQxZmQzZDgxZjkxOTI3NGIzYzhmN2IzZDA1
|
11
|
+
MTlhNjhiNGEyMzhlYWQxODFmNjc1YTlmMTEzYzY5ZTBjY2Q3ZmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzRkMTg2MTRkYzVkMzMwNWFlNDNhMjFkMzc3YzgwYTJkYzljNTcyM2RjM2Y5
|
14
|
+
MWRkNWZjZjBmZTVlZDlmYjZlNzhmMWJhOGRjZmUxOWU4YjU0OWVkODA5NjMz
|
15
|
+
NWNjZDhiMTQzODM0ZDU5ZDdlNzI5M2U0ZDllZDA4ZTc2Mjg2MmE=
|
data/README.md
CHANGED
@@ -46,6 +46,6 @@ Warning: Google documentation links sometimes move without good redirection.
|
|
46
46
|
* [Google Apps Provisioning API v2](https://developers.google.com/google-apps/provisioning/)
|
47
47
|
|
48
48
|
### Todo
|
49
|
-
*
|
49
|
+
* Provisioning API is deprecated, use Directory API
|
50
50
|
* Possibly integrate [Google Apps Calendar Resource API](https://developers.google.com/google-apps/calendar-resource/)
|
51
51
|
* Error handling
|
@@ -5,10 +5,24 @@ module Gaah
|
|
5
5
|
class Api
|
6
6
|
class << self
|
7
7
|
def users
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
fetch_users("https://apps-apis.google.com/a/feeds/#{Gaah.domain}/user/2.0")
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def fetch_users(url)
|
14
|
+
xml = ApiClient.instance.get(url)
|
15
|
+
parsed = Nokogiri::XML(xml)
|
16
|
+
|
17
|
+
current_users = User.batch_create(parsed/:entry)
|
18
|
+
next_link = (parsed/'link[rel=next]').first
|
19
|
+
|
20
|
+
if next_link.nil?
|
21
|
+
current_users
|
22
|
+
else
|
23
|
+
url = next_link.attr('href')
|
24
|
+
current_users + fetch_users(url)
|
25
|
+
end
|
12
26
|
end
|
13
27
|
end
|
14
28
|
end
|
data/lib/gaah/version.rb
CHANGED