hotchoc 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: 906bf6c641ca369e29effabcc2238b7d6143befe
4
- data.tar.gz: 20a9b7fc5bcb94186a9d92c9fd029726c52a2e19
3
+ metadata.gz: 040dce9b238761f601ce6b7ca32ae944449e087a
4
+ data.tar.gz: 1a30003ad4f7ac88bd1f83d9c6103cf4ee1a18e3
5
5
  SHA512:
6
- metadata.gz: 8d99f1414b96f84ffe1bb7bcadd57d7d4ba357a1f2b2d944925c2b359914eb57381d036904820297ea2a4ede6a2b00b14456eb873a07e3668d5377caf7298a1d
7
- data.tar.gz: dca562a26a8e584c55471aded8d35c41ce1e1ec1e04490f308237c931a79acd47c5da01bde1a102e974e09050e30f01213a4c5da0a326560fa6a137bba3c3f04
6
+ metadata.gz: 34806d08d50908475a0a08b4b9fce0ed6b71c98c42ab08ed59f3955bf3acfe393041882452b8340e36bcdfac8cb0cd7742dded84d2b25298949362085949101f
7
+ data.tar.gz: c6d3cd0d31aa44b57659d04eab59436cd713a3dd79d0d2fba188c944771b73907440eeb188818bd42e8e4e7a44cb02545a1dda574a79dbb36f2078194b169df9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 0.4.1
6
+
7
+ [Full changelog](https://github.com/choc/hotchoc-ruby/compare/v0.4.0...v0.4.1)
8
+
9
+ Changes:
10
+
11
+ * Remove `Hotchoc::Client::Errors` namespace
12
+
5
13
  ## 0.4.0
6
14
 
7
15
  [Full changelog](https://github.com/choc/hotchoc-ruby/compare/v0.3.1...v0.4.0)
@@ -23,7 +23,7 @@ module Hotchoc
23
23
  if response.success?
24
24
  JSON.parse(response.body)
25
25
  else
26
- fail Errors::RequestError, request_error_message(response)
26
+ fail RequestError, request_error_message(response)
27
27
  end
28
28
  end
29
29
 
@@ -1,5 +1,5 @@
1
1
  module Hotchoc
2
2
  class Client
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
@@ -2,6 +2,13 @@ module Hotchoc
2
2
  class Client
3
3
  include API
4
4
 
5
+ # Base error class for all custom errors
6
+ class HotchocError < StandardError
7
+ end
8
+
9
+ class RequestError < HotchocError
10
+ end
11
+
5
12
  #
6
13
  # Define the same set of accessors as in the Hotchoc module
7
14
  #
data/lib/hotchoc.rb CHANGED
@@ -10,7 +10,6 @@ require 'hotchoc/thumbnail'
10
10
  require 'hotchoc/topic'
11
11
 
12
12
  require 'hotchoc/client/version'
13
- require 'hotchoc/client/errors'
14
13
  require 'hotchoc/client/api'
15
14
  require 'hotchoc/client/fetcher'
16
15
  require 'hotchoc/client/configuration'
@@ -33,5 +33,11 @@ describe Hotchoc::Client do
33
33
  expect(client.send("#{key}")).to eq config[key]
34
34
  end
35
35
  end
36
+
37
+ it 'raises RequestError if request fails' do
38
+ client = described_class.new(config)
39
+
40
+ expect { client.get_posts }.to raise_error Hotchoc::Client::RequestError
41
+ end
36
42
  end
37
43
  end
@@ -11,5 +11,8 @@ RSpec.configure do |config|
11
11
 
12
12
  stub_request(:get, /.*\.hotchoc\.(io|dev|test)\/api\/topics\/?(\?.*)?\z/)
13
13
  .to_return(status: 200, body: File.read(response_stub('topics')))
14
+
15
+ stub_request(:get, "https://def.ghi/api/posts?api_key=abc")
16
+ .to_return(status: 504)
14
17
  end
15
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotchoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Siegel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-03 00:00:00.000000000 Z
11
+ date: 2015-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -148,7 +148,6 @@ files:
148
148
  - lib/hotchoc/client.rb
149
149
  - lib/hotchoc/client/api.rb
150
150
  - lib/hotchoc/client/configuration.rb
151
- - lib/hotchoc/client/errors.rb
152
151
  - lib/hotchoc/client/fetcher.rb
153
152
  - lib/hotchoc/client/version.rb
154
153
  - lib/hotchoc/file.rb
@@ -1,12 +0,0 @@
1
- module Hotchoc
2
- class Client
3
- module Errors
4
- # Base error class for all custom errors
5
- class HotchocError < StandardError
6
- end
7
-
8
- class RequestError < HotchocError
9
- end
10
- end
11
- end
12
- end