chatwork 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b0e86371dbc01a5f67b01eb15d6681dc2fb5cded54530727da8b9a07d20946c
4
- data.tar.gz: e79d2f3a743ff131ec83bd81a6e61a16cca8b5c484eae0eb635e23a68b078902
3
+ metadata.gz: 6eccb9b06e5202c49a36499e619b184a4d4aebdab605f4e97dc4640beee8c73f
4
+ data.tar.gz: 55c4aa1047be833291053281b4ab5d12c40abe9c47dc0c35d0b253f41d4b9ff3
5
5
  SHA512:
6
- metadata.gz: 45468727cbee93fd0192a3912462eda9a0a00a032a4a867a5bf23ab6ed3982496dcd96f2d61f85a4d5cc1f24cd20137e33100a37d41eab451de6873145d34f6b
7
- data.tar.gz: 89ec1973fdb802b11daf722250246f6bca7b77f963fcfd73d15b7cc07d61c27e852938d9f9bf45334adb69386a3e3236df6d7a790f726fe2c6ff845ea8b35675
6
+ metadata.gz: 47ded73fb118ed675a0b6e87736b7dad548255cb8659881c7e94a87ae6d006c529499ad6a676d581ca1b30fbfc4acbfe03a25588fa06b56bb30dcff307290703
7
+ data.tar.gz: a05e19a3c432eec52ca84671aa19f1c7d0af0769b43f1419027517b26e32458bd2472090ce70e490788c961e5a7a2961e15704155f350ec26d106ef1bf009379
@@ -1,26 +1,31 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.1
5
- - 2.2
6
- - 2.3
7
- - 2.4.1
8
- - 2.5.0
9
- - ruby-head
4
+ - 2.2
5
+ - 2.3
6
+ - 2.4
7
+ - 2.5
8
+ - 2.6
9
+ - ruby-head
10
10
  bundler_args: "--jobs=2"
11
11
  cache: bundler
12
12
  before_install:
13
- - gem update --system --no-document
14
- - gem install bundler -v 1.16.1 --no-document
13
+ - travis_retry gem update --system || travis_retry gem update --system 2.7.8
14
+ - travis_retry gem install bundler --no-document || travis_retry gem install bundler --no-document -v 1.17.3
15
15
  script:
16
- - bundle exec rake spec
17
- - bundle exec rubocop
16
+ - bundle exec rake spec
17
+ - bundle exec rubocop
18
18
  branches:
19
19
  only:
20
- - master
20
+ - master
21
21
  matrix:
22
22
  allow_failures:
23
- - rvm: ruby-head
23
+ - rvm: ruby-head
24
+ include:
25
+ - rvm: 2.6
26
+ env: RUBYOPT="--jit"
27
+ - rvm: ruby-head
28
+ env: RUBYOPT="--jit"
24
29
  env:
25
30
  global:
26
31
  secure: Ntdheemdu1GavPR/3kPfQg1tR13FTP0jE9KxsSKcG32VbIzM69l22OXXwYttFexMhA1dMNytv5bKGIszeiO+YjwzDXkcDHF7ZULc24epsGCOVfNax4g47Q+Lgt2kpAsx8V/8/SIpK7VeBhc2nPvhAKPjTZ8ddN2gLHk4wifLRFA=
@@ -1,6 +1,12 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
- [Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.10.0...master)
3
+ [Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.11.0...master)
4
+
5
+ ## v0.11.0
6
+ [Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.10.0...v0.11.0)
7
+
8
+ * Support task complete/incomplete api
9
+ * https://github.com/asonas/chatwork-ruby/pull/64
4
10
 
5
11
  ## v0.10.0
6
12
  [Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.9.0...v0.10.0)
data/Gemfile CHANGED
@@ -14,3 +14,10 @@ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.2")
14
14
  gem "activesupport", "< 5.0.0", group: :development
15
15
  end
16
16
  end
