chatwork 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +7 -1
- data/lib/chatwork/client/task_methods.rb +11 -7
- data/lib/chatwork/task.rb +11 -8
- data/lib/chatwork/version.rb +1 -1
- data/spec/lib/chatwork/client/task_methods_spec.rb +10 -8
- data/spec/lib/chatwork/task_spec.rb +10 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64d1eb9fd81f641753a8e6689001e02d65b1f2845c10dad8dfcc7d0c0af068ea
|
4
|
+
data.tar.gz: b1b7a40e94579a42352572d17dcbdd336a3660c8d3b4917e9a9b9a8016021001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 877a8e143ad2280ad801b827a7a6138edfe2c4dbfcd4676bb7657f68e51b35b83ae81e7dd810d5d32f00f4a7370cb00c61883334c02255c15ed1ee5c12d50b16
|
7
|
+
data.tar.gz: 98ee78d7fec6e0b8cf6dae6b3123363fb630179da15db155b5f00bb47b57e5704b37a969b30d2502c9f6f9f14abd02833de5609583163dae1ea6a1714ce4f66f
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
## Unreleased
|
3
|
-
[Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.
|
3
|
+
[Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.12.0...master)
|
4
|
+
|
5
|
+
## v0.12.0
|
6
|
+
[Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.11.0...v0.12.0)
|
7
|
+
|
8
|
+
* Add 'limit_type' to task read/write API.
|
9
|
+
* https://github.com/asonas/chatwork-ruby/pull/66
|
4
10
|
|
5
11
|
## v0.11.0
|
6
12
|
[Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.10.0...v0.11.0)
|
@@ -34,7 +34,8 @@ module ChatWork::Client::TaskMethods
|
|
34
34
|
# "message_id": "13",
|
35
35
|
# "body": "buy milk",
|
36
36
|
# "limit_time": 1384354799,
|
37
|
-
# "status": "open"
|
37
|
+
# "status": "open",
|
38
|
+
# "limit_type": "date"
|
38
39
|
# }
|
39
40
|
# ]
|
40
41
|
def get_tasks(room_id:, account_id:, assigned_by_account_id: nil, status: nil, &block)
|
@@ -46,10 +47,11 @@ module ChatWork::Client::TaskMethods
|
|
46
47
|
# @see http://developer.chatwork.com/ja/endpoint_rooms.html#POST-rooms-room_id-tasks
|
47
48
|
# @see http://download.chatwork.com/ChatWork_API_Documentation.pdf
|
48
49
|
#
|
49
|
-
# @param room_id
|
50
|
-
# @param body
|
51
|
-
# @param to_ids
|
52
|
-
# @param limit
|
50
|
+
# @param room_id [Integer]
|
51
|
+
# @param body [String] Task description
|
52
|
+
# @param to_ids [Array<Integer>, String] Account ID of the person/people responsible to complete the task
|
53
|
+
# @param limit [Time, Integer] When the task is due
|
54
|
+
# @param limit_type [String] Type of task deadline (e.g. `none`, `date`, `time`)
|
53
55
|
#
|
54
56
|
# @yield [response_body, response_header] if block was given, return response body and response header through block arguments
|
55
57
|
# @yieldparam response_body [Hashie::Mash] response body
|
@@ -61,10 +63,11 @@ module ChatWork::Client::TaskMethods
|
|
61
63
|
# {
|
62
64
|
# "task_ids": [123,124]
|
63
65
|
# }
|
64
|
-
def create_task(room_id:, body:, to_ids:, limit: nil, &block)
|
66
|
+
def create_task(room_id:, body:, to_ids:, limit: nil, limit_type: nil, &block)
|
65
67
|
params = {
|
66
68
|
body: body,
|
67
69
|
to_ids: Array(to_ids).join(","),
|
70
|
+
limit_type: limit_type,
|
68
71
|
}
|
69
72
|
params[:limit] = limit.to_i if limit
|
70
73
|
|
@@ -101,7 +104,8 @@ module ChatWork::Client::TaskMethods
|
|
101
104
|
# "message_id": "13",
|
102
105
|
# "body": "buy milk",
|
103
106
|
# "limit_time": 1384354799,
|
104
|
-
# "status": "open"
|
107
|
+
# "status": "open",
|
108
|
+
# "limit_type": "date"
|
105
109
|
# }
|
106
110
|
def find_task(room_id:, task_id:, &block)
|
107
111
|
get("/rooms/#{room_id}/tasks/#{task_id}", &block)
|
data/lib/chatwork/task.rb
CHANGED
@@ -35,7 +35,8 @@ module ChatWork
|
|
35
35
|
# "message_id": "13",
|
36
36
|
# "body": "buy milk",
|
37
37
|
# "limit_time": 1384354799,
|
38
|
-
# "status": "open"
|
38
|
+
# "status": "open",
|
39
|
+
# "limit_type": "date"
|
39
40
|
# }
|
40
41
|
# ]
|
41
42
|
def self.get(room_id:, account_id:, assigned_by_account_id: nil, status: nil, &block)
|
@@ -47,10 +48,11 @@ module ChatWork
|
|
47
48
|
# @see http://developer.chatwork.com/ja/endpoint_rooms.html#POST-rooms-room_id-tasks
|
48
49
|
# @see http://download.chatwork.com/ChatWork_API_Documentation.pdf
|
49
50
|
#
|
50
|
-
# @param room_id
|
51
|
-
# @param body
|
52
|
-
# @param to_ids
|
53
|
-
# @param limit
|
51
|
+
# @param room_id [Integer]
|
52
|
+
# @param body [String] Task description
|
53
|
+
# @param to_ids [Array<Integer>, String] Account ID of the person/people responsible to complete the task
|
54
|
+
# @param limit [Time, Integer] When the task is due
|
55
|
+
# @param limit_type [String] Type of task deadline (e.g. `none`, `date`, `time`)
|
54
56
|
#
|
55
57
|
# @yield [response_body, response_header] if block was given, return response body and response header through block arguments
|
56
58
|
# @yieldparam response_body [Hashie::Mash] response body
|
@@ -62,8 +64,8 @@ module ChatWork
|
|
62
64
|
# {
|
63
65
|
# "task_ids": [123,124]
|
64
66
|
# }
|
65
|
-
def self.create(room_id:, body:, to_ids:, limit: nil, &block)
|
66
|
-
ChatWork.client.create_task(room_id: room_id, body: body, to_ids: to_ids, limit: limit, &block)
|
67
|
+
def self.create(room_id:, body:, to_ids:, limit: nil, limit_type: nil, &block)
|
68
|
+
ChatWork.client.create_task(room_id: room_id, body: body, to_ids: to_ids, limit: limit, limit_type: limit_type, &block)
|
67
69
|
end
|
68
70
|
|
69
71
|
# Get information about the specified task
|
@@ -96,7 +98,8 @@ module ChatWork
|
|
96
98
|
# "message_id": "13",
|
97
99
|
# "body": "buy milk",
|
98
100
|
# "limit_time": 1384354799,
|
99
|
-
# "status": "open"
|
101
|
+
# "status": "open",
|
102
|
+
# "limit_type": "date"
|
100
103
|
# }
|
101
104
|
def self.find(room_id:, task_id:, &block)
|
102
105
|
ChatWork.client.find_task(room_id: room_id, task_id: task_id, &block)
|
data/lib/chatwork/version.rb
CHANGED
@@ -25,18 +25,20 @@ describe ChatWork::Client::TaskMethods do
|
|
25
25
|
describe "#create_task", type: :api do
|
26
26
|
subject do
|
27
27
|
client.create_task(
|
28
|
-
room_id:
|
29
|
-
body:
|
30
|
-
to_ids:
|
31
|
-
limit:
|
28
|
+
room_id: room_id,
|
29
|
+
body: body,
|
30
|
+
to_ids: to_ids,
|
31
|
+
limit: limit,
|
32
|
+
limit_type: limit_type,
|
32
33
|
&block
|
33
34
|
)
|
34
35
|
end
|
35
36
|
|
36
|
-
let(:room_id)
|
37
|
-
let(:body)
|
38
|
-
let(:to_ids)
|
39
|
-
let(:limit)
|
37
|
+
let(:room_id) { 123 }
|
38
|
+
let(:body) { "Buy milk" }
|
39
|
+
let(:to_ids) { "1,3,6" }
|
40
|
+
let(:limit) { "1385996399" }
|
41
|
+
let(:limit_type) { "time" }
|
40
42
|
|
41
43
|
before do
|
42
44
|
stub_chatwork_request(:post, "/rooms/#{room_id}/tasks", "/rooms/{room_id}/tasks")
|
@@ -25,18 +25,20 @@ describe ChatWork::Task do
|
|
25
25
|
describe ".create", type: :api do
|
26
26
|
subject do
|
27
27
|
ChatWork::Task.create(
|
28
|
-
room_id:
|
29
|
-
body:
|
30
|
-
to_ids:
|
31
|
-
limit:
|
28
|
+
room_id: room_id,
|
29
|
+
body: body,
|
30
|
+
to_ids: to_ids,
|
31
|
+
limit: limit,
|
32
|
+
limit_type: limit_type,
|
32
33
|
&block
|
33
34
|
)
|
34
35
|
end
|
35
36
|
|
36
|
-
let(:room_id)
|
37
|
-
let(:body)
|
38
|
-
let(:to_ids)
|
39
|
-
let(:limit)
|
37
|
+
let(:room_id) { 123 }
|
38
|
+
let(:body) { "Buy milk" }
|
39
|
+
let(:to_ids) { "1,3,6" }
|
40
|
+
let(:limit) { "1385996399" }
|
41
|
+
let(:limit_type) { "time" }
|
40
42
|
|
41
43
|
before do
|
42
44
|
stub_chatwork_request(:post, "/rooms/#{room_id}/tasks", "/rooms/{room_id}/tasks")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chatwork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- asonas
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|