esa 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +34 -4
- data/lib/esa/api_methods.rb +28 -8
- data/lib/esa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd41d60034de3867a3aa0c0448471d36c03cea83
|
4
|
+
data.tar.gz: 070a85d58193f6862f16e071b6604620da7c2293
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f769d8c2bcb7937595ff504d406616bd17a37a9fdc9c801ade8896ecff8015b9d7c85e7ef84054ac04eb2e69344d352ed4a6fc51f14cfa473cfaea26b3667035
|
7
|
+
data.tar.gz: 718e649d5044866dc5dbafbc4e1566744c6407b1d6a775b02d9dff5c78cdcbaed5aeaafd6e4caad64dac2f8bc3f359cfd64bbaf2a2d6a9141483918d827fcc93
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 0.0.6 (2015-06-21)
|
2
|
+
- [Support Comment API by fukayatsu · Pull Request #9 · esaio/esa-ruby](https://github.com/esaio/esa-ruby/pull/9)
|
3
|
+
|
1
4
|
## 0.0.5 (2015-05-21)
|
2
5
|
- [Use current_team! instead of current_team by fukayatsu · Pull Request #8 · esaio/esa-ruby](https://github.com/esaio/esa-ruby/pull/8)
|
3
6
|
|
data/README.md
CHANGED
@@ -21,30 +21,60 @@ Or install it yourself as:
|
|
21
21
|
## Usage
|
22
22
|
|
23
23
|
```ruby
|
24
|
+
# Initialization
|
24
25
|
client = Esa::Client.new(access_token: "<access_token>", current_team: 'foo')
|
26
|
+
|
27
|
+
# Team API
|
25
28
|
client.teams
|
26
29
|
#=> GET /v1/teams
|
27
30
|
|
28
31
|
client.team('bar')
|
29
32
|
#=> GET /v1/teams/bar
|
30
33
|
|
34
|
+
# Post API
|
31
35
|
client.posts
|
32
36
|
#=> GET /v1/teams/foo/posts
|
33
37
|
|
34
38
|
client.posts(q: 'in:help')
|
35
|
-
#=> GET /v1/teams/
|
39
|
+
#=> GET /v1/teams/foo/posts?q=in%3Ahelp
|
36
40
|
|
37
41
|
client.current_team = 'foobar'
|
38
|
-
|
42
|
+
post_number = 1
|
43
|
+
client.post(post_number)
|
39
44
|
#=> GET /v1/teams/foobar/posts/1
|
40
45
|
|
41
|
-
client.
|
46
|
+
client.create_post(name: 'foo')
|
47
|
+
#=> POST /v1/teams/foobar/posts
|
48
|
+
|
49
|
+
client.update_post(post_number, name: 'bar')
|
42
50
|
#=> PATCH /v1/teams/foobar/posts/1
|
43
51
|
|
44
|
-
client.delete_post(
|
52
|
+
client.delete_post(post_number)
|
45
53
|
#=> DELETE /v1/teams/foobar/posts/1
|
54
|
+
|
55
|
+
|
56
|
+
# Comment API
|
57
|
+
client.comments(post_number)
|
58
|
+
#=> GET /v1/teams/foobar/posts/1/comments
|
59
|
+
|
60
|
+
client.create_comment(post_number, body_md: 'baz')
|
61
|
+
#=> POST /v1/teams/foobar/posts/1/comments
|
62
|
+
|
63
|
+
comment_id = 123
|
64
|
+
client.comment(comment_id)
|
65
|
+
#=> GET /v1/teams/foobar/comments/123
|
66
|
+
|
67
|
+
client.update_comment(comment_id, body_md: 'bazbaz')
|
68
|
+
#=> PATCH /v1/teams/foobar/comments/123
|
69
|
+
|
70
|
+
client.delete_comment(comment_id)
|
71
|
+
#=> DELETE /v1/teams/foobar/comments/123
|
72
|
+
|
46
73
|
```
|
47
74
|
|
75
|
+
|
76
|
+
see also: [dev/api/v1(beta) - docs.esa.io](https://docs.esa.io/posts/102)
|
77
|
+
|
48
78
|
## Contributing
|
49
79
|
|
50
80
|
1. Fork it ( https://github.com/esaio/esa-ruby/fork )
|
data/lib/esa/api_methods.rb
CHANGED
@@ -4,28 +4,48 @@ module Esa
|
|
4
4
|
send_get("/v1/teams", params, headers)
|
5
5
|
end
|
6
6
|
|
7
|
-
def team(
|
8
|
-
send_get("/v1/teams/#{
|
7
|
+
def team(team_name, params = nil, headers = nil)
|
8
|
+
send_get("/v1/teams/#{team_name}", params, headers)
|
9
9
|
end
|
10
10
|
|
11
11
|
def posts(params = nil, headers = nil)
|
12
12
|
send_get("/v1/teams/#{current_team!}/posts", params, headers)
|
13
13
|
end
|
14
14
|
|
15
|
-
def post(
|
16
|
-
send_get("/v1/teams/#{current_team!}/posts/#{
|
15
|
+
def post(post_number, params = nil, headers = nil)
|
16
|
+
send_get("/v1/teams/#{current_team!}/posts/#{post_number}", params, headers)
|
17
17
|
end
|
18
18
|
|
19
19
|
def create_post(params = nil, headers = nil)
|
20
20
|
send_post("/v1/teams/#{current_team!}/posts", wrap(params, :post), headers)
|
21
21
|
end
|
22
22
|
|
23
|
-
def update_post(
|
24
|
-
send_patch("/v1/teams/#{current_team!}/posts/#{
|
23
|
+
def update_post(post_number, params = nil, headers = nil)
|
24
|
+
send_patch("/v1/teams/#{current_team!}/posts/#{post_number}", wrap(params, :post), headers)
|
25
25
|
end
|
26
26
|
|
27
|
-
def delete_post(
|
28
|
-
send_delete("/v1/teams/#{current_team!}/posts/#{
|
27
|
+
def delete_post(post_number, params = nil, headers = nil)
|
28
|
+
send_delete("/v1/teams/#{current_team!}/posts/#{post_number}", params, headers)
|
29
|
+
end
|
30
|
+
|
31
|
+
def comments(post_number, params = nil, headers = nil)
|
32
|
+
send_get("/v1/teams/#{current_team!}/posts/#{post_number}/comments", params, headers)
|
33
|
+
end
|
34
|
+
|
35
|
+
def comment(comment_id, params = nil, headers = nil)
|
36
|
+
send_get("/v1/teams/#{current_team!}/comments/#{comment_id}", params, headers)
|
37
|
+
end
|
38
|
+
|
39
|
+
def create_comment(post_number, params = nil, headers = nil)
|
40
|
+
send_post("/v1/teams/#{current_team!}/posts/#{post_number}/comments", wrap(params, :comment), headers)
|
41
|
+
end
|
42
|
+
|
43
|
+
def update_comment(comment_id, params = nil, headers = nil)
|
44
|
+
send_patch("/v1/teams/#{current_team!}/comments/#{comment_id}", wrap(params, :comment), headers)
|
45
|
+
end
|
46
|
+
|
47
|
+
def delete_comment(comment_id, params = nil, headers = nil)
|
48
|
+
send_delete("/v1/teams/#{current_team!}/comments/#{comment_id}", params, headers)
|
29
49
|
end
|
30
50
|
|
31
51
|
private
|
data/lib/esa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fukayatsu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|