restpack-group-client 0.0.31 → 0.0.32
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.
@@ -56,15 +56,7 @@ module RestPack
|
|
56
56
|
|
57
57
|
#TODO: GJ: get related users (from cache)
|
58
58
|
user_ids = memberships.map { |m| m.user_id }
|
59
|
-
|
60
|
-
|
61
|
-
users = []
|
62
|
-
#TODO: GJ: use the user gem
|
63
|
-
user_ids.each do |user_id|
|
64
|
-
json = '{"user":{"id":9,"channel_id":31,"description":null,"email":"gavinjoyce@gmail.com","image":"https://lh4.googleusercontent.com/-QUimGD9w7w8/AAAAAAAAAAI/AAAAAAAAGUo/4HBZhyAgBps/photo.jpg","location":null,"name":"Gavin Joyce","nickname":null,"url":"/api/v1/users/9.json"}}'
|
65
|
-
users << Yajl::Parser.parse(json, :symbolize_keys => true)[:user]
|
66
|
-
end
|
67
|
-
|
59
|
+
users = UserApi.new(@options.replace(domain: 'localhost:1112')).show_multiple(user_ids) #TODO: GJ: replace service domain in options
|
68
60
|
|
69
61
|
{
|
70
62
|
groups: groups,
|
@@ -76,6 +68,20 @@ module RestPack
|
|
76
68
|
end
|
77
69
|
end
|
78
70
|
|
71
|
+
class UserApi < RestPack::Client::Api
|
72
|
+
def show_multiple(ids)
|
73
|
+
p "GJ: get User IDs: #{ids}"
|
74
|
+
ids.each do |id|
|
75
|
+
users = []
|
76
|
+
#TODO: GJ: use the user gem
|
77
|
+
response = http_get("/api/v1/users/#{id}.json")
|
78
|
+
p response
|
79
|
+
|
80
|
+
users << Yajl::Parser.parse(response, :symbolize_keys => true)[:user]
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
79
85
|
end
|
80
86
|
|
81
87
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restpack-group-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.32
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|