google_chart_ssl 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/google_chart_ssl/version.rb +1 -1
- data/lib/google_chart_ssl.rb +1 -1
- data/test/google_chart_ssl_test.rb +8 -0
- metadata +3 -3
data/lib/google_chart_ssl.rb
CHANGED
@@ -10,7 +10,7 @@ class GoogleChartSsl
|
|
10
10
|
|
11
11
|
def call(env)
|
12
12
|
@req = Rack::Request.new(env)
|
13
|
-
if @req.path
|
13
|
+
if @req.path =~ %r[/google_chart(\.png)?\z]
|
14
14
|
path = '/chart?' + @req.query_string
|
15
15
|
resp = Google.request(Net::HTTP::Get.new(path))
|
16
16
|
headers = {
|
@@ -33,4 +33,12 @@ class GoogleChartSslTest < Test::Unit::TestCase
|
|
33
33
|
assert_equal 'a 50px by 20px PNG image', last_response.body
|
34
34
|
end
|
35
35
|
|
36
|
+
def test_request_might_be_namespaced
|
37
|
+
get '/subdir/google_chart'
|
38
|
+
assert_equal 200, last_response.status
|
39
|
+
assert_equal 'image/png', last_response.headers['Content-Type']
|
40
|
+
assert_equal '20', last_response.headers['Content-Length']
|
41
|
+
assert_equal 'some binary PNG data', last_response.body
|
42
|
+
end
|
43
|
+
|
36
44
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_chart_ssl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Gee
|