17
+
18
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.5.0")
19
+ group :test do
20
+ # NOTE: unparser v0.3.0+ requires Ruby 2.5+
21
+ gem "unparser", "< 0.3.0"
22
+ end
23
+ end
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "hashie"
23
23
 
24
24
  spec.add_development_dependency "activesupport"
25
- spec.add_development_dependency "bundler", "~> 1.3"
25
+ spec.add_development_dependency "bundler", ">= 1.3"
26
26
  spec.add_development_dependency "coveralls"
27
27
  spec.add_development_dependency "dotenv"
28
28
  spec.add_development_dependency "faraday_curl"
@@ -106,4 +106,27 @@ module ChatWork::Client::TaskMethods
106
106
  def find_task(room_id:, task_id:, &block)
107
107
  get("/rooms/#{room_id}/tasks/#{task_id}", &block)
108
108
  end
109
+
110
+ # Update task completion status
111
+ #
112
+ # @see http://developer.chatwork.com/ja/endpoint_rooms.html#PUT-rooms-room_id-tasks-task_id-status
113
+ # @see http://download.chatwork.com/ChatWork_API_Documentation.pdf
114
+ #
115
+ # @param room_id [Integer]
116
+ # @param task_id [Integer]
117
+ # @param body [String] Task completion status (e.g. `open`, `done`)
118
+ #
119
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
120
+ # @yieldparam response_body [Hashie::Mash] response body
121
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)
122
+ #
123
+ # @return [Hashie::Mash]
124
+ #
125
+ # @example response format
126
+ # {
127
+ # "task_id": 1234
128
+ # }
129
+ def update_task_status(room_id:, task_id:, body:, &block)
130
+ put("/rooms/#{room_id}/tasks/#{task_id}/status", body: body, &block)
131
+ end
109
132
  end
@@ -101,5 +101,28 @@ module ChatWork
101
101
  def self.find(room_id:, task_id:, &block)
102
102
  ChatWork.client.find_task(room_id: room_id, task_id: task_id, &block)
103
103
  end
104
+
105
+ # Update task completion status
106
+ #
107
+ # @see http://developer.chatwork.com/ja/endpoint_rooms.html#PUT-rooms-room_id-tasks-task_id-status
108
+ # @see http://download.chatwork.com/ChatWork_API_Documentation.pdf
109
+ #
110
+ # @param room_id [Integer]
111
+ # @param task_id [Integer]
112
+ # @param body [String] Task completion status (e.g. `open`, `done`)
113
+ #
114
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
115
+ # @yieldparam response_body [Hashie::Mash] response body
116
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)
117
+ #
118
+ # @return [Hashie::Mash]
119
+ #
120
+ # @example response format
121
+ # {
122
+ # "task_id": 1234
123
+ # }
124
+ def self.update_status(room_id:, task_id:, body:, &block)
125
+ ChatWork.client.update_task_status(room_id: room_id, task_id: task_id, body: body, &block)
126
+ end
104
127
  end
105
128
  end
@@ -1,3 +1,3 @@
1
1
  module ChatWork
2
- VERSION = "0.10.0".freeze
2
+ VERSION = "0.11.0".freeze
3
3
  end
@@ -25,7 +25,7 @@ describe ChatWork::Client::MessageMethods do
25
25
  subject { client.create_message(room_id: room_id, body: body, self_unread: self_unread, &block) }
26
26
 
27
27
  let(:room_id) { 123 }
28
- let(:body) { "Hello ChatWork!" }
28
+ let(:body) { "Hello Chatwork!" }
29
29
  let(:self_unread) { false }
30
30
 
31
31
  before do
@@ -79,7 +79,7 @@ describe ChatWork::Client::MessageMethods do
79
79
 
80
80
  let(:room_id) { 123 }
81
81
  let(:message_id) { "101" }
