kanji_master 0.2.5 → 0.2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46944f2344cb0c4c0e0aaf5a425e2dd07007df81
4
- data.tar.gz: bd0a9bd46b232c8588dbafb2b82041e6c83e3538
3
+ metadata.gz: bd3f16ee8fbaa760481aa706a153c163b58cd6ed
4
+ data.tar.gz: 5b4001d1fe89ebd075ad52287808112002322765
5
5
  SHA512:
6
- metadata.gz: c7e62429746ba7160910118141bd89865f8dce08626d80d41633ce8530f645b9e4e91928aebf20b5df673a381026fcfc032b76851d38673154b8daf65c122a6f
7
- data.tar.gz: f8626869093ad041123f0c14b86bb4ae6c5c4186eb321391434944857e139b401ea990218e423d57b7e44465ccf9e7e96e253c61426452fcfe3298b7c6fde46e
6
+ metadata.gz: 403eb42cdac246f1d4fac4b6e1fbf44c5021a00a10a2b2c82ea8a600340a302d415e3d945a35331ce686501801bc33bf9ca8e0a883df419b5ad664d8d36dcaaf
7
+ data.tar.gz: f3370e1a76e9ec145728ff6919c34d76c881d2547779c4c244a91efa2d4768fa4da646ffb5888f4d25911db7c52a8ab22b9f3ce95e5f7f7645d78efabdd55fc9
data/README.md CHANGED
@@ -55,11 +55,21 @@ converter.hira('スシ') #=> 'すし'
55
55
  converter.hira('sushi') #=> 'すし'
56
56
  ```
57
57
 
58
+ ### String Core Extension
59
+
60
+ ```ruby
61
+ require "kanji_master/core_extension/string"
62
+
63
+ "すし".kana #=> 'スシ'
64
+ "sushi".kana #=> 'スシ'
65
+ "スシ".hira #=> 'すし'
66
+ "sushi".hira #=> 'すし'
67
+ ```
68
+
58
69
  ## Development
59
70
 
60
71
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
61
72
 
62
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
63
73
 
64
74
  ## Contributing
65
75
 
@@ -0,0 +1,3 @@
1
+ require "kanji_master/string_extension"
2
+
3
+ String.send(:include, ::KanjiMaster::StringExtension)
@@ -0,0 +1,15 @@
1
+ module KanjiMaster
2
+ module StringExtension
3
+ def katakana; kana end
4
+ def kana
5
+ converter = Converter.new
6
+ converter.kana(self)
7
+ end
8
+
9
+ def hiragana; hira end
10
+ def hira
11
+ converter = Converter.new
12
+ converter.hira(self)
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module KanjiMaster
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanji_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - DONGSHIH TENG
@@ -130,9 +130,11 @@ files:
130
130
  - lib/kanji_master.rb
131
131
  - lib/kanji_master/constant.rb
132
132
  - lib/kanji_master/converter.rb
133
+ - lib/kanji_master/core_extension/string.rb
133
134
  - lib/kanji_master/counter.rb
134
135
  - lib/kanji_master/reader.rb
135
136
  - lib/kanji_master/regex_constant.rb
137
+ - lib/kanji_master/string_extension.rb
136
138
  - lib/kanji_master/text.rb
137
139
  - lib/kanji_master/version.rb
138
140
  homepage: https://github.com/ToUMenu/kanji-master