number_to_kanji 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b2f96e9e0fe5629f186da604f4b068f8e28d242013db45fbe48aa9dff0ab96cb
4
+ data.tar.gz: 1b97403530629dd9bb4e1718d1878c74c42081c6214328038c83a674521a14d7
5
+ SHA512:
6
+ metadata.gz: fef0b090cf24b460cab29f4c873ab7627c50732030b668b3b4130f696c63f5ce10b49d22cd57272296501b9b0663b6d936d03a919d7aff03debea04bde397d16
7
+ data.tar.gz: de2e63e4c8c73609ef6ed055376760c063f5a599884f628c894b88bd296ca9133f8c4b390da5262030bc7c500b3461aaa56a33322a5319d3b79503be37a7d5d1
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,29 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-rake
5
+ - rubocop-rspec
6
+
7
+ AllCops:
8
+ EnabledByDefault: true
9
+
10
+ # MITなのでファイルの著作権は記載しない。
11
+ Style/Copyright:
12
+ Enabled: false
13
+
14
+ # コメントを日本語で記述するのを許容する。
15
+ Style/AsciiComments:
16
+ Enabled: false
17
+
18
+ # contextの記述を日本語で記述するのを許容する。
19
+ RSpec/ContextWording:
20
+ Enabled: false
21
+
22
+ # 一つのテストで複数の内容を検証するのを許容する。
23
+ # ただし複数の振る舞いを検証するのは避ける。
24
+ RSpec/MultipleExpectations:
25
+ Enabled: false
26
+
27
+ # elseがない場合にはcase文ではなくif文を許容する。
28
+ Style/MissingElse:
29
+ EnforcedStyle: case
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,65 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-01-02 07:45:45 UTC using RuboCop version 1.24.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 2
10
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
11
+ Metrics/AbcSize:
12
+ Max: 23
13
+
14
+ # Offense count: 8
15
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
16
+ # IgnoredMethods: refine
17
+ Metrics/BlockLength:
18
+ Max: 129
19
+
20
+ # Offense count: 1
21
+ # Configuration parameters: IgnoredMethods.
22
+ Metrics/CyclomaticComplexity:
23
+ Max: 9
24
+
25
+ # Offense count: 1
26
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
27
+ Metrics/MethodLength:
28
+ Max: 12
29
+
30
+ # Offense count: 1
31
+ # Configuration parameters: IgnoredMethods.
32
+ Metrics/PerceivedComplexity:
33
+ Max: 9
34
+
35
+ # Offense count: 7
36
+ # Configuration parameters: CountAsOne.
37
+ RSpec/ExampleLength:
38
+ Max: 51
39
+
40
+ # Offense count: 3
41
+ # Configuration parameters: AllowedConstants.
42
+ Style/Documentation:
43
+ Exclude:
44
+ - 'spec/**/*'
45
+ - 'test/**/*'
46
+ - 'lib/number_to_kanji.rb'
47
+ - 'lib/number_to_kanji/exceptions/negative_number_error.rb'
48
+ - 'lib/number_to_kanji/small_number_to_kanji.rb'
49
+
50
+ # Offense count: 8
51
+ # Configuration parameters: RequireForNonPublicMethods.
52
+ Style/DocumentationMethod:
53
+ Exclude:
54
+ - 'spec/**/*'
55
+ - 'test/**/*'
56
+ - 'lib/number_to_kanji.rb'
57
+ - 'lib/number_to_kanji/exceptions/negative_number_error.rb'
58
+ - 'lib/number_to_kanji/small_number_to_kanji.rb'
59
+
60
+ # Offense count: 2
61
+ # Cop supports --auto-correct.
62
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
63
+ # URISchemes: http, https
64
+ Layout/LineLength:
65
+ Max: 148
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [1.0.0] - 2022-01-02
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 yamat47.thirddown@gmail.com. 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,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ number_to_kanji (1.0.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ diff-lcs (1.5.0)
11
+ parallel (1.21.0)
12
+ parser (3.0.3.2)
13
+ ast (~> 2.4.1)
14
+ rainbow (3.0.0)
15
+ rake (13.0.6)
16
+ regexp_parser (2.2.0)
17
+ rexml (3.2.5)
18
+ rspec (3.10.0)
19
+ rspec-core (~> 3.10.0)
20
+ rspec-expectations (~> 3.10.0)
21
+ rspec-mocks (~> 3.10.0)
22
+ rspec-core (3.10.1)
23
+ rspec-support (~> 3.10.0)
24
+ rspec-expectations (3.10.1)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.10.0)
27
+ rspec-mocks (3.10.2)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.10.0)
30
+ rspec-support (3.10.3)
31
+ rubocop (1.24.1)
32
+ parallel (~> 1.10)
33
+ parser (>= 3.0.0.0)
34
+ rainbow (>= 2.2.2, < 4.0)
35
+ regexp_parser (>= 1.8, < 3.0)
36
+ rexml
37
+ rubocop-ast (>= 1.15.1, < 2.0)
38
+ ruby-progressbar (~> 1.7)
39
+ unicode-display_width (>= 1.4.0, < 3.0)
40
+ rubocop-ast (1.15.1)
41
+ parser (>= 3.0.1.1)
42
+ rubocop-rake (0.6.0)
43
+ rubocop (~> 1.0)
44
+ rubocop-rspec (2.7.0)
45
+ rubocop (~> 1.19)
46
+ ruby-progressbar (1.11.0)
47
+ unicode-display_width (2.1.0)
48
+
49
+ PLATFORMS
50
+ arm64-darwin-21
51
+ x86_64-linux
52
+
53
+ DEPENDENCIES
54
+ number_to_kanji!
55
+ rake
56
+ rspec
57
+ rubocop
58
+ rubocop-rake
59
+ rubocop-rspec
60
+
61
+ BUNDLED WITH
62
+ 2.3.3
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Yamaguchi Takuya
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,52 @@
1
+ # NumberToKanji
2
+ NumberToKanji is a Ruby Gem that translates number (integer) to Japanese Kanji.
3
+ It supports numbers between 0 to 10^24 ("垓").
4
+
5
+ ## Installation
6
+ Add this line to your application's Gemfile:
7
+
8
+ ```ruby
9
+ gem 'number_to_kanji'
10
+ ```
11
+
12
+ And then execute:
13
+
14
+ ```
15
+ $ bundle install
16
+ ```
17
+
18
+ Or install it yourself as:
19
+
20
+ ```
21
+ $ gem install number_to_kanji
22
+ ```
23
+
24
+ ## Usage
25
+ ```ruby
26
+ require 'number_to_kanji'
27
+
28
+ NumberToKanji.call(123) #=> "百二十三"
29
+ NumberToKanji.call(123456) #=> "十二万三千四百五十六"
30
+ NumberToKanji.call(123456789) #=> "一億二千三百四十五万六千七百八十九"
31
+ ```
32
+
33
+ ## Development
34
+ To install dependencies, run:
35
+
36
+ ```
37
+ bin/setup
38
+ ```
39
+
40
+ To run the tests and the linters, run:
41
+
42
+ ```
43
+ rake
44
+ ```
45
+
46
+ ## License
47
+
48
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
49
+
50
+ ## Code of Conduct
51
+
52
+ Everyone interacting in the NumberToKanji project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/number_to_kanji/blob/main/CODE_OF_CONDUCT.md).
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]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'number_to_kanji'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ ::IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NumberToKanji
4
+ module Exceptions
5
+ class NegativeNumberError < ArgumentError
6
+ def initialize(msg = 'Negative number is not supported.')
7
+ super
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './exceptions/negative_number_error'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NumberToKanji
4
+ KANJI_MAP = { 0 => '〇', 1 => '一', 2 => '二', 3 => '三', 4 => '四', 5 => '五', 6 => '六', 7 => '七', 8 => '八', 9 => '九' }.freeze
5
+ KANJI_UNITS = ['', '万', '億', '兆', '京', '垓'].freeze
6
+
7
+ public_constant :KANJI_MAP
8
+ public_constant :KANJI_UNITS
9
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './exceptions'
4
+ require_relative './kanji_map'
5
+
6
+ module NumberToKanji
7
+ module SmallNumberToKanji
8
+ RANGE_END = 10_000
9
+ public_constant :RANGE_END
10
+
11
+ def call(number)
12
+ raise(::TypeError) unless number.is_a?(::Integer)
13
+ raise(::NumberToKanji::Exceptions::NegativeNumberError) if number.negative?
14
+
15
+ raise(::RangeError, 'Numbers equal to or larger than 10^4 is not supported.') if number >= ::NumberToKanji::SmallNumberToKanji::RANGE_END
16
+
17
+ return ::NumberToKanji::KANJI_MAP[0] if number.zero?
18
+
19
+ zero_padded_number = format('%04<number>d', number: number)
20
+ thousands, hundreds, tens, ones = zero_padded_number.to_s.chars.map { |i| Integer(i, 10) }
21
+
22
+ "#{_thousands_to_kanji(thousands)}#{_hundreds_to_kanji(hundreds)}#{_tens_to_kanji(tens)}#{_ones_to_kanji(ones)}"
23
+ end
24
+
25
+ def _thousands_to_kanji(thousands)
26
+ return '' if thousands.zero?
27
+ return '千' if thousands == 1
28
+
29
+ "#{::NumberToKanji::KANJI_MAP[thousands]}千"
30
+ end
31
+
32
+ def _hundreds_to_kanji(hundreds)
33
+ return '' if hundreds.zero?
34
+ return '百' if hundreds == 1
35
+
36
+ "#{::NumberToKanji::KANJI_MAP[hundreds]}百"
37
+ end
38
+
39
+ def _tens_to_kanji(tens)
40
+ return '' if tens.zero?
41
+ return '十' if tens == 1
42
+
43
+ "#{::NumberToKanji::KANJI_MAP[tens]}十"
44
+ end
45
+
46
+ def _ones_to_kanji(ones)
47
+ return '' if ones.zero?
48
+
49
+ ::NumberToKanji::KANJI_MAP[ones]
50
+ end
51
+
52
+ module_function :call, :_thousands_to_kanji, :_hundreds_to_kanji, :_tens_to_kanji, :_ones_to_kanji
53
+ private_class_method :_thousands_to_kanji, :_hundreds_to_kanji, :_tens_to_kanji, :_ones_to_kanji
54
+ end
55
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NumberToKanji
4
+ VERSION = '1.0.0'
5
+ public_constant :VERSION
6
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'number_to_kanji/exceptions'
4
+ require_relative 'number_to_kanji/kanji_map'
5
+ require_relative 'number_to_kanji/small_number_to_kanji'
6
+ require_relative 'number_to_kanji/version'
7
+
8
+ module NumberToKanji
9
+ RANGE_END = 1_000_000_000_000_000_000_000_000
10
+ public_constant :RANGE_END
11
+
12
+ def call(number)
13
+ raise(::TypeError) unless number.is_a?(::Integer)
14
+ raise(::NumberToKanji::Exceptions::NegativeNumberError) if number.negative?
15
+
16
+ raise(::RangeError, 'Numbers equal to or larger than 10^24 is not supported.') if number >= ::NumberToKanji::RANGE_END
17
+
18
+ return ::NumberToKanji::KANJI_MAP[0] if number.zero?
19
+
20
+ # 四桁ごとに区切りつつ、位の小さい順に並んだ配列を作る。
21
+ # 例: 123456789 => [6789, 2345, 1]
22
+ # 例: 100006789 => [6789, 0, 1]
23
+ separated_numbers = number.to_s.chars.reverse.each_slice(4).map(&:reverse).map(&:join).map { |i| Integer(i, 10) }
24
+
25
+ kanji_with_unit_numbers =
26
+ separated_numbers.map.with_index do |separated_number, index|
27
+ _kanji_number_with_unit(separated_number, index)
28
+ end
29
+
30
+ kanji_with_unit_numbers.reverse.join
31
+ end
32
+
33
+ def _kanji_number_with_unit(number, index)
34
+ return if number.zero?
35
+
36
+ kanji = ::NumberToKanji::SmallNumberToKanji.call(number)
37
+ unit = ::NumberToKanji::KANJI_UNITS[index]
38
+
39
+ "#{kanji}#{unit}"
40
+ end
41
+
42
+ module_function :call, :_kanji_number_with_unit
43
+ private_class_method :_kanji_number_with_unit
44
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/number_to_kanji/version'
4
+
5
+ ::Gem::Specification.new do |spec|
6
+ spec.name = 'number_to_kanji'
7
+ spec.version = ::NumberToKanji::VERSION
8
+ spec.authors = ['Yamaguchi Takuya']
9
+ spec.email = ['yamat47.thirddown@gmail.com']
10
+
11
+ spec.summary = 'Ruby Number translator to Japanese Kanji.'
12
+ spec.description = 'NumberToKanji is a Ruby Gem that translates number (integer) to Japanese Kanji. It supports numbers between 0 to 10^23 ("垓").'
13
+ spec.homepage = 'https://github.com/yamat47/number_to_kanji'
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/yamat47/number_to_kanji'
19
+ spec.metadata['changelog_uri'] = 'https://github.com/yamat47/number_to_kanji/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 =
24
+ ::Dir.chdir(::File.expand_path(__dir__)) do
25
+ `git ls-files -z`.split("\x0").reject do |f|
26
+ (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
27
+ end
28
+ end
29
+ spec.bindir = 'exe'
30
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| ::File.basename(f) }
31
+ spec.require_paths = ['lib']
32
+
33
+ # Uncomment to register a new dependency of your gem
34
+ spec.add_development_dependency('rake')
35
+ spec.add_development_dependency('rspec')
36
+ spec.add_development_dependency('rubocop')
37
+ spec.add_development_dependency('rubocop-rake')
38
+ spec.add_development_dependency('rubocop-rspec')
39
+
40
+ # For more information and examples about making a new gem, check out our
41
+ # guide at: https://bundler.io/guides/creating_gem.html
42
+ spec.metadata['rubygems_mfa_required'] = 'true'
43
+ end
@@ -0,0 +1,4 @@
1
+ module NumberToKanji
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,138 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: number_to_kanji
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Yamaguchi Takuya
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-01-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-rake
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'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: NumberToKanji is a Ruby Gem that translates number (integer) to Japanese
84
+ Kanji. It supports numbers between 0 to 10^23 ("垓").
85
+ email:
86
+ - yamat47.thirddown@gmail.com
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - ".rspec"
92
+ - ".rubocop.yml"
93
+ - ".rubocop_todo.yml"
94
+ - CHANGELOG.md
95
+ - CODE_OF_CONDUCT.md
96
+ - Gemfile
97
+ - Gemfile.lock
98
+ - LICENSE.txt
99
+ - README.md
100
+ - Rakefile
101
+ - bin/console
102
+ - bin/setup
103
+ - lib/number_to_kanji.rb
104
+ - lib/number_to_kanji/exceptions.rb
105
+ - lib/number_to_kanji/exceptions/negative_number_error.rb
106
+ - lib/number_to_kanji/kanji_map.rb
107
+ - lib/number_to_kanji/small_number_to_kanji.rb
108
+ - lib/number_to_kanji/version.rb
109
+ - number_to_kanji.gemspec
110
+ - sig/number_to_kanji.rbs
111
+ homepage: https://github.com/yamat47/number_to_kanji
112
+ licenses:
113
+ - MIT
114
+ metadata:
115
+ homepage_uri: https://github.com/yamat47/number_to_kanji
116
+ source_code_uri: https://github.com/yamat47/number_to_kanji
117
+ changelog_uri: https://github.com/yamat47/number_to_kanji/blob/main/CHANGELOG.md
118
+ rubygems_mfa_required: 'true'
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: 2.6.0
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubygems_version: 3.3.3
135
+ signing_key:
136
+ specification_version: 4
137
+ summary: Ruby Number translator to Japanese Kanji.
138
+ test_files: []