cliskip2 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +4 -4
- data/README.md +15 -0
- data/lib/cliskip2/client.rb +13 -1
- data/lib/cliskip2/version.rb +2 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cliskip2 (0.0.
|
4
|
+
cliskip2 (0.0.13)
|
5
5
|
faraday_middleware (~> 0.8.7)
|
6
6
|
json (~> 1.7.3)
|
7
7
|
oauth (= 0.4.6)
|
@@ -11,12 +11,12 @@ GEM
|
|
11
11
|
remote: http://rubygems.org/
|
12
12
|
specs:
|
13
13
|
diff-lcs (1.1.3)
|
14
|
-
faraday (0.8.
|
14
|
+
faraday (0.8.6)
|
15
15
|
multipart-post (~> 1.1)
|
16
16
|
faraday_middleware (0.8.8)
|
17
17
|
faraday (>= 0.7.4, < 0.9)
|
18
|
-
json (1.7.
|
19
|
-
multipart-post (1.
|
18
|
+
json (1.7.7)
|
19
|
+
multipart-post (1.2.0)
|
20
20
|
oauth (0.4.6)
|
21
21
|
rake (0.9.2.2)
|
22
22
|
rake-compiler (0.8.1)
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Dependency Status](https://gemnasium.com/SonicGarden/cliskip2.png)](https://gemnasium.com/SonicGarden/cliskip2)
|
2
|
+
|
1
3
|
cliskip2
|
2
4
|
========
|
3
5
|
|
@@ -32,6 +34,10 @@ A Ruby wrapper for the SKIP2 REST APIs
|
|
32
34
|
client = Cliskip2::Client.new
|
33
35
|
client.update_user :user => {:name => 'foobar', :email => 'hoge@hoge.com'}
|
34
36
|
|
37
|
+
### update the email by params_email
|
38
|
+
client = Cliskip2::Client.new
|
39
|
+
client.update_email 'before@hoge.com', 'after@hoge.com'
|
40
|
+
|
35
41
|
### delete the user by email
|
36
42
|
client = Cliskip2::Client.new
|
37
43
|
client.delete_user :user => {:email => 'hoge@hoge.com'}
|
@@ -55,3 +61,12 @@ A Ruby wrapper for the SKIP2 REST APIs
|
|
55
61
|
community = client.search_communities({:search => {:name => 'I love ruby'} }).first
|
56
62
|
member = client.get_community_member(community, {:email => 'hoge@hoge.com'})
|
57
63
|
client.leave_community(community, member)
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
## Update rubygems
|
70
|
+
vi lib/cliskip2/version.rb
|
71
|
+
bundle exec rake build
|
72
|
+
bundle exec rake release
|
data/lib/cliskip2/client.rb
CHANGED
@@ -67,6 +67,18 @@ module Cliskip2
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
# Update the email by params
|
71
|
+
# @return [Cliskip2::User]
|
72
|
+
def update_email current_email, future_email
|
73
|
+
if user = get_user(:email => current_email)
|
74
|
+
params = {:user => {:email => future_email}}
|
75
|
+
user_attr = put("/admin/tenants/#{current_user.tenant_id}/users/#{user.id}.json", params)
|
76
|
+
Cliskip2::User.new(user_attr['user'])
|
77
|
+
else
|
78
|
+
nil
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
70
82
|
def delete_user params
|
71
83
|
if user = get_user(:email => params[:user][:email])
|
72
84
|
user_attr = delete("/admin/tenants/#{current_user.tenant_id}/users/#{user.id}.json")
|
@@ -153,7 +165,7 @@ module Cliskip2
|
|
153
165
|
# Join the community by the target-community and params
|
154
166
|
# @return [Cliskip2::CommunityParticipation]
|
155
167
|
def join_community community, user, params
|
156
|
-
community_participation_attr = post("/tenants/#{current_user.tenant_id}/communities/#{community.id}/community_participations.json", {:community_participation => {:user_id => user.id}}.merge(params))
|
168
|
+
community_participation_attr = post("/tenants/#{current_user.tenant_id}/communities/#{community.id}/community_participations.json", {:community_participation => {:user_id => user.id}}.merge(params))
|
157
169
|
Cliskip2::CommunityParticipation.new(community_participation_attr['community_participation'])
|
158
170
|
end
|
159
171
|
|
data/lib/cliskip2/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cliskip2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
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:
|
12
|
+
date: 2013-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday_middleware
|
@@ -163,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: '0'
|
164
164
|
segments:
|
165
165
|
- 0
|
166
|
-
hash:
|
166
|
+
hash: 2976103386856856601
|
167
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
168
|
none: false
|
169
169
|
requirements:
|
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
version: '0'
|
173
173
|
segments:
|
174
174
|
- 0
|
175
|
-
hash:
|
175
|
+
hash: 2976103386856856601
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project: cliskip2
|
178
178
|
rubygems_version: 1.8.23
|