madride 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/madride/environment.rb +10 -0
- data/lib/madride/version.rb +1 -1
- data/spec/environment_spec.rb +0 -3
- data/spec/server_spec.rb +12 -0
- metadata +9 -3
data/lib/madride/environment.rb
CHANGED
@@ -32,5 +32,15 @@ module Madride
|
|
32
32
|
env['PATH_INFO'] += '.html' if File.extname(unescape(env['PATH_INFO'].to_s)).empty?
|
33
33
|
super
|
34
34
|
end
|
35
|
+
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
|
40
|
+
def headers env, asset, length
|
41
|
+
super(env, asset, length).tap do |headers|
|
42
|
+
headers["Content-Type"] << ";charset=utf8" if "text/html" == asset.content_type
|
43
|
+
end
|
44
|
+
end
|
35
45
|
end
|
36
46
|
end
|
data/lib/madride/version.rb
CHANGED
data/spec/environment_spec.rb
CHANGED
data/spec/server_spec.rb
CHANGED
@@ -56,5 +56,17 @@ module Madride
|
|
56
56
|
last_response.should be_ok
|
57
57
|
last_response.body.should match(%r{<title>\s*Madride Demo\s*</title>})
|
58
58
|
end
|
59
|
+
|
60
|
+
|
61
|
+
it "should set charset=utf8 for html files" do
|
62
|
+
get "/"
|
63
|
+
last_response.header['Content-Type'].should match(%r{charset=utf8$})
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
it "should keep Content-Type untouched for anything but html" do
|
68
|
+
get "/app.js"
|
69
|
+
last_response.header['Content-Type'].should_not match(%r{charset=utf8$})
|
70
|
+
end
|
59
71
|
end
|
60
72
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: madride
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sprockets
|
@@ -190,18 +190,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
190
190
|
- - ! '>='
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: '0'
|
193
|
+
segments:
|
194
|
+
- 0
|
195
|
+
hash: -676681393
|
193
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
197
|
none: false
|
195
198
|
requirements:
|
196
199
|
- - ! '>='
|
197
200
|
- !ruby/object:Gem::Version
|
198
201
|
version: '0'
|
202
|
+
segments:
|
203
|
+
- 0
|
204
|
+
hash: -676681393
|
199
205
|
requirements: []
|
200
206
|
rubyforge_project:
|
201
207
|
rubygems_version: 1.8.23
|
202
208
|
signing_key:
|
203
209
|
specification_version: 3
|
204
|
-
summary: madride-1.0.
|
210
|
+
summary: madride-1.0.6
|
205
211
|
test_files:
|
206
212
|
- spec/.gitkeep
|
207
213
|
- spec/environment_spec.rb
|