rack-gist 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/VERSION +1 -1
- data/lib/rack/gist.rb +3 -2
- data/rack-gist.gemspec +3 -2
- data/spec/rack-gist_spec.rb +13 -1
- metadata +4 -3
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use ree@rack-gist
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/lib/rack/gist.rb
CHANGED
@@ -8,7 +8,8 @@ module Rack
|
|
8
8
|
@options = {
|
9
9
|
:jquery => true,
|
10
10
|
:cache_time => 3600,
|
11
|
-
:http_cache_time => 3600
|
11
|
+
:http_cache_time => 3600,
|
12
|
+
:encoding => 'utf-8'
|
12
13
|
}.merge(options)
|
13
14
|
end
|
14
15
|
|
@@ -35,7 +36,7 @@ module Rack
|
|
35
36
|
node.add_child(jquery_helper)
|
36
37
|
end
|
37
38
|
end
|
38
|
-
end.
|
39
|
+
end.to_html(:encoding => @options[:encoding])
|
39
40
|
body = [body]
|
40
41
|
headers['Content-Length'] = body.map { |part| Rack::Utils.bytesize(part) }.inject(0) { |sum, size| sum + size }.to_s
|
41
42
|
end
|
data/rack-gist.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rack-gist}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Daniel Huckstep"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-13}
|
13
13
|
s.description = %q{Load gists in the background. KTHXBYE!}
|
14
14
|
s.email = %q{darkhelmet@darkhelmetlive.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
".gitignore",
|
22
|
+
".rvmrc",
|
22
23
|
"Gemfile",
|
23
24
|
"Gemfile.lock",
|
24
25
|
"LICENSE",
|
data/spec/rack-gist_spec.rb
CHANGED
@@ -119,7 +119,7 @@ describe "Rack::Gist" do
|
|
119
119
|
status, headers, body = a.call(mock_env)
|
120
120
|
status.should == 200
|
121
121
|
headers['Content-Type'].should == 'text/html'
|
122
|
-
headers['Content-Length'].should == '
|
122
|
+
headers['Content-Length'].should == '1066'
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
@@ -205,4 +205,16 @@ describe "Rack::Gist" do
|
|
205
205
|
headers['Cache-Control'].should be_nil
|
206
206
|
end
|
207
207
|
end
|
208
|
+
|
209
|
+
it 'should encode to the correct content type' do
|
210
|
+
middleware.tap do |a|
|
211
|
+
status, headers, body = a.call(mock_env)
|
212
|
+
pbody(body).should match('utf-8')
|
213
|
+
end
|
214
|
+
|
215
|
+
middleware(:encoding => 'US-ASCII').tap do |a|
|
216
|
+
status, headers, body = a.call(mock_env)
|
217
|
+
pbody(body).should match('US-ASCII')
|
218
|
+
end
|
219
|
+
end
|
208
220
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
8
|
+
- 2
|
9
|
+
version: 1.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Daniel Huckstep
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-13 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -150,6 +150,7 @@ extra_rdoc_files:
|
|
150
150
|
files:
|
151
151
|
- .document
|
152
152
|
- .gitignore
|
153
|
+
- .rvmrc
|
153
154
|
- Gemfile
|
154
155
|
- Gemfile.lock
|
155
156
|
- LICENSE
|