utopia 2.3.0 → 2.4.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76b2bddad99a2b2de5f470d20cad43effd23ec9cada64002a7adf737cda1a359
|
4
|
+
data.tar.gz: 4f65e88162e376b6bba06910de4cd71fe62fa8aa5a4afd3f800ee36c6622d182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbb318c33f6dfc0ba5a7ba7cd17e59d5c940a582fce3f3c62e1cead4afc2551a0d82cb837d4de6be676e79ff37ffbacb176762f8937ef94413a4518f409df7a7
|
7
|
+
data.tar.gz: 7c3ea554b35fe6dffed5ec37e9e1950b92335bb5b7a65a09b0384f195f24cf249da460178747ab8f5d8f859fb39e5cb65b251da6455b1e8b05f9856a65c42bc9
|
data/.travis.yml
CHANGED
@@ -11,10 +11,10 @@ before_install:
|
|
11
11
|
# I don't know why I need to install this on travis in order for tests to function.
|
12
12
|
- gem install bundler samovar
|
13
13
|
rvm:
|
14
|
-
- 2.2
|
15
14
|
- 2.3
|
16
15
|
- 2.4
|
17
16
|
- 2.5
|
17
|
+
- 2.6
|
18
18
|
- jruby-head
|
19
19
|
- ruby-head
|
20
20
|
env: COVERAGE=true BENCHMARK=true
|
@@ -165,10 +165,15 @@ module Utopia
|
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
168
|
-
# Invokes super. If a response is generated, format it based on the Accept: header.
|
168
|
+
# Invokes super. If a response is generated, format it based on the Accept: header, unless the content type was already specified.
|
169
169
|
def process!(request, path)
|
170
170
|
if response = super
|
171
|
-
|
171
|
+
headers = response[1]
|
172
|
+
|
173
|
+
# Don't try to convert the response if a content type was explicitly specified.
|
174
|
+
unless headers[Rack::CONTENT_TYPE]
|
175
|
+
response = self.class.response_for(self, request, path, response)
|
176
|
+
end
|
172
177
|
|
173
178
|
response
|
174
179
|
end
|
data/lib/utopia/version.rb
CHANGED
@@ -110,6 +110,16 @@ module Utopia::Controller::RespondSpec
|
|
110
110
|
expect(last_response.body).to be == '{"message":"File not found"}'
|
111
111
|
end
|
112
112
|
|
113
|
+
it 'should get html response' do
|
114
|
+
header 'Accept', '*/*'
|
115
|
+
|
116
|
+
get '/html/hello-world'
|
117
|
+
|
118
|
+
expect(last_response.status).to be == 200
|
119
|
+
expect(last_response.headers['Content-Type']).to be == 'text/html'
|
120
|
+
expect(last_response.body).to be == '<p>Hello World</p>'
|
121
|
+
end
|
122
|
+
|
113
123
|
it "should get version 1 response" do
|
114
124
|
header 'Accept', 'application/json;version=1'
|
115
125
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utopia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trenni
|
@@ -667,6 +667,7 @@ files:
|
|
667
667
|
- spec/utopia/controller/respond_spec/api/controller.rb
|
668
668
|
- spec/utopia/controller/respond_spec/errors/controller.rb
|
669
669
|
- spec/utopia/controller/respond_spec/errors/file-not-found.xnode
|
670
|
+
- spec/utopia/controller/respond_spec/html/controller.rb
|
670
671
|
- spec/utopia/controller/respond_spec/rewrite/controller.rb
|
671
672
|
- spec/utopia/controller/rewrite_spec.rb
|
672
673
|
- spec/utopia/controller/sequence_spec.rb
|
@@ -792,6 +793,7 @@ test_files:
|
|
792
793
|
- spec/utopia/controller/respond_spec/api/controller.rb
|
793
794
|
- spec/utopia/controller/respond_spec/errors/controller.rb
|
794
795
|
- spec/utopia/controller/respond_spec/errors/file-not-found.xnode
|
796
|
+
- spec/utopia/controller/respond_spec/html/controller.rb
|
795
797
|
- spec/utopia/controller/respond_spec/rewrite/controller.rb
|
796
798
|
- spec/utopia/controller/rewrite_spec.rb
|
797
799
|
- spec/utopia/controller/sequence_spec.rb
|