hobbit 0.4.1 → 0.4.2

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: e8b15402755a98818b63e15b8ee601d015b895b6
4
- data.tar.gz: 2cdbe4db16ad8da597f06fa81286ddf8b08fb5a6
3
+ metadata.gz: b7c486fc3d4a7a9ab2cf164da150c53e64dfea84
4
+ data.tar.gz: 1cd83cd0025ac0f255972ec361e644b2bcd3342f
5
5
  SHA512:
6
- metadata.gz: 4ee1eb6bade97d609f0728a57a1f48ca0abe2629f71479a43bb4f04126e444d629118b47d7a89da13ce272eed024bec0133c668e3b8ee1a848b6f68c74fec001
7
- data.tar.gz: 7c5aa60e620e81fa6338f473bb756c94c8b4d01fd07d0ef7df8f90eb601e25a0ebc8001fa4f1004f239135e6755bdfe15cf356f8b091758850b5e8fadae02d94
6
+ metadata.gz: aaaafbb99b619a7f4553c03183732e02c3a054977e21de5ac60e0078e73bddbbe8c3558b3d173bb119dd04beb7d941a33ed3b062f036a47973cad15ac77d6cbc
7
+ data.tar.gz: 240d21c02bc59f9e3a6916540d8b24b2d4bf7812786302a1e3f399a55af9ed0273cfef0e75124fe26bf4ba36c31cbba711f8b20934edf1c0807a6d4ad0676a52
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  ---
2
2
  rvm:
3
3
  - 2.0.0
4
+ - 2.1.0
4
5
  - ruby-head
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.4.2
2
+
3
+ * Add `Hobbit::Response#redirect`, that was missing since `Hobbit::Response`
4
+ isn't a `Rack::Response` subclass.
5
+
1
6
  # 0.4.1
2
7
 
3
8
  * `Hobbit::Response` now returns the `Content-Length` header as a string.
data/hobbit.gemspec CHANGED
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency 'bundler', '~> 1.3'
22
22
  spec.add_development_dependency 'coveralls'
23
23
  spec.add_development_dependency 'minitest'
24
- spec.add_development_dependency 'rack'
25
24
  spec.add_development_dependency 'rack-test'
26
25
  spec.add_development_dependency 'rake'
27
26
 
@@ -15,6 +15,11 @@ module Hobbit
15
15
  [status, headers, body]
16
16
  end
17
17
 
18
+ def redirect(target, status = 302)
19
+ headers['Location'] = target
20
+ self.status = status
21
+ end
22
+
18
23
  def write(string)
19
24
  self.body << string
20
25
  end
@@ -1,3 +1,3 @@
1
1
  module Hobbit
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
@@ -63,6 +63,22 @@ describe Hobbit::Response do
63
63
  end
64
64
  end
65
65
 
66
+ describe '#redirect' do
67
+ let(:response) { Hobbit::Response.new }
68
+
69
+ it 'must set the Location header and the status code' do
70
+ response.redirect '/hello'
71
+ response.headers['Location'].must_equal '/hello'
72
+ response.status.must_equal 302
73
+ end
74
+
75
+ it 'must set the Location header and the status code if given' do
76
+ response.redirect '/hello', 301
77
+ response.headers['Location'].must_equal '/hello'
78
+ response.status.must_equal 301
79
+ end
80
+ end
81
+
66
82
  describe '#write' do
67
83
  let(:response) { Hobbit::Response.new }
68
84
 
metadata CHANGED
@@ -1,111 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobbit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patricio Mac Adden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-26 00:00:00.000000000 Z
11
+ date: 2013-12-29 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: coveralls
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: minitest
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
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rack
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rack-test
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - '>='
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
61
  version: '0'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - '>='
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rake
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - '>='
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
75
  version: '0'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - '>='
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: rack
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - '>='
87
+ - - ">="
102
88
  - !ruby/object:Gem::Version
103
89
  version: '0'
104
90
  type: :runtime
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - '>='
94
+ - - ">="
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
97
  description: A minimalistic microframework built on top of rack
@@ -115,8 +101,8 @@ executables: []
115
101
  extensions: []
116
102
  extra_rdoc_files: []
117
103
  files:
118
- - .gitignore
119
- - .travis.yml
104
+ - ".gitignore"
105
+ - ".travis.yml"
120
106
  - CHANGELOG.md
121
107
  - Gemfile
122
108
  - LICENSE
@@ -141,17 +127,17 @@ require_paths:
141
127
  - lib
142
128
  required_ruby_version: !ruby/object:Gem::Requirement
143
129
  requirements:
144
- - - '>='
130
+ - - ">="
145
131
  - !ruby/object:Gem::Version
146
132
  version: '0'
147
133
  required_rubygems_version: !ruby/object:Gem::Requirement
148
134
  requirements:
149
- - - '>='
135
+ - - ">="
150
136
  - !ruby/object:Gem::Version
151
137
  version: '0'
152
138
  requirements: []
153
139
  rubyforge_project:
154
- rubygems_version: 2.0.14
140
+ rubygems_version: 2.2.0
155
141
  signing_key:
156
142
  specification_version: 4
157
143
  summary: A minimalistic microframework built on top of rack