itaiji 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.
- checksums.yaml +8 -8
- data/.travis +0 -1
- data/README.md +14 -2
- data/Rakefile +3 -1
- data/itaiji.gemspec +2 -1
- data/lib/itaiji/core_ext/string/conversions.rb +20 -0
- data/lib/itaiji.rb +1 -0
- data/spec/lib/itaiji/converter_spec.rb +2 -2
- data/spec/lib/itaiji/core_ext/string/conversions_spec.rb +25 -0
- metadata +19 -3
- data/Gemfile.lock +0 -27
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGZlZDc2NWYyMzRiNTdiM2RjNDBlNjc0OWE4MTY0NzI5MzVmZTM5Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2NlOWQzZjBhMjEyMTc5YzdjNTExZThhMTVkMWEyMGRmYjlmYjkyZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjE3MTE4MzkwNTAxMmI5Y2QwZWM3M2M3ZjNiODRjODgxNTcwY2M4NzAwMDIw
|
10
|
+
YWEzMzk4YjcwNzYxMjBmODIzNWQyNWU0MzJmNTU3MTVkMjRmNzEzNmE3ZDM2
|
11
|
+
NTc5ZmNjMWUzYmNhYTNmNzk2OTQ4YmYyYTNhOWJmYzcwNzhmYjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njg1ZjBmNGM2Y2NkM2ViZjMyOGZiNDMzNzJmM2QxNDRlOTIzYWE0YzFiNDAy
|
14
|
+
YjA4ODRjNzFhMTBjNWVlMWU2M2Y4OGQxNWJiZjM3ZDA2MGQxODA5MGUxOGZi
|
15
|
+
ZjhiZjAwNWM1MjBiMzBhNTNhYmNlNzJkMmQ0YzU0ZDM0ZGJmMWU=
|
data/.travis
CHANGED
data/README.md
CHANGED
@@ -24,11 +24,23 @@ Usage
|
|
24
24
|
|
25
25
|
```
|
26
26
|
converter = Itaiji::Converter.new
|
27
|
-
converter.convert_seijitai('髙橋') # => '高橋'
|
28
27
|
|
29
|
-
converter.
|
28
|
+
converter.convert_seijitai('齊藤') # => '斉藤'
|
29
|
+
converter.convert_itaiji('斉藤') # => '齊藤'
|
30
30
|
```
|
31
31
|
|
32
|
+
or
|
33
|
+
|
34
|
+
```
|
35
|
+
using Itaiji::Conversions
|
36
|
+
|
37
|
+
'齊藤'.to_seijitai # => '斉藤'
|
38
|
+
'斉藤'.to_itaiji # => '齊藤'
|
39
|
+
```
|
40
|
+
|
41
|
+
(only ruby version >= 2.0.0)
|
42
|
+
|
43
|
+
|
32
44
|
Source
|
33
45
|
------
|
34
46
|
http://wwwap.hi.u-tokyo.ac.jp/ships/itaiji_list.jsp
|
data/Rakefile
CHANGED
data/itaiji.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "itaiji"
|
4
|
-
spec.version = "0.1.
|
4
|
+
spec.version = "0.1.3"
|
5
5
|
spec.authors = ["Masahiro Saito"]
|
6
6
|
spec.email = ["camelmasa@gmail.com"]
|
7
7
|
spec.summary = %q{Convert japanese itaiji(異体字) to seijitai(正字体) and also reverse convert.}
|
@@ -16,4 +16,5 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.add_development_dependency 'bundler'
|
17
17
|
spec.add_development_dependency 'rake'
|
18
18
|
spec.add_development_dependency 'rspec'
|
19
|
+
spec.add_development_dependency 'pry'
|
19
20
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Itaiji
|
2
|
+
module Conversions
|
3
|
+
refine String do
|
4
|
+
|
5
|
+
def to_seijitai
|
6
|
+
itaiji_converter.convert_seijitai(self)
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_itaiji
|
10
|
+
itaiji_converter.convert_itaiji(self)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def itaiji_converter
|
16
|
+
@itaiji_converter ||= Itaiji::Converter.new
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/itaiji.rb
CHANGED
@@ -8,14 +8,14 @@ describe Itaiji::Converter do
|
|
8
8
|
let(:converter) { Itaiji::Converter.new }
|
9
9
|
|
10
10
|
describe '#convert_seijitai' do
|
11
|
-
it '
|
11
|
+
it 'converts name from itaiji to seijitai' do
|
12
12
|
expect {
|
13
13
|
converter.convert_seijitai(itaiji_text)
|
14
14
|
}.to change{ itaiji_text }.to seijitai_text
|
15
15
|
end
|
16
16
|
end
|
17
17
|
describe '#convert_itaiji' do
|
18
|
-
it '
|
18
|
+
it 'converts name from seijitai to itaiji' do
|
19
19
|
expect {
|
20
20
|
converter.convert_itaiji(seijitai_text)
|
21
21
|
}.to change{ seijitai_text }.to itaiji_text
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
using Itaiji::Conversions
|
4
|
+
|
5
|
+
describe Itaiji::Conversions do
|
6
|
+
|
7
|
+
let(:itaiji_text) { '齊藤正澔' }
|
8
|
+
let(:seijitai_text) { '斉藤正浩' }
|
9
|
+
let(:converter) { Itaiji::Converter.new }
|
10
|
+
|
11
|
+
describe '#to_seijitai' do
|
12
|
+
it 'converts name from itaiji to seijitai' do
|
13
|
+
expect {
|
14
|
+
itaiji_text.to_seijitai
|
15
|
+
}.to change{ itaiji_text }.to seijitai_text
|
16
|
+
end
|
17
|
+
end
|
18
|
+
describe '#convert_itaiji' do
|
19
|
+
it 'converts name from seijitai to itaiji' do
|
20
|
+
expect {
|
21
|
+
seijitai_text.to_itaiji
|
22
|
+
}.to change{ seijitai_text }.to itaiji_text
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itaiji
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Saito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: Convert japanese itaiji(異体字) to seijitai(正字体) and also reverse convert.
|
56
70
|
email:
|
57
71
|
- camelmasa@gmail.com
|
@@ -62,14 +76,15 @@ files:
|
|
62
76
|
- .rspec
|
63
77
|
- .travis
|
64
78
|
- Gemfile
|
65
|
-
- Gemfile.lock
|
66
79
|
- MIT-LICENSE
|
67
80
|
- README.md
|
68
81
|
- Rakefile
|
69
82
|
- itaiji.gemspec
|
70
83
|
- lib/itaiji.rb
|
71
84
|
- lib/itaiji/converter.rb
|
85
|
+
- lib/itaiji/core_ext/string/conversions.rb
|
72
86
|
- spec/lib/itaiji/converter_spec.rb
|
87
|
+
- spec/lib/itaiji/core_ext/string/conversions_spec.rb
|
73
88
|
- spec/spec_helper.rb
|
74
89
|
homepage: https://github.com/camelmasa/itaiji
|
75
90
|
licenses:
|
@@ -97,4 +112,5 @@ specification_version: 4
|
|
97
112
|
summary: Convert japanese itaiji(異体字) to seijitai(正字体) and also reverse convert.
|
98
113
|
test_files:
|
99
114
|
- spec/lib/itaiji/converter_spec.rb
|
115
|
+
- spec/lib/itaiji/core_ext/string/conversions_spec.rb
|
100
116
|
- spec/spec_helper.rb
|
data/Gemfile.lock
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
itaiji (0.1.2)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
diff-lcs (1.2.5)
|
10
|
-
rake (10.3.2)
|
11
|
-
rspec (2.14.1)
|
12
|
-
rspec-core (~> 2.14.0)
|
13
|
-
rspec-expectations (~> 2.14.0)
|
14
|
-
rspec-mocks (~> 2.14.0)
|
15
|
-
rspec-core (2.14.8)
|
16
|
-
rspec-expectations (2.14.5)
|
17
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
18
|
-
rspec-mocks (2.14.6)
|
19
|
-
|
20
|
-
PLATFORMS
|
21
|
-
ruby
|
22
|
-
|
23
|
-
DEPENDENCIES
|
24
|
-
bundler
|
25
|
-
itaiji!
|
26
|
-
rake
|
27
|
-
rspec
|