yukichi 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 4dbf35fb3c5eace1c4c8e8610909d994b61fceab01ae842d3562ecf46542426b
4
- data.tar.gz: c9b6998b70eaa5907716e0716ccc756d53e405edda77b55ed5fff2ce088dfa16
3
+ metadata.gz: f900458d475783b0e660039129a3348c297d46fc2821991967d44d79133cea15
4
+ data.tar.gz: a0d114f68be85ebb86262ece95ead8d34de287bc309700a30b86a4be00b26aa8
5
5
  SHA512:
6
- metadata.gz: 9553f5b2c8d4161ee2e1c266974234e0c51f3f72ab7a365eec0d5d5d9e9501f0d0e1f790debe3a4e6fda2ea7334b576f4a2a8e2b1175e28dfda5e1d217c03f8b
7
- data.tar.gz: 16f32a8df58617b45493609dbeb2911254a868d21a577771c119d78df4140f23f68ab27a0937688d5682cf15584b4d826500cfd027e2f7dad595a3dbbf1234f4
6
+ metadata.gz: 22a0b2140de1b94e38f345f7301ca70b1642572e4c6730b7fe10f6e7526ea23238b955f45548a04d8543715dd79b6846e825450efb4b336ebbb8ea27a8215b45
7
+ data.tar.gz: f3d75a293aea565931c0a5b55d93e418c8c4ac3882d6116a545dfd8e604037ae145db62139b1274e34f7e40a1b63b0c8b93080128c689703ae517d53c8ee1145
data/.gitignore CHANGED
@@ -6,6 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
-
9
+ /Gemfile.lock
10
10
  # rspec failure tracking
11
11
  .rspec_status
@@ -2,9 +2,28 @@ module Yukichi
2
2
  class Separater
3
3
  def initialize(num)
4
4
  @num = num
5
- end
6
- def jpy_comma
7
- @num.to_s.gsub(/(\d)(?=(\d{3})+(?!\d))/, '\1,')
5
+ case num.class
6
+ when "String"
7
+ @num = num
8
+ when "Integer"
9
+ @num = num.to_arabic_numeral
10
+ end
11
+ end
12
+
13
+ def to_k(money_mark = false)
14
+ if money_mark # moneyマークがtrueなら"円"をつける
15
+ @num.to_chinese_numeral + "円"
16
+ else
17
+ @num.to_chinese_numeral
18
+ end
19
+ end
20
+
21
+ def jpy_comma(money_mark = false)
22
+ if money_mark == true
23
+ "¥" + @num.to_s.gsub(/(\d)(?=(\d{3})+(?!\d))/, '\1,')
24
+ else
25
+ @num.to_s.gsub(/(\d)(?=(\d{3})+(?!\d))/, '\1,')
26
+ end
8
27
  end
9
28
  end
10
29
  end
@@ -1,3 +1,3 @@
1
1
  module Yukichi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/yukichi.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{We divide numbers by commas every three digits.}
13
13
  spec.description = %q{Yukichi is a Gem of money. Now I can only separate them with commas every 3 digits, but I will add a function to add a yen mark.}
14
- spec.homepage = "https://github.com/tatarico."
14
+ spec.homepage = "https://github.com/tararico/yukichi"
15
15
  spec.license = "MIT"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
@@ -29,4 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "bundler", "~> 1.16"
30
30
  spec.add_development_dependency "rake", "~> 10.0"
31
31
  spec.add_development_dependency "rspec", "~> 3.0"
32
+ spec.add_dependency "convert_numeral"
32
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yukichi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - tararico
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2018-08-02 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: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: convert_numeral
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Yukichi is a Gem of money. Now I can only separate them with commas every
56
70
  3 digits, but I will add a function to add a yen mark.
57
71
  email:
@@ -63,24 +77,17 @@ files:
63
77
  - ".gitignore"
64
78
  - ".rspec"
65
79
  - ".travis.yml"
66
- - ".yukichi.gemspec.un~"
67
- - CODE_OF_CONDUCT.md
68
80
  - Gemfile
69
81
  - LICENSE.txt
70
82
  - README.md
71
83
  - Rakefile
72
84
  - bin/console
73
85
  - bin/setup
74
- - lib/.yukichi.rb.un~
75
86
  - lib/yukichi.rb
76
- - lib/yukichi.rb~
77
- - lib/yukichi/.separater.rb.un~
78
87
  - lib/yukichi/separater.rb
79
- - lib/yukichi/separater.rb~
80
88
  - lib/yukichi/version.rb
81
89
  - yukichi.gemspec
82
- - yukichi.gemspec~
83
- homepage: https://github.com/tatarico.
90
+ homepage: https://github.com/tararico/yukichi
84
91
  licenses:
85
92
  - MIT
86
93
  metadata: {}
data/.yukichi.gemspec.un~ DELETED
Binary file
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at emipu.uq@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/lib/.yukichi.rb.un~ DELETED
Binary file
data/lib/yukichi.rb~ DELETED
@@ -1,10 +0,0 @@
1
- require "yukichi/version"
2
- require "yukichi/separater"
3
-
4
- module Yukichi
5
- class Separater
6
- def jpy_comma
7
- self.to_s.gsub(/(\d)(?=(\d{3})+(?!\d))/, '\1,')
8
- end
9
- end
10
- end
Binary file
@@ -1,7 +0,0 @@
1
- module Yukichi
2
- class Separater
3
- def jpy_comma
4
- self.to_s.gsub(/(\d)(?=(\d{3})+(?!\d))/, '\1,')
5
- end
6
- end
7
- end
data/yukichi.gemspec~ DELETED
@@ -1,38 +0,0 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "yukichi/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "yukichi"
8
- spec.version = Yukichi::VERSION
9
- spec.authors = ["tararico"]
10
- spec.email = ["emipu.uq@gmail.com"]
11
-
12
- spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.}
13
- spec.description = %q{TODO: Write a longer description or delete this line.}
14
- spec.homepage = "TODO: Put your gem's website or public repo URL here."
15
- spec.license = "MIT"
16
-
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- if spec.respond_to?(:metadata)
20
- spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
21
- else
22
- raise "RubyGems 2.0 or newer is required to protect against " \
23
- "public gem pushes."
24
- end
25
-
26
- # Specify which files should be added to the gem when it is released.
27
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
29
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30
- end
31
- spec.bindir = "exe"
32
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
- spec.require_paths = ["lib"]
34
-
35
- spec.add_development_dependency "bundler", "~> 1.16"
36
- spec.add_development_dependency "rake", "~> 10.0"
37
- spec.add_development_dependency "rspec", "~> 3.0"
38
- end