e4u 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +88 -0
- data/VERSION +1 -0
- data/data/docomo/carrier_data.xml +285 -0
- data/data/emoji4unicode.xml +2172 -0
- data/data/kddi/carrier_data.xml +650 -0
- data/data/softbank/carrier_data.xml +488 -0
- data/lib/e4u.rb +30 -0
- data/lib/e4u/base.rb +77 -0
- data/lib/e4u/docomo.rb +37 -0
- data/lib/e4u/google.rb +60 -0
- data/lib/e4u/kddi.rb +69 -0
- data/lib/e4u/softbank.rb +35 -0
- data/lib/e4u/util.rb +25 -0
- data/spec/docomo_spec.rb +54 -0
- data/spec/e4u_spec.rb +14 -0
- data/spec/google_spec.rb +116 -0
- data/spec/kddi_spec.rb +80 -0
- data/spec/softbank_spec.rb +53 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- metadata +93 -0
data/spec/kddi_spec.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
|
+
|
4
|
+
describe E4U::KDDI do
|
5
|
+
before :all do
|
6
|
+
@kddi = E4U.kddi
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should include Enumerable" do
|
10
|
+
@kddi.should be_kind_of Enumerable
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should include E4U::KDDI::Emojinize" do
|
14
|
+
@kddi.first.should be_kind_of E4U::KDDI::Emojinize
|
15
|
+
end
|
16
|
+
|
17
|
+
it "E4U.kddiとE4U.kddiwebは同じものを返すこと" do
|
18
|
+
E4U.kddi.should == E4U.kddiweb
|
19
|
+
end
|
20
|
+
|
21
|
+
it "すべての要素に:unicodeをキーとしたデータはあること" do
|
22
|
+
@kddi.each do |emj|
|
23
|
+
emj.should have_key(:unicode)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it "正しくデータを取得できること" do
|
28
|
+
# <e name_ja="太陽" number="44" unicode="E488"/>
|
29
|
+
emj = @kddi.find{ |e| e[:number] == '44' }
|
30
|
+
emj[:unicode].should == 'E488'
|
31
|
+
emj[:name_ja].should == '太陽'
|
32
|
+
emj[:number].should == '44'
|
33
|
+
end
|
34
|
+
|
35
|
+
it "kddi_emojiでE4U::KDDI::Emojiが返ってくること" do
|
36
|
+
emj = @kddi.find{ |e| e[:number] == '44' }
|
37
|
+
emj.kddi_emoji.should be_instance_of E4U::KDDI::Emoji
|
38
|
+
end
|
39
|
+
|
40
|
+
it "kddiweb_emojiでE4U::KDDIWeb::Emojiが返ってくること" do
|
41
|
+
emj = @kddi.find{ |e| e[:number] == '44' }
|
42
|
+
emj.kddiweb_emoji.should be_instance_of E4U::KDDIWeb::Emoji
|
43
|
+
end
|
44
|
+
|
45
|
+
describe E4U::KDDI::Emoji do
|
46
|
+
before :all do
|
47
|
+
@emj = @kddi.find{ |e| e[:number] == '44' }.kddi_emoji
|
48
|
+
end
|
49
|
+
|
50
|
+
it "utf8が返ってくること" do
|
51
|
+
@emj.utf8.should == [0xE488].pack('U')
|
52
|
+
end
|
53
|
+
|
54
|
+
it "sjisが返ってくること" do
|
55
|
+
@emj.sjis.dump.should == "\xF6\x60".dump
|
56
|
+
end
|
57
|
+
|
58
|
+
it "alternate?が返ってくること" do
|
59
|
+
@emj.alternate?.should be_false
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe E4U::KDDIWeb::Emoji do
|
64
|
+
before :all do
|
65
|
+
@emj = @kddi.find{ |e| e[:number] == '44' }.kddiweb_emoji
|
66
|
+
end
|
67
|
+
|
68
|
+
it "utf8が返ってくること" do
|
69
|
+
@emj.utf8.should == [0xEF60].pack('U')
|
70
|
+
end
|
71
|
+
|
72
|
+
it "sjisが返ってくること" do
|
73
|
+
@emj.sjis.dump.should == "\xF6\x60".dump
|
74
|
+
end
|
75
|
+
|
76
|
+
it "alternate?が返ってくること" do
|
77
|
+
@emj.alternate?.should be_false
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
|
+
|
4
|
+
describe E4U::Softbank do
|
5
|
+
before :all do
|
6
|
+
@softbank = E4U.softbank
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should include Enumerable" do
|
10
|
+
@softbank.should be_kind_of Enumerable
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should include E4U::Softbank::Emojinize" do
|
14
|
+
@softbank.first.should be_kind_of E4U::Softbank::Emojinize
|
15
|
+
end
|
16
|
+
|
17
|
+
it "すべての要素に:unicodeをキーとしたデータはあること" do
|
18
|
+
@softbank.each do |emj|
|
19
|
+
emj.should have_key(:unicode)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
it "正しくデータを取得できること" do
|
24
|
+
# <e name_ja="晴れ" number="81" unicode="E04A"/>
|
25
|
+
emj = @softbank.find{ |e| e[:number] == '81' }
|
26
|
+
emj[:unicode].should == 'E04A'
|
27
|
+
emj[:name_ja].should == '晴れ'
|
28
|
+
emj[:number].should == '81'
|
29
|
+
end
|
30
|
+
|
31
|
+
it "softbank_emojiでE4U::Softbank::Emojiが返ってくること" do
|
32
|
+
emj = @softbank.find{ |e| e[:number] == '81' }
|
33
|
+
emj.softbank_emoji.should be_instance_of E4U::Softbank::Emoji
|
34
|
+
end
|
35
|
+
|
36
|
+
describe E4U::Softbank::Emoji do
|
37
|
+
before :all do
|
38
|
+
@emj = @softbank.find{ |e| e[:number] == '81' }.softbank_emoji
|
39
|
+
end
|
40
|
+
|
41
|
+
it "utf8が返ってくること" do
|
42
|
+
@emj.utf8.should == [0xE04A].pack('U')
|
43
|
+
end
|
44
|
+
|
45
|
+
it "sjisが返ってくること" do
|
46
|
+
@emj.sjis.dump.should == "\xF9\x8B".dump
|
47
|
+
end
|
48
|
+
|
49
|
+
it "alternate?が返ってくること" do
|
50
|
+
@emj.alternate?.should be_false
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: e4u
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- fistfvck
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-12-22 00:00:00 +09:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.2.9
|
24
|
+
version:
|
25
|
+
description: Emoji4Unicode for Ruby
|
26
|
+
email: fistfvck@gmail.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- LICENSE
|
33
|
+
- README.rdoc
|
34
|
+
files:
|
35
|
+
- .document
|
36
|
+
- .gitignore
|
37
|
+
- LICENSE
|
38
|
+
- README.rdoc
|
39
|
+
- Rakefile
|
40
|
+
- VERSION
|
41
|
+
- data/docomo/carrier_data.xml
|
42
|
+
- data/emoji4unicode.xml
|
43
|
+
- data/kddi/carrier_data.xml
|
44
|
+
- data/softbank/carrier_data.xml
|
45
|
+
- lib/e4u.rb
|
46
|
+
- lib/e4u/base.rb
|
47
|
+
- lib/e4u/docomo.rb
|
48
|
+
- lib/e4u/google.rb
|
49
|
+
- lib/e4u/kddi.rb
|
50
|
+
- lib/e4u/softbank.rb
|
51
|
+
- lib/e4u/util.rb
|
52
|
+
- spec/docomo_spec.rb
|
53
|
+
- spec/e4u_spec.rb
|
54
|
+
- spec/google_spec.rb
|
55
|
+
- spec/kddi_spec.rb
|
56
|
+
- spec/softbank_spec.rb
|
57
|
+
- spec/spec.opts
|
58
|
+
- spec/spec_helper.rb
|
59
|
+
has_rdoc: true
|
60
|
+
homepage: http://github.com/fistfvck/e4u
|
61
|
+
licenses: []
|
62
|
+
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options:
|
65
|
+
- --charset=UTF-8
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: "0"
|
73
|
+
version:
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
79
|
+
version:
|
80
|
+
requirements: []
|
81
|
+
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 1.3.5
|
84
|
+
signing_key:
|
85
|
+
specification_version: 3
|
86
|
+
summary: Emoji4Unicode for Ruby
|
87
|
+
test_files:
|
88
|
+
- spec/docomo_spec.rb
|
89
|
+
- spec/google_spec.rb
|
90
|
+
- spec/kddi_spec.rb
|
91
|
+
- spec/spec_helper.rb
|
92
|
+
- spec/e4u_spec.rb
|
93
|
+
- spec/softbank_spec.rb
|