chatwork 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/chatwork.rb +1 -0
- data/lib/chatwork/chatwork_error.rb +2 -0
- data/lib/chatwork/member.rb +5 -5
- data/lib/chatwork/version.rb +1 -1
- data/spec/lib/chatwork/chatwork_error_spec.rb +11 -1
- data/spec/lib/support/utils/raml_parser_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52031d9d56999ff66bad2a4617fb83027540f1f32dd17a5bfa9d6920a94aaf9e
|
4
|
+
data.tar.gz: 90555909fa6e8990000d9c4eef8fd94e599a01b0a647a20ca09135b0bb65d435
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bfdc23a78474cd708e33b97d906ed6ada4aefa15d1028e85826a501efbe02aa5e5567fd69d8fd25faf1ee4a28661a994a13474a50e51d007eee1ab8c2b7ba0c
|
7
|
+
data.tar.gz: 5eb280a4f59d87e467f33510f0d6ee799eed7d1e10e49b72c3dd5d7e48eb7748578e605510fc390143409cb50aee8970ccf8108f67c48dfabb1bb38cf810258d
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
## Unreleased
|
3
|
-
[Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.6.
|
3
|
+
[Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.6.2...master)
|
4
|
+
|
5
|
+
## v0.6.2
|
6
|
+
[Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.6.1...v0.6.2)
|
7
|
+
|
8
|
+
* Fixed. `NoMethodError` when error response is empty
|
9
|
+
* https://github.com/asonas/chatwork-ruby/pull/43
|
10
|
+
* Fixed. uninitialized constant `ChatWork::AuthenticateError` when other error class has not been called at all
|
11
|
+
* https://github.com/asonas/chatwork-ruby/pull/45
|
4
12
|
|
5
13
|
## v0.6.1
|
6
14
|
[Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.6.0...v0.6.1)
|
data/lib/chatwork.rb
CHANGED
@@ -5,6 +5,7 @@ module ChatWork
|
|
5
5
|
autoload :BaseClient, "chatwork/base_client"
|
6
6
|
autoload :APIConnectionError, "chatwork/chatwork_error"
|
7
7
|
autoload :APIError, "chatwork/chatwork_error"
|
8
|
+
autoload :AuthenticateError, "chatwork/chatwork_error"
|
8
9
|
autoload :ChatWorkError, "chatwork/chatwork_error"
|
9
10
|
autoload :Client, "chatwork/client"
|
10
11
|
autoload :Contacts, "chatwork/contacts"
|
data/lib/chatwork/member.rb
CHANGED
@@ -42,11 +42,11 @@ module ChatWork
|
|
42
42
|
# @return [Hashie::Mash]
|
43
43
|
#
|
44
44
|
# @example response format
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
45
|
+
# {
|
46
|
+
# "admin": [123, 542, 1001],
|
47
|
+
# "member": [10, 103],
|
48
|
+
# "readonly": [6, 11]
|
49
|
+
# }
|
50
50
|
def self.update_all(room_id:, members_admin_ids:, members_member_ids: nil, members_readonly_ids: nil)
|
51
51
|
params = {
|
52
52
|
members_admin_ids: Array(members_admin_ids).join(","),
|
data/lib/chatwork/version.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
describe ChatWork::ChatWorkError do
|
2
2
|
describe ".from_response" do
|
3
|
-
subject { ChatWork::ChatWorkError.from_response(status,
|
3
|
+
subject { ChatWork::ChatWorkError.from_response(status, body_mash, headers) }
|
4
|
+
|
5
|
+
let(:body_mash) { Hashie::Mash.new(body) }
|
4
6
|
|
5
7
|
context "with WWW-Authenticate header" do
|
6
8
|
let(:status) { 401 }
|
@@ -42,6 +44,14 @@ describe ChatWork::ChatWorkError do
|
|
42
44
|
its(:error_description) { should eq "The client ID `client_id` is unknown." }
|
43
45
|
its(:error_response) { should eq body }
|
44
46
|
end
|
47
|
+
|
48
|
+
context "when body is nil" do
|
49
|
+
let(:status) { 401 }
|
50
|
+
let(:body_mash) { nil }
|
51
|
+
let(:headers) { {} }
|
52
|
+
|
53
|
+
it { should be_an_instance_of ChatWork::APIConnectionError }
|
54
|
+
end
|
45
55
|
end
|
46
56
|
|
47
57
|
describe ChatWork::AuthenticateError do
|
@@ -5,7 +5,7 @@ RSpec.describe RamlParser do
|
|
5
5
|
let(:verb) { :get }
|
6
6
|
let(:path) { "/rooms/{room_id}/members" }
|
7
7
|
|
8
|
-
its(["description"]) { should eq "
|
8
|
+
its(["description"]) { should eq "チャットのメンバー一覧を取得" }
|
9
9
|
its(["is"]) { should eq ["room_member_list_response", "unauthorized_response"] }
|
10
10
|
end
|
11
11
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
if ENV["CI"]
|
2
|
+
require "simplecov"
|
2
3
|
require "coveralls"
|
3
|
-
|
4
|
+
|
5
|
+
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
6
|
+
SimpleCov.start do
|
7
|
+
%w[spec].each do |ignore_path|
|
8
|
+
add_filter(ignore_path)
|
9
|
+
end
|
10
|
+
end
|
4
11
|
end
|
5
12
|
|
6
13
|
$LOAD_PATH << File.expand_path(File.join("..", "..", "lib"), __FILE__)
|
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.6.
|
4
|
+
version: 0.6.2
|
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-01-
|
12
|
+
date: 2018-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -331,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
331
331
|
version: '0'
|
332
332
|
requirements: []
|
333
333
|
rubyforge_project:
|
334
|
-
rubygems_version: 2.7.
|
334
|
+
rubygems_version: 2.7.4
|
335
335
|
signing_key:
|
336
336
|
specification_version: 4
|
337
337
|
summary: Ruby bindings of ChatWork API
|