integer_to_japanese 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 41cf213b3059ec5834a07b61517f4cca8b71e53a92e2d259b68461326c802778
4
+ data.tar.gz: 06537b277b42d5e40c0afe3ca88856eaf7cbebd9c8cf55676ded71fb5391a2b6
5
+ SHA512:
6
+ metadata.gz: 891c06e3ae09f679c12173680a0443c4c765a9be94b5ef1b376090494ffa91cf9bf2de0eeafda51159c131338b79bab90149b9a5bb78b252bc40d3c94b89c55f
7
+ data.tar.gz: dd96f1e07ca0fec316444fb67ced743dffbdf2e1cd341df25d632d5fd60bbc7ef2bcc2a4cc00e15abd38ff7db2ebb4b2230c9ca0b61a1def8abdfce9611f00cc
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,22 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 160
14
+ Exclude:
15
+ - "spec/**/*"
16
+
17
+ Metrics/MethodLength:
18
+ Max: 20
19
+
20
+ Metrics/BlockLength:
21
+ Exclude:
22
+ - "spec/**/*"
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-01-28
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in integer_to_japanese.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 かめ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 TODO: Write your name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # IntegerToJapanese
2
+
3
+ 数値を日本語読みにする処理を追加します。
4
+
5
+ ## 追加方法
6
+
7
+ gemに追加します。
8
+
9
+ ```bash
10
+ $ gem install integer_to_japanese
11
+ ```
12
+
13
+ またはGemfileに追加します。
14
+
15
+ ```ruby
16
+ gem 'integer_to_japanese'
17
+ ```
18
+
19
+ ## 使い方
20
+
21
+ ```ruby
22
+ require 'integer_to_japanese'
23
+
24
+ 800.to_hiragana
25
+ #=> "はっぴゃく"
26
+
27
+ 3000.to_katakana
28
+ #=> "サンゼン"
29
+
30
+ 20000.to_kanji
31
+ #=> "二万"
32
+ ```
33
+
34
+ 負数の場合はマイナスが付きます。
35
+
36
+ ```ruby
37
+ -100.to_hiragana
38
+ #=> "まいなすひゃく"
39
+
40
+ # 漢字の場合はカタカナ表記で付きます
41
+ -50.to_kanji
42
+ #=> "マイナス五十"
43
+ ```
44
+
45
+ 無量大数を超える位の数字はnilになります。
46
+
47
+ ```ruby
48
+ (10 ** 71).to_kanji
49
+ #=> "千無量大数"
50
+
51
+ (10 ** 72).to_kanji
52
+ #=> nil
53
+ ```
54
+
55
+ ## License
56
+
57
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/integer_to_japanese/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "integer_to_japanese"
7
+ spec.version = IntegerToJapanese::VERSION
8
+ spec.authors = ["kametter"]
9
+ spec.email = ["kunikazu.kamei@arabato.jp"]
10
+
11
+ spec.summary = "Integerを日本語読みに変換するgem"
12
+ spec.description = "Integerの値を漢字、ひらがな、カタカナに変換します"
13
+ spec.homepage = "https://github.com/kametter/integer_to_japanese"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://github.com/kametter/integer_to_japanese"
19
+ spec.metadata["changelog_uri"] = "https://github.com/kametter/integer_to_japanese/blob/main/CHANGELOG.md"
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(__dir__) do
24
+ `git ls-files -z`.split("\x0").reject do |f|
25
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
26
+ end
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ # Uncomment to register a new dependency of your gem
33
+ # spec.add_dependency "example-gem", "~> 1.0"
34
+
35
+ # For more information and examples about making a new gem, check out our
36
+ # guide at: https://bundler.io/guides/creating_gem.html
37
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module IntegerToJapanese
4
+ module Constants
5
+ HIRAGANA_MINUS = "まいなす"
6
+ HIRAGANA_ZERO = "ぜろ"
7
+ HIRAGANA_WORDS = ["", "いち", "に", "さん", "よん", "ご", "ろく", "なな", "はち", "きゅう"].freeze
8
+ HIRAGANA_SUB_NUMERAL = ["", "じゅう", "ひゃく", "せん"].freeze
9
+ HIRAGANA_NUMERAL = ["", "まん", "おく", "ちょう", "けい", "がい", "じょ", "じょう", "こう", "かん", "せい", "さい", "ごく", "ごうがしゃ", "あそうぎ", "なゆた", "ふかしぎ", "むりょうたいすう"].freeze
10
+ SPECIAL_HIRAGANA_SUB_NUMERALS = {
11
+ [0, 0].freeze => "", [0, 1].freeze => "", [0, 2].freeze => "", [0, 3].freeze => "",
12
+ [1, 1].freeze => "じゅう", [1, 2].freeze => "ひゃく", [1, 3].freeze => "せん",
13
+ [3, 2].freeze => "さんびゃく", [3, 3].freeze => "さんぜん",
14
+ [6, 2].freeze => "ろっぴゃく",
15
+ [8, 2].freeze => "はっぴゃく", [8, 3].freeze => "はっせん"
16
+ }.freeze
17
+ SPECIAL_NUMERALS = {
18
+ [1, 3].freeze => "いっちょう", [8, 3].freeze => "はっちょう",
19
+ [1, 4].freeze => "いっけい", [6, 4].freeze => "ろっけい", [8, 4].freeze => "はっけい",
20
+ [1, 8].freeze => "いっこう", [6, 8].freeze => "ろっこう", [8, 8].freeze => "はっこう",
21
+ [1, 9].freeze => "いっかん", [6, 9].freeze => "ろっかん", [8, 9].freeze => "はっかん",
22
+ [1, 10].freeze => "いっせい", [8, 10].freeze => "はっせい",
23
+ [1, 11].freeze => "いっさい", [8, 11].freeze => "はっさい"
24
+ }.freeze
25
+ SPECIAL_TEN_NUMERALS = {
26
+ "じゅうちょう" => "じっちょう", "じゅうけい" => "じっけい",
27
+ "じゅうこう" => "じっこう", "じゅうかん" => "じっかん",
28
+ "じゅうせい" => "じっせい", "じゅうさい" => "じっさい"
29
+ }.freeze
30
+
31
+ KANJI_MINUS = "マイナス"
32
+ KANJI_ZERO = "零"
33
+ KANJI_WORDS = ["", "一", "二", "三", "四", "五", "六", "七", "八", "九"].freeze
34
+ KANJI_SUB_NUMERAL = ["", "十", "百", "千"].freeze
35
+ KANJI_NUMERAL = ["", "万", "億", "兆", "京", "垓", "秭", "穰", "溝", "澗", "正", "載", "極", "恒河沙", "阿僧祇", "那由他", "不可思議", "無量大数"].freeze
36
+ SPECIAL_KANJI_SUB_NUMERALS = {
37
+ [0, 0].freeze => "", [0, 1].freeze => "", [0, 2].freeze => "", [0, 3].freeze => "",
38
+ [1, 1].freeze => "十", [1, 2].freeze => "百", [1, 3].freeze => "千"
39
+ }.freeze
40
+
41
+ READABLE_LIMIT_NUMBER =
42
+ 1_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000
43
+ end
44
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module IntegerToJapanese
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,129 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "integer_to_japanese/version"
4
+ require_relative "integer_to_japanese/constants"
5
+
6
+ # Integer用の日本語変換モジュール
7
+ module IntegerToJapanese
8
+ include Constants
9
+
10
+ # 数値のひらがなよみを返します
11
+ #
12
+ # @example
13
+ # 10.to_hiragana #=> "じゅう"
14
+ # 1110.to_hiragana #=> "せんひゃくじゅう"
15
+ # 8_000_000.to_hiragana #=> "はっぴゃくまん"
16
+ # @return [String] ひらがなに変換した文字列
17
+ # @return [nil] 無量大数の次の位の値の場合
18
+ def to_hiragana
19
+ return HIRAGANA_ZERO if zero?
20
+ return nil if self >= READABLE_LIMIT_NUMBER
21
+
22
+ has_numeral = true
23
+ result = digits_map do |digit, index|
24
+ converted_digit, has_numeral = convert_digit_to_hiragana(digit, index, has_numeral)
25
+ converted_digit
26
+ end
27
+ "#{negative? ? HIRAGANA_MINUS : nil}#{convert_ten_numerals(result)}"
28
+ end
29
+
30
+ # 数値のカタカナよみを返します
31
+ #
32
+ # @example
33
+ # 10.to_katakana #=> "ジュウ"
34
+ # 1110.to_katakana #=> "センヒャクジュウ"
35
+ # 8_000_000.to_katakana #=> "ハッピャクマン"
36
+ # @return [String] カタカナに変換した文字列
37
+ # @return [nil] 無量大数の次の位の値の場合
38
+ def to_katakana
39
+ to_hiragana&.tr("ぁ-ん", "ァ-ン")
40
+ end
41
+
42
+ # 数値漢字よみを返します<br>
43
+ # ただし負数のマイナスはカタカナを返します
44
+ #
45
+ # @example
46
+ # 10.to_kanji #=> "十"
47
+ # 1110.to_kanji #=> "千百十"
48
+ # 8_000_000.to_kanji #=> "八百万"
49
+ # -100.to_kanji #=> "マイナス百"
50
+ # @return [String] 漢字に変換した文字列
51
+ # @return [nil] 無量大数の次の位の値の場合
52
+ def to_kanji
53
+ return KANJI_ZERO if zero?
54
+ return nil if self >= READABLE_LIMIT_NUMBER
55
+
56
+ has_numeral = true
57
+ result = digits_map do |digit, index|
58
+ converted_digit, has_numeral = convert_digit_to_kanji(digit, index, has_numeral)
59
+ converted_digit
60
+ end
61
+ "#{negative? ? KANJI_MINUS : nil}#{result}"
62
+ end
63
+
64
+ protected
65
+
66
+ # 各桁の変換処理<br>
67
+ # 各桁をblockの内容で変換し、結果を文字列連結して返す処理
68
+ def digits_map
69
+ size_count = abs.digits.size
70
+ abs.digits.reverse.map.with_index do |digit, reverse_index|
71
+ index = size_count - 1 - reverse_index
72
+ yield(digit, index)
73
+ end.join
74
+ end
75
+
76
+ # 数値をひらがなに変換
77
+ def convert_digit_to_hiragana(digit, index, has_numeral)
78
+ result = ""
79
+ sub_numeral = index % 4
80
+ digit_word = HIRAGANA_WORDS[digit]
81
+ has_numeral |= !digit_word.empty?
82
+ if sub_numeral.zero?
83
+ # 万、億等の単位表示桁の場合
84
+ return [result, has_numeral] unless has_numeral
85
+
86
+ has_numeral = false
87
+ numeral = index / 4
88
+ result = SPECIAL_NUMERALS[[digit, numeral]] || "#{digit_word}#{HIRAGANA_NUMERAL[numeral]}"
89
+ else
90
+ # 千、百等のサブ単位表示桁の場合
91
+ result = SPECIAL_HIRAGANA_SUB_NUMERALS[[digit, sub_numeral]] || "#{digit_word}#{HIRAGANA_SUB_NUMERAL[sub_numeral]}"
92
+ end
93
+ [result, has_numeral]
94
+ end
95
+
96
+ # 数値を漢字に変換
97
+ def convert_digit_to_kanji(digit, index, has_numeral)
98
+ result = ""
99
+ sub_numeral = index % 4
100
+ digit_word = KANJI_WORDS[digit]
101
+ has_numeral |= !digit_word.empty?
102
+ if sub_numeral.zero?
103
+ # 万、億等の単位表示桁の場合
104
+ return [result, has_numeral] unless has_numeral
105
+
106
+ has_numeral = false
107
+ numeral = index / 4
108
+ result = "#{digit_word}#{KANJI_NUMERAL[numeral]}"
109
+ else
110
+ # 千、百等のサブ単位表示桁の場合
111
+ result = SPECIAL_KANJI_SUB_NUMERALS[[digit, sub_numeral]] || "#{digit_word}#{KANJI_SUB_NUMERAL[sub_numeral]}"
112
+ end
113
+ [result, has_numeral]
114
+ end
115
+
116
+ # 特殊処理として10 + 特定の単位のときに「じゅう」を「じっ」に置換
117
+ # @example
118
+ # convert_ten_numerals("じゅうちょう") #=> "じっちょう"
119
+ def convert_ten_numerals(string)
120
+ SPECIAL_TEN_NUMERALS.each do |before, after|
121
+ string.gsub!(before, after)
122
+ end
123
+ string
124
+ end
125
+ end
126
+
127
+ class Integer
128
+ include IntegerToJapanese
129
+ end
@@ -0,0 +1,20 @@
1
+ module IntegerToJapanese
2
+ module Constants
3
+ HIRAGANA_MINUS: String
4
+ HIRAGANA_ZERO: String
5
+ HIRAGANA_WORDS: Array[String]
6
+ HIRAGANA_SUB_NUMERAL: Array[String]
7
+ HIRAGANA_NUMERAL: Array[String]
8
+ SPECIAL_HIRAGANA_SUB_NUMERALS: Hash[Array[Integer], String]
9
+ SPECIAL_NUMERALS: Hash[Array[Integer], String]
10
+ SPECIAL_TEN_NUMERALS: Hash[String, String]
11
+
12
+ KANJI_MINUS: String
13
+ KANJI_ZERO: String
14
+ KANJI_WORDS: Array[String]
15
+ KANJI_SUB_NUMERAL: Array[String]
16
+ KANJI_NUMERAL: Array[String]
17
+ SPECIAL_KANJI_SUB_NUMERALS: Hash[Array[Integer], String]
18
+ READABLE_LIMIT_NUMBER: Integer
19
+ end
20
+ end
@@ -0,0 +1,11 @@
1
+ module IntegerToJapanese
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ def to_hiragana: -> String?
5
+ def to_katakana: -> String?
6
+ def to_kanji: -> String?
7
+ def digits_map: -> String
8
+ def convert_digit_to_hiragana: -> Array[String|bool]
9
+ def convert_digit_to_kanji: -> Array[String|bool]
10
+ def convert_ten_numerals: -> String
11
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: integer_to_japanese
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - kametter
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-01-28 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Integerの値を漢字、ひらがな、カタカナに変換します
14
+ email:
15
+ - kunikazu.kamei@arabato.jp
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rspec"
21
+ - ".rubocop.yml"
22
+ - CHANGELOG.md
23
+ - CODE_OF_CONDUCT.md
24
+ - Gemfile
25
+ - LICENSE
26
+ - LICENSE.txt
27
+ - README.md
28
+ - Rakefile
29
+ - integer_to_japanese.gemspec
30
+ - lib/integer_to_japanese.rb
31
+ - lib/integer_to_japanese/constants.rb
32
+ - lib/integer_to_japanese/version.rb
33
+ - sig/integer_to_japanese.rbs
34
+ - sig/integer_to_japanese/constants.rbs
35
+ homepage: https://github.com/kametter/integer_to_japanese
36
+ licenses:
37
+ - MIT
38
+ metadata:
39
+ homepage_uri: https://github.com/kametter/integer_to_japanese
40
+ source_code_uri: https://github.com/kametter/integer_to_japanese
41
+ changelog_uri: https://github.com/kametter/integer_to_japanese/blob/main/CHANGELOG.md
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 2.6.0
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubygems_version: 3.4.1
58
+ signing_key:
59
+ specification_version: 4
60
+ summary: Integerを日本語読みに変換するgem
61
+ test_files: []