saorin 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
22
22
  ```ruby
23
23
  class Handler
24
24
  def hello(name)
25
- "Helo #{name}!"
25
+ "Hello #{name}!"
26
26
  end
27
27
  end
28
28
 
@@ -7,19 +7,21 @@ module Saorin
7
7
  class Rack < Base
8
8
  DEFAULT_HEADERS = {
9
9
  'Content-Type' => 'application/json'
10
- }
10
+ }.freeze
11
11
 
12
12
  def initialize(handler, options = {}, &block)
13
13
  super handler, options
14
14
 
15
15
  ::Rack::Server.start({
16
- :app => self
16
+ :app => self,
17
+ :Host => options[:host],
18
+ :Port => options[:port],
17
19
  }.merge(options))
18
20
  end
19
21
 
20
22
  def call(env)
21
23
  request = ::Rack::Request.new(env)
22
- response = ::Rack::Response.new([], 200, DEFAULT_HEADERS)
24
+ response = ::Rack::Response.new([], 200, DEFAULT_HEADERS.dup)
23
25
  response.write process_request(request.body.read) if request.post?
24
26
  response.finish
25
27
  end
@@ -7,7 +7,7 @@ module Saorin
7
7
  class Reel < Base
8
8
  DEFAULT_HEADERS = {
9
9
  'Content-Type' => 'application/json'
10
- }
10
+ }.freeze
11
11
 
12
12
  def initialize(handler, options = {}, &block)
13
13
  super handler, options
@@ -23,7 +23,7 @@ module Saorin
23
23
  when ::Reel::Request
24
24
  response_body = ''
25
25
  response_body = process_request(request.body) if request.method.to_s.upcase == 'POST'
26
- request.respond ::Reel::Response.new(200, DEFAULT_HEADERS, response_body)
26
+ request.respond :ok, DEFAULT_HEADERS.dup, response_body
27
27
  end
28
28
  end
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module Saorin
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
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.0
4
+ version: 0.1.1
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: -3052577034699129611
127
+ hash: 2375165589951293254
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: -3052577034699129611
136
+ hash: 2375165589951293254
137
137
  requirements: []
138
138
  rubyforge_project:
139
139
  rubygems_version: 1.8.24