chatwork 0.11.0 → 0.12.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6eccb9b06e5202c49a36499e619b184a4d4aebdab605f4e97dc4640beee8c73f
4
- data.tar.gz: 55c4aa1047be833291053281b4ab5d12c40abe9c47dc0c35d0b253f41d4b9ff3
3
+ metadata.gz: 64d1eb9fd81f641753a8e6689001e02d65b1f2845c10dad8dfcc7d0c0af068ea
4
+ data.tar.gz: b1b7a40e94579a42352572d17dcbdd336a3660c8d3b4917e9a9b9a8016021001
5
5
  SHA512:
6
- metadata.gz: 47ded73fb118ed675a0b6e87736b7dad548255cb8659881c7e94a87ae6d006c529499ad6a676d581ca1b30fbfc4acbfe03a25588fa06b56bb30dcff307290703
7
- data.tar.gz: a05e19a3c432eec52ca84671aa19f1c7d0af0769b43f1419027517b26e32458bd2472090ce70e490788c961e5a7a2961e15704155f350ec26d106ef1bf009379
6
+ metadata.gz: 877a8e143ad2280ad801b827a7a6138edfe2c4dbfcd4676bb7657f68e51b35b83ae81e7dd810d5d32f00f4a7370cb00c61883334c02255c15ed1ee5c12d50b16
7
+ data.tar.gz: 98ee78d7fec6e0b8cf6dae6b3123363fb630179da15db155b5f00bb47b57e5704b37a969b30d2502c9f6f9f14abd02833de5609583163dae1ea6a1714ce4f66f
@@ -8,3 +8,6 @@ require: rubocop-rspec
8
8
  # module name is `ChatWork`, but I want to use `chatwork` as filename
9
9
  RSpec/FilePath:
10
10
  Enabled: false
11
+
12
+ Metrics/ParameterLists:
13
+ Max: 6
@@ -1,6 +1,12 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
- [Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.11.0...master)
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 [Integer]
50
- # @param body [String] Task description
51
- # @param to_ids [Array<Integer>, String] Account ID of the person/people responsible to complete the task
52
- # @param limit [Time, Integer] When the task is due
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)
@@ -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 [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
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)
@@ -1,3 +1,3 @@
1
1
  module ChatWork
2
- VERSION = "0.11.0".freeze
2
+ VERSION = "0.12.0".freeze
3
3
  end
@@ -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: room_id,
29
- body: body,
30
- to_ids: to_ids,
31
- limit: 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) { 123 }
37
- let(:body) { "Buy milk" }
38
- let(:to_ids) { "1,3,6" }
39
- let(:limit) { "1385996399" }
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: room_id,
29
- body: body,
30
- to_ids: to_ids,
31
- limit: 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) { 123 }
37
- let(:body) { "Buy milk" }
38
- let(:to_ids) { "1,3,6" }
39
- let(:limit) { "1385996399" }
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.11.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-02-24 00:00:00.000000000 Z
12
+ date: 2019-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday