caseblocks_api 0.2.15 → 0.2.16

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.15
1
+ 0.2.16
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "caseblocks_api"
8
- s.version = "0.2.15"
8
+ s.version = "0.2.16"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark Provan"]
12
- s.date = "2013-03-27"
12
+ s.date = "2013-09-03"
13
13
  s.email = "development@emergeadapt.com"
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE.txt",
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
35
35
  "lib/caseblocks_api/update_case.rb",
36
36
  "spec/caseblocks_api_spec.rb",
37
37
  "spec/lib/caseblocks_api/bucket_results_spec.rb",
38
+ "spec/lib/caseblocks_api/case_creation_error_spec.rb",
38
39
  "spec/lib/caseblocks_api/get_cases_spec.rb",
39
40
  "spec/lib/caseblocks_api/searcher_spec.rb",
40
41
  "spec/lib/caseblocks_api/update_case_spec.rb",
@@ -44,7 +45,7 @@ Gem::Specification.new do |s|
44
45
  s.homepage = "http://github.com/EmergeAdapt/caseblocks_api"
45
46
  s.licenses = ["MIT"]
46
47
  s.require_paths = ["lib"]
47
- s.rubygems_version = "1.8.24"
48
+ s.rubygems_version = "1.8.15"
48
49
  s.summary = "Ruby wrapper for CaseBlocks API"
49
50
 
50
51
  if s.respond_to? :specification_version then
@@ -32,7 +32,10 @@ module CaseblocksAPI
32
32
  def create_case(params, case_type=nil)
33
33
  params.merge!(:case_type_id => fetch_case_type_id(case_type))
34
34
  response = self.class.post("/case_blocks/cases", :body => {:case => params}.to_json)
35
- raise CaseblocksAPI::CaseCreationError, "Unable to create case - received response code #{response.code}" if response.code != 201
35
+ if response.code != 201
36
+ response_hash = {:body => response.body, :code => response.code, :message => response.message, :headers => response.headers.inspect}
37
+ raise CaseblocksAPI::CaseCreationError.new("Unable to create case - received response code #{response.code}", response_hash)
38
+ end
36
39
  end
37
40
 
38
41
  private
@@ -1,4 +1,9 @@
1
1
  module CaseblocksAPI
2
2
  class CaseCreationError < StandardError
3
+ attr_accessor :response
4
+ def initialize(message, response)
5
+ super(message)
6
+ @response = response
7
+ end
3
8
  end
4
9
  end
@@ -0,0 +1,9 @@
1
+ require "spec_helper"
2
+
3
+ describe "CaseCreationError" do
4
+ it "takes a response code as an argument" do
5
+ response = {:body => "Some response body", :code => 200, :message => "OK", :headers => "{\"cache-control\"=>[\"max-age=0, private, must-revalidate\"], \"content-type\"=>[\"text/html; charset=utf-8\"], \"date\"=>[\"Tue, 03 Sep 2013 09:08:46 GMT\"], \"etag\"=>[\"\\\"5227248b169c57e9d14b14305c23c78e\\\"\"], \"server\"=>[\"nginx/1.1.19\"], \"set-cookie\"=>[\"_cb-website_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTExNmE1YTQyZDIyZDU1OWE3OWI1MjRhZmY2NDYxOWZmBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMXMzOWpTdlV4OHA5d0VnTHppZ0s0T0FwdXl1THpvL3B6QWI5dFNpTTc4Q3M9BjsARg%3D%3D--af61c2cc1a1dc9d40c855444a34340796beafd02; path=/; HttpOnly\"], \"status\"=>[\"200 OK\"], \"vary\"=>[\"Accept-Encoding\"], \"x-rack-cache\"=>[\"miss\"], \"x-request-id\"=>[\"76f22dade32f143db6a89d4f1c17dea0\"], \"x-runtime\"=>[\"0.055758\"], \"x-ua-compatible\"=>[\"IE=Edge,chrome=1\"], \"transfer-encoding\"=>[\"chunked\"], \"connection\"=>[\"Close\"]}"}
6
+ exception = CaseblocksAPI::CaseCreationError.new("message", response)
7
+ exception.response.should eql response
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caseblocks_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.15
4
+ version: 0.2.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-27 00:00:00.000000000 Z
12
+ date: 2013-09-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70195637932920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *70195637932920
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: activesupport
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70195637932220 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '0'
38
33
  type: :runtime
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *70195637932220
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: rspec
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &70195637931620 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ~>
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: '2.11'
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: '2.11'
46
+ version_requirements: *70195637931620
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: rdoc
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &70195637930980 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ~>
@@ -69,15 +54,10 @@ dependencies:
69
54
  version: '3.12'
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: '3.12'
57
+ version_requirements: *70195637930980
78
58
  - !ruby/object:Gem::Dependency
79
59
  name: bundler
80
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &70195637930420 !ruby/object:Gem::Requirement
81
61
  none: false
82
62
  requirements:
83
63
  - - ! '>='
@@ -85,15 +65,10 @@ dependencies:
85
65
  version: '0'
86
66
  type: :development
87
67
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
68
+ version_requirements: *70195637930420
94
69
  - !ruby/object:Gem::Dependency
95
70
  name: jeweler
96
- requirement: !ruby/object:Gem::Requirement
71
+ requirement: &70195637929340 !ruby/object:Gem::Requirement
97
72
  none: false
98
73
  requirements:
99
74
  - - ~>
@@ -101,15 +76,10 @@ dependencies:
101
76
  version: 1.8.4
102
77
  type: :development
103
78
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ~>
108
- - !ruby/object:Gem::Version
109
- version: 1.8.4
79
+ version_requirements: *70195637929340
110
80
  - !ruby/object:Gem::Dependency
111
81
  name: guard-rspec
112
- requirement: !ruby/object:Gem::Requirement
82
+ requirement: &70195637945060 !ruby/object:Gem::Requirement
113
83
  none: false
114
84
  requirements:
115
85
  - - ! '>='
@@ -117,15 +87,10 @@ dependencies:
117
87
  version: '0'
118
88
  type: :development
119
89
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ! '>='
124
- - !ruby/object:Gem::Version
125
- version: '0'
90
+ version_requirements: *70195637945060
126
91
  - !ruby/object:Gem::Dependency
127
92
  name: pry
128
- requirement: !ruby/object:Gem::Requirement
93
+ requirement: &70195637949780 !ruby/object:Gem::Requirement
129
94
  none: false
130
95
  requirements:
131
96
  - - ! '>='
@@ -133,15 +98,10 @@ dependencies:
133
98
  version: '0'
134
99
  type: :development
135
100
  prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ! '>='
140
- - !ruby/object:Gem::Version
141
- version: '0'
101
+ version_requirements: *70195637949780
142
102
  - !ruby/object:Gem::Dependency
143
103
  name: webmock
144
- requirement: !ruby/object:Gem::Requirement
104
+ requirement: &70195637948840 !ruby/object:Gem::Requirement
145
105
  none: false
146
106
  requirements:
147
107
  - - ! '>='
@@ -149,15 +109,10 @@ dependencies:
149
109
  version: '0'
150
110
  type: :development
151
111
  prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: '0'
112
+ version_requirements: *70195637948840
158
113
  - !ruby/object:Gem::Dependency
159
114
  name: rspec-given
160
- requirement: !ruby/object:Gem::Requirement
115
+ requirement: &70195637948240 !ruby/object:Gem::Requirement
161
116
  none: false
162
117
  requirements:
163
118
  - - ! '>='
@@ -165,12 +120,7 @@ dependencies:
165
120
  version: '0'
166
121
  type: :development
167
122
  prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
- requirements:
171
- - - ! '>='
172
- - !ruby/object:Gem::Version
173
- version: '0'
123
+ version_requirements: *70195637948240
174
124
  description:
175
125
  email: development@emergeadapt.com
176
126
  executables: []
@@ -198,6 +148,7 @@ files:
198
148
  - lib/caseblocks_api/update_case.rb
199
149
  - spec/caseblocks_api_spec.rb
200
150
  - spec/lib/caseblocks_api/bucket_results_spec.rb
151
+ - spec/lib/caseblocks_api/case_creation_error_spec.rb
201
152
  - spec/lib/caseblocks_api/get_cases_spec.rb
202
153
  - spec/lib/caseblocks_api/searcher_spec.rb
203
154
  - spec/lib/caseblocks_api/update_case_spec.rb
@@ -218,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
169
  version: '0'
219
170
  segments:
220
171
  - 0
221
- hash: 4348810465325384927
172
+ hash: 1836771192975938175
222
173
  required_rubygems_version: !ruby/object:Gem::Requirement
223
174
  none: false
224
175
  requirements:
@@ -227,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
178
  version: '0'
228
179
  requirements: []
229
180
  rubyforge_project:
230
- rubygems_version: 1.8.24
181
+ rubygems_version: 1.8.15
231
182
  signing_key:
232
183
  specification_version: 3
233
184
  summary: Ruby wrapper for CaseBlocks API