rack-ketai 0.1.2 → 0.1.3
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/README.rdoc +20 -2
- data/VERSION +1 -1
- data/lib/rack/ketai/carrier/abstract.rb +10 -22
- data/lib/rack/ketai/carrier/au.rb +6 -7
- data/lib/rack/ketai/carrier/docomo.rb +7 -8
- data/lib/rack/ketai/carrier/general.rb +7 -7
- data/lib/rack/ketai/carrier/softbank.rb +16 -6
- data/lib/rack/ketai/carrier/specs/au.rb +1 -1
- data/lib/rack/ketai/carrier/specs/docomo.rb +1 -1
- data/lib/rack/ketai/carrier/specs/softbank.rb +1 -1
- data/rack-ketai.gemspec +2 -2
- data/spec/unit/au_filter_spec.rb +3 -0
- data/spec/unit/docomo_filter_spec.rb +3 -0
- data/spec/unit/emoticon_filter_spec.rb +17 -0
- data/spec/unit/softbank_filter_spec.rb +3 -0
- metadata +3 -3
data/rack-ketai.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rack-ketai}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Yuichi Takeuchi"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-21}
|
13
13
|
s.email = %q{info@takeyu-web.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.rdoc"
|
data/spec/unit/au_filter_spec.rb
CHANGED
@@ -93,8 +93,11 @@ describe Rack::Ketai::Carrier::Au::Filter, "外部エンコーディングに変
|
|
93
93
|
['image/jpeg', 'image/jpeg'],
|
94
94
|
['application/octet-stream', 'application/octet-stream'],
|
95
95
|
].each do |content_type, valid_content_type|
|
96
|
+
orig_content_type = content_type == nil ? nil : content_type.clone
|
96
97
|
status, headers, body = @filter.outbound(200, { "Content-Type" => content_type}, ['適当な本文'])
|
97
98
|
headers['Content-Type'].should == valid_content_type
|
99
|
+
# 元の文字列に直接変更を加えない(Rails3.0でハッシュを使い回してるようだったので)
|
100
|
+
content_type.should == orig_content_type
|
98
101
|
end
|
99
102
|
end
|
100
103
|
|
@@ -103,8 +103,11 @@ describe Rack::Ketai::Carrier::Docomo::Filter, "外部エンコーディング
|
|
103
103
|
['image/jpeg', 'image/jpeg'],
|
104
104
|
['application/octet-stream', 'application/octet-stream'],
|
105
105
|
].each do |content_type, valid_content_type|
|
106
|
+
orig_content_type = content_type == nil ? nil : content_type.clone
|
106
107
|
status, headers, body = @filter.outbound(200, { "Content-Type" => content_type}, ['適当な本文'])
|
107
108
|
headers['Content-Type'].should == valid_content_type
|
109
|
+
# 元の文字列に直接変更を加えない(Rails3.0でハッシュを使い回してるようだったので)
|
110
|
+
content_type.should == orig_content_type
|
108
111
|
end
|
109
112
|
end
|
110
113
|
|
@@ -88,4 +88,21 @@ describe Rack::Ketai::Carrier::General::EmoticonFilter, "外部フィルタを
|
|
88
88
|
|
89
89
|
end
|
90
90
|
|
91
|
+
it "Content-typeは触らないこと" do
|
92
|
+
[
|
93
|
+
[nil, nil],
|
94
|
+
['text/html'],
|
95
|
+
['application/xhtml+xml'],
|
96
|
+
['text/javascript'],
|
97
|
+
['text/json'],
|
98
|
+
['application/json'],
|
99
|
+
['text/javascript+json'],
|
100
|
+
['image/jpeg'],
|
101
|
+
['application/octet-stream'],
|
102
|
+
].each do |content_type|
|
103
|
+
status, headers, body = @filter.outbound(200, { "Content-Type" => content_type}, ['適当な本文'])
|
104
|
+
headers['Content-Type'].should == content_type
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
91
108
|
end
|
@@ -131,8 +131,11 @@ describe Rack::Ketai::Carrier::Softbank::Filter, "外部フィルタを適用す
|
|
131
131
|
['image/jpeg', 'image/jpeg'],
|
132
132
|
['application/octet-stream', 'application/octet-stream'],
|
133
133
|
].each do |content_type, valid_content_type|
|
134
|
+
orig_content_type = content_type == nil ? nil : content_type.clone
|
134
135
|
status, headers, body = @filter.outbound(200, { "Content-Type" => content_type}, ['適当な本文'])
|
135
136
|
headers['Content-Type'].should == valid_content_type
|
137
|
+
# 元の文字列に直接変更を加えない(Rails3.0でハッシュを使い回してるようだったので)
|
138
|
+
content_type.should == orig_content_type
|
136
139
|
end
|
137
140
|
end
|
138
141
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Yuichi Takeuchi
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-21 00:00:00 +09:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|