smtpapi 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smtpapi.rb +9 -1
- data/lib/smtpapi/version.rb +1 -1
- data/test/test.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63d928fcd070fe4c095e4a275cd9870bfa31c261
|
4
|
+
data.tar.gz: 3f6bfcaf8c9c683fe7cd52010da69c184e873b26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d49b306832a949967a29afee9d07a918fa88245ceb7f02e47481ae5618bff128cac8b69056bd4a60228583c1fdfd036f97be0ac3c67863e943cc25a9b5466e8
|
7
|
+
data.tar.gz: 3c81b951a567c981b7276e4f7074d6b8b8a717e7a9ee64a94a99c23320694d382f3c5db1a5cbc08ff2cabd427934f6380f486d308992d1a4ebca9bcb4c9643e6
|
data/lib/smtpapi.rb
CHANGED
@@ -125,7 +125,15 @@ module Smtpapi
|
|
125
125
|
alias_method :to_json, :json_string
|
126
126
|
|
127
127
|
def escape_unicode(str)
|
128
|
-
str.unpack('U*').map{|i|
|
128
|
+
str.unpack('U*').map{|i|
|
129
|
+
if i > 65535 then
|
130
|
+
"\\u#{((i - 0x10000) / 0x400 + 0xD800).to_s(16)}\\u#{((i - 0x10000) % 0x400 + 0xDC00).to_s(16)}" if i > 65535
|
131
|
+
elsif i > 127 then
|
132
|
+
"\\u#{i.to_s(16)}"
|
133
|
+
else
|
134
|
+
i.chr("UTF-8")
|
135
|
+
end
|
136
|
+
}.join
|
129
137
|
end
|
130
138
|
|
131
139
|
end
|
data/lib/smtpapi/version.rb
CHANGED
data/test/test.rb
CHANGED
@@ -5,7 +5,7 @@ require "./lib/smtpapi"
|
|
5
5
|
class SmtpapiTest < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def test_version
|
8
|
-
assert_equal("0.0.
|
8
|
+
assert_equal("0.0.9", Smtpapi::VERSION)
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_empty
|
@@ -110,6 +110,8 @@ class SmtpapiTest < Test::Unit::TestCase
|
|
110
110
|
header.add_category('天破活殺') # category = ['天破活殺']
|
111
111
|
header.add_category('天翔十字鳳') # category = ['天破活殺', '天翔十字鳳']
|
112
112
|
assert_equal("{\"category\":[\"\\u5929\\u7834\\u6d3b\\u6bba\",\"\\u5929\\u7fd4\\u5341\\u5b57\\u9cf3\"]}",header.json_string)
|
113
|
+
header.add_category('鼖') # category = ['天破活殺', '天翔十字鳳', '鼖']
|
114
|
+
assert_equal("{\"category\":[\"\\u5929\\u7834\\u6d3b\\u6bba\",\"\\u5929\\u7fd4\\u5341\\u5b57\\u9cf3\",\"\\ud87e\\ude1b\"]}",header.json_string)
|
113
115
|
end
|
114
116
|
|
115
117
|
def test_sent_send_at
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smtpapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wataru Sato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|