chatwork 0.12.0 → 0.12.1

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: 64d1eb9fd81f641753a8e6689001e02d65b1f2845c10dad8dfcc7d0c0af068ea
4
- data.tar.gz: b1b7a40e94579a42352572d17dcbdd336a3660c8d3b4917e9a9b9a8016021001
3
+ metadata.gz: 315bd80bfb5a763374614ae62995c7fa8331cd9431b8a615da395c584c1a0428
4
+ data.tar.gz: 461aa370bc116b8965a67911cae2d0faac8b6ef7c575ddd1563ec167e1ec3530
5
5
  SHA512:
6
- metadata.gz: 877a8e143ad2280ad801b827a7a6138edfe2c4dbfcd4676bb7657f68e51b35b83ae81e7dd810d5d32f00f4a7370cb00c61883334c02255c15ed1ee5c12d50b16
7
- data.tar.gz: 98ee78d7fec6e0b8cf6dae6b3123363fb630179da15db155b5f00bb47b57e5704b37a969b30d2502c9f6f9f14abd02833de5609583163dae1ea6a1714ce4f66f
6
+ metadata.gz: ee54ec2f352176209194eacd2dc082e693849194078e274715c93db8eda11fd929dfc90774a65819b4cb749c6c3b023d649c51a3329d73425445de7bef8c9b2b
7
+ data.tar.gz: c1aaeb29786e2169ff1d585710c3e04692b5409984662c2e856410cab3e4879e44033d533b2237bab3475da9f7284b7e9366f2b088c97a621b672468b9fd759b
@@ -13,7 +13,7 @@ before_install:
13
13
  - travis_retry gem update --system || travis_retry gem update --system 2.7.8
14
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
16
+ - RUBYOPT=$RSPEC_RUBYOPT bundle exec rake spec
17
17
  - bundle exec rubocop
18
18
  branches:
19
19
  only:
@@ -23,9 +23,9 @@ matrix:
23
23
  - rvm: ruby-head
24
24
  include:
25
25
  - rvm: 2.6
26
- env: RUBYOPT="--jit"
26
+ env: RSPEC_RUBYOPT="--jit"
27
27
  - rvm: ruby-head
28
- env: RUBYOPT="--jit"
28
+ env: RSPEC_RUBYOPT="--jit"
29
29
  env:
30
30
  global:
31
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.12.0...master)
3
+ [Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.12.1...master)
4
+
5
+ ## v0.12.1
6
+ [Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.12.0...v0.12.1)
7
+
8
+ * Fixed. set status code and body when unexpected error is occurred
9
+ * https://github.com/asonas/chatwork-ruby/pull/68
4
10
 
5
11
  ## v0.12.0
6
12
  [Full Changelog](https://github.com/asonas/chatwork-ruby/compare/v0.11.0...v0.12.0)
@@ -40,7 +40,12 @@ module ChatWork
40
40
 
41
41
  def initialize(message, original_error = nil)
42
42
  @original_error = original_error
43
- super(message)
43
+
44
+ if original_error && original_error.response.is_a?(Hash)
45
+ super(message, original_error.response[:status], original_error.response[:body])
46
+ else
47
+ super(message)
48
+ end
44
49
  end
45
50
  end
46
51
 
@@ -1,3 +1,3 @@
1
1
  module ChatWork
2
- VERSION = "0.12.0".freeze
2
+ VERSION = "0.12.1".freeze
3
3
  end
@@ -74,4 +74,18 @@ describe ChatWork::ChatWorkError do
74
74
  its(:error_response) { should eq ["Invalid API Token"] }
75
75
  end
76
76
  end
77
+
78
+ describe ChatWork::APIConnectionError do
79
+ describe ".faraday_error" do
80
+ subject { ChatWork::APIConnectionError.faraday_error(error) }
81
+
82
+ let(:error) do
83
+ Faraday::ResourceNotFound.new(status: 404, body: "Not found")
84
+ end
85
+
86
+ its(:original_error) { should eq error }
87
+ its(:status) { should eq 404 }
88
+ its(:error_response) { should eq "Not found" }
89
+ end
90
+ end
77
91
  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.12.0
4
+ version: 0.12.1
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-04-21 00:00:00.000000000 Z
12
+ date: 2019-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -371,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
371
371
  - !ruby/object:Gem::Version
372
372
  version: '0'
373
373
  requirements: []
374
- rubygems_version: 3.0.1
374
+ rubygems_version: 3.0.3
375
375
  signing_key:
376
376
  specification_version: 4
377
377
  summary: Ruby bindings of ChatWork API