google_chart_ssl 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  class GoogleChartSsl
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -10,7 +10,7 @@ class GoogleChartSsl
10
10
 
11
11
  def call(env)
12
12
  @req = Rack::Request.new(env)
13
- if @req.path == '/google_chart' or @req.path == '/google_chart.png'
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: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Gee