82
- let(:body) { "Hello ChatWork!" }
82
+ let(:body) { "Hello Chatwork!" }
83
83
 
84
84
  before do
85
85
  stub_chatwork_request(:put, "/rooms/#{room_id}/messages/#{message_id}", "/rooms/{room_id}/messages/{message_id}")
@@ -77,4 +77,25 @@ describe ChatWork::Client::TaskMethods do
77
77
 
78
78
  it_behaves_like :a_chatwork_api, :get, "/rooms/{room_id}/tasks/{task_id}"
79
79
  end
80
+
81
+ describe "#update_task_status", type: :api do
82
+ subject do
83
+ client.update_task_status(
84
+ room_id: room_id,
85
+ task_id: task_id,
86
+ body: body,
87
+ &block
88
+ )
89
+ end
90
+
91
+ let(:room_id) { 123 }
92
+ let(:task_id) { 3 }
93
+ let(:body) { "done" }
94
+
95
+ before do
96
+ stub_chatwork_request(:put, "/rooms/#{room_id}/tasks/#{task_id}/status", "/rooms/{room_id}/tasks/{task_id}/status")
97
+ end
98
+
99
+ it_behaves_like :a_chatwork_api, :put, "/rooms/{room_id}/tasks/{task_id}/status"
100
+ end
80
101
  end
@@ -25,7 +25,7 @@ describe ChatWork::Message do
25
25
  subject { ChatWork::Message.create(room_id: room_id, body: body, self_unread: self_unread, &block) }
26
26
 
27
27
  let(:room_id) { 123 }
28
- let(:body) { "Hello ChatWork!" }
28
+ let(:body) { "Hello Chatwork!" }
29
29
  let(:self_unread) { false }
30
30
 
31
31
  before do
@@ -79,7 +79,7 @@ describe ChatWork::Message do
79
79
 
80
80
  let(:room_id) { 123 }
81
81
  let(:message_id) { "101" }
82
- let(:body) { "Hello ChatWork!" }
82
+ let(:body) { "Hello Chatwork!" }
83
83
 
84
84
  before do
85
85
  stub_chatwork_request(:put, "/rooms/#{room_id}/messages/#{message_id}", "/rooms/{room_id}/messages/{message_id}")
@@ -77,4 +77,25 @@ describe ChatWork::Task do
77
77
 
78
78
  it_behaves_like :a_chatwork_api, :get, "/rooms/{room_id}/tasks/{task_id}"
79
79
  end
80
+
81
+ describe ".update_status", type: :api do
82
+ subject do
83
+ ChatWork::Task.update_status(
84
+ room_id: room_id,
85
+ task_id: task_id,
86
+ body: body,
87
+ &block
88
+ )
89
+ end
90
+
91
+ let(:room_id) { 123 }
92
+ let(:task_id) { 3 }
93
+ let(:body) { "done" }
94
+
95
+ before do
96
+ stub_chatwork_request(:put, "/rooms/#{room_id}/tasks/#{task_id}/status", "/rooms/{room_id}/tasks/{task_id}/status")
97
+ end
98
+
99
+ it_behaves_like :a_chatwork_api, :put, "/rooms/{room_id}/tasks/{task_id}/status"
100
+ end
80
101
  end
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.10.0
4
+ version: 0.11.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: 2018-08-01 00:00:00.000000000 Z
12
+ date: 2019-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -71,14 +71,14 @@ dependencies:
71
71
  name: bundler
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "~>"
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '1.3'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - "~>"
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '1.3'
84
84
  - !ruby/object:Gem::Dependency
@@ -371,8 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
371
371
  - !ruby/object:Gem::Version
372
372
  version: '0'
373
373
  requirements: []
374
- rubyforge_project:
375
- rubygems_version: 2.7.6
374
+ rubygems_version: 3.0.1
376
375
  signing_key:
377
376
  specification_version: 4
378
377
  summary: Ruby bindings of ChatWork API