evostream 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: e96996c80df23fe35f8d843a58959252c1c1ba1a
4
- data.tar.gz: bec3aa2eaebca6cf3c1d17365f63520cf6823a5b
3
+ metadata.gz: 14ea04b4151d2d2a9ef074f7f004b89432188d85
4
+ data.tar.gz: 974e7fc12371d28fc283e14ff369ba24a7088d3e
5
5
  SHA512:
6
- metadata.gz: abe5df5b5d7f9cb81ab71d29e496feb2e1d12efde304d140f3ab36a763513e76c14db02dcae9879a3998872eb32f6b369e5b8baabf9c7741cac6de8d123593e2
7
- data.tar.gz: b93f9921f9b26bfb78b3614a10053a8ae6ea4bf103094e4a605d40815241db3053bd5860de802b25ffc913a3efee1771cf85f31d09c5a5f2b294714dab6cf1bd
6
+ metadata.gz: d85030f211c44b27dd65ebdf9e331aa299ab1a023f9bde2d91f8d6b4dba7785b4eaab5d40fe3f15410aac8c3a86d714ad20d30b213f9bbd1068f82cfc39da00a
7
+ data.tar.gz: 10b3452d3c8b4be7bc352709a46797d569ef0a0a72b703f3d04297a31c146c7287ca88f6fa32cba0e5e55efa8674f4923e31dcd6bd462ca4fb1441309740ea0c
@@ -28,8 +28,10 @@ module Evostream
28
28
  json = parse(response.body)
29
29
  if json['status'] == 'SUCCESS'
30
30
  json['data']
31
- else
31
+ elsif json['status'] == 'FAIL' && json['description'] =~ /command .* not known/
32
32
  super
33
+ else
34
+ raise json['description']
33
35
  end
34
36
  else
35
37
  raise response.body
@@ -1,4 +1,4 @@
1
1
  # coding: utf-8
2
2
  module Evostream
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
data/spec/client_spec.rb CHANGED
@@ -19,12 +19,18 @@ describe Evostream::Client do
19
19
  subject.liststreams.should == JSON.parse(liststreams)['data']
20
20
  end
21
21
 
22
- it "should handle a FAIL response to a non existant service" do
22
+ it "should handle a FAIL response of command not known to a non existant service" do
23
23
  stub_request(:get, "http://somehost:80/some_path/non_existant_service").
24
24
  to_return(status: 200, body: '{"data":null,"description":"command non_existant_service not known. Type help for list of commands","status":"FAIL"}')
25
25
  expect { subject.non_existant_service }.to raise_error(NoMethodError)
26
26
  end
27
27
 
28
+ it "should handle a FAIL response with the error message returned by the api" do
29
+ stub_request(:get, "http://somehost:80/some_path/createingestpoint").
30
+ to_return(status: 200, body: '{"data":null,"description":"Unable to create ingest point `private_name` -> `public_name`","status":"FAIL"}')
31
+ expect { subject.createingestpoint }.to raise_error("Unable to create ingest point `private_name` -> `public_name`")
32
+ end
33
+
28
34
  it "should rescue from an unexpected response" do
29
35
  stub_request(:get, "http://somehost:80/some_path/liststreams").
30
36
  to_return(status: 200, body: '<html><head><title>It works!</title></head><body>It works!</body></html>')
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evostream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Mundim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-29 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: webmock
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: debugger
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Ruby wrapper for the Evostream API
@@ -87,11 +87,11 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - ".gitignore"
91
- - ".rspec"
92
- - ".ruby-gemset"
93
- - ".ruby-version"
94
- - ".travis.yml"
90
+ - .gitignore
91
+ - .rspec
92
+ - .ruby-gemset
93
+ - .ruby-version
94
+ - .travis.yml
95
95
  - Gemfile
96
96
  - LICENSE.txt
97
97
  - README.md
@@ -115,17 +115,17 @@ require_paths:
115
115
  - lib
116
116
  required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - ">="
118
+ - - '>='
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ">="
123
+ - - '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.2.2
128
+ rubygems_version: 2.0.3
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Ruby wrapper for the Evostream API