saorin 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,8 @@ module Saorin
7
7
  module Adapters
8
8
  module Clients
9
9
  class Base
10
+ CONTENT_TYPE = 'application/json'.freeze
11
+
10
12
  def initialize(options = {})
11
13
  end
12
14
 
@@ -12,12 +12,16 @@ module Saorin
12
12
 
13
13
  @connection = ::Faraday::Connection.new(options) do |builder|
14
14
  builder.adapter ::Faraday.default_adapter
15
+ builder.response :raise_error
15
16
  block.call builder if block
16
17
  end
17
18
  end
18
19
 
19
20
  def send_request(content)
20
- response = @connection.post '', content
21
+ response = @connection.post do |req|
22
+ req.headers[:content_type] = CONTENT_TYPE
23
+ req.body = content
24
+ end
21
25
  response.body
22
26
  end
23
27
  end
@@ -21,8 +21,8 @@ module Saorin
21
21
  while request = connection.request
22
22
  case request
23
23
  when ::Reel::Request
24
- response_body = ''
25
24
  response_body = process_request(request.body) if request.method.to_s.upcase == 'POST'
25
+ response_body ||= ''
26
26
  request.respond :ok, DEFAULT_HEADERS.dup, response_body
27
27
  end
28
28
  end
@@ -1,3 +1,3 @@
1
1
  module Saorin
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saorin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -124,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  segments:
126
126
  - 0
127
- hash: 2375165589951293254
127
+ hash: 1684078337645603249
128
128
  required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  segments:
135
135
  - 0
136
- hash: 2375165589951293254
136
+ hash: 1684078337645603249
137
137
  requirements: []
138
138
  rubyforge_project:
139
139
  rubygems_version: 1.8.24