rack-dev-mark 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjFlYzc0MDk5MDA0ZGU1NDNmZTA3N2QwZWYzNTg5ZDhhNmIxMTM2YQ==
4
+ NWVmMmU1NGIxYWQ3NGM5OTQ1ODE3NzE4NmUzMGE2MDliY2E3NjczNA==
5
5
  data.tar.gz: !binary |-
6
- ZmU2ZTgxODMzZmY0N2ZjYjE1NDc5MmU0MmM2YzJmM2FiYjU3MjYyZQ==
6
+ OTkwYThlNzUzODY2MzQzYjFhY2MzMzc0MTBlNGQxZDQwZGVmY2IyYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTc1MTVkYjllODI0YTBmMDc5MDBhZmFkZjM1ZWE5MmUzMWE2N2VjYzIyOGRh
10
- MWQ3ZjVhZWQ1M2NjYmM5ZGM3YzVmYTk4ZjY0Y2JjZjRlYzA0ZmI2NmI1MjQw
11
- OTIwZWYxZmZiOGUwYzQ3YTkyMTdkOTYzNTQ5NDZkZDk1M2I4NDg=
9
+ NGQ1OTBkYjQ1Mjg3ODk5NTMyYWExYjE0YzlkYmVlMmYxOTVmNWZhYWUzODg5
10
+ NTkyMGM4ZjEzODE4ZjNkNDE1NGE1NmJkNTVkMGM4YjNiMTM1OGY5ODg4MmQ4
11
+ OTM2M2MwY2E3NjJiOTMzN2MzNDBiY2IwM2JlOGM0YTJmNDJhMjY=
12
12
  data.tar.gz: !binary |-
13
- MjU5MDkzN2M2NzQ1NGM3OGFjNTAwZWJjMjkwYzk3OWIwN2FiNjFjYTAzMDYz
14
- NWVmNjcyMDdhM2U3YmU5MWJjYWJhYmJjZTA0NzY2YjJhNWEyYjk3ZTU3NDc0
15
- YTFkNmYwYzQ3YzE0NDIzNTYzMjg5YWEyYTRiNzU4ZmY3OTA3NjA=
13
+ YzVlZDgwOTVkMzBjNDY0ZGNmOGJhNzEyMzZjMDE0MmZjOTM3ZGVkNzkxYjNk
14
+ MjMwNWU1MGQxNWI5NDAxMzlmODg2NWZlNzYxODE4MzAyOTA1ODJhMGRiNjFl
15
+ MjZmNTBlZjU0NjI2MThjOTYwY2FkMDYzMzNiNDk5MTMyN2M2NDk=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
@@ -18,7 +18,7 @@ module Rack
18
18
 
19
19
  headers = HeaderHash.new(headers)
20
20
 
21
- headers['X-Rack-Dev-Mark-Env'] = Rack::DevMark.env
21
+ headers['X-Rack-Dev-Mark-Env'] = CGI.escape Rack::DevMark.env
22
22
 
23
23
  if headers['Content-Type'].to_s =~ %r{\btext/html\b}i
24
24
  new_body = ''
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Rack::DevMark::Middleware do
@@ -5,10 +6,12 @@ describe Rack::DevMark::Middleware do
5
6
  let(:body) { ['response'] }
6
7
  let(:theme) { d = double setup: nil; allow(d).to receive(:insert_into){ |b| "#{b} dev-mark" }; d }
7
8
  let(:app) { double call: [200, headers, body] }
9
+ let(:env) { 'test' }
10
+ let(:revision) { 'rev' }
8
11
  subject { Rack::DevMark::Middleware.new(app, theme) }
9
12
  before do
10
- allow(Rack::DevMark).to receive(:env).and_return('test')
11
- allow(Rack::DevMark).to receive(:revision).and_return('rev')
13
+ allow(Rack::DevMark).to receive(:env).and_return(env)
14
+ allow(Rack::DevMark).to receive(:revision).and_return(revision)
12
15
  end
13
16
 
14
17
  it "inserts dev mark" do
@@ -17,9 +20,20 @@ describe Rack::DevMark::Middleware do
17
20
  expect(headers).to include('Content-Type' => 'text/html; charset=utf-8')
18
21
  expect(body).to eq(["response dev-mark"])
19
22
  end
20
- it "adds http headers" do
21
- _, headers, _ = subject.call({})
22
- expect(headers).to include('X-Rack-Dev-Mark-Env' => 'test')
23
+ describe "http headers" do
24
+ context "ASCII env string" do
25
+ it "adds http headers" do
26
+ _, headers, _ = subject.call({})
27
+ expect(headers).to include('X-Rack-Dev-Mark-Env' => 'test')
28
+ end
29
+ end
30
+ context "Non ASCII string" do
31
+ let(:env) { 'テスト' }
32
+ it "adds http headers" do
33
+ _, headers, _ = subject.call({})
34
+ expect(headers).to include('X-Rack-Dev-Mark-Env' => '%E3%83%86%E3%82%B9%E3%83%88')
35
+ end
36
+ end
23
37
  end
24
38
  context "symbol theme" do
25
39
  let(:theme) { :title }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-dev-mark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Taniwaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-19 00:00:00.000000000 Z
11
+ date: 2014-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack