japanese_calendar 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +25 -0
- data/.rubocop.yml +1156 -0
- data/.travis.yml +9 -1
- data/README.md +20 -7
- data/japanese_calendar.gemspec +3 -11
- data/lib/japanese_calendar/era.rb +1 -1
- data/lib/japanese_calendar/version.rb +1 -1
- metadata +33 -3
data/.travis.yml
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
rvm:
|
4
|
-
|
4
|
+
- 2.3.3
|
5
5
|
before_install: gem install bundler -v 1.13.6
|
6
|
+
addons:
|
7
|
+
code_climate:
|
8
|
+
repo_token: c542293583b86ca95015675c334c9fea63c14825709f7c9eb4c72a0c8cfc71b4
|
9
|
+
after_success:
|
10
|
+
- bundle exec codeclimate-test-reporter
|
11
|
+
notifications:
|
12
|
+
slack:
|
13
|
+
secure: K+I4otkeX0yMPQing/KbcB5A/FKWo4aNFeRl7PuQ9hB1K7f2rRr0s2uvkfFsXYYFJrxWNhNnPoiiJNAmOBzmFljcIAGm5k5qPfmjFeVTFsv1lEZjfAa2UbCKgCGi79P48BvZ4zXO1I/uZsNUBkVPAfxZSq+aG3tudPXmXOEeTjMMNE6czYr49qrLsQPh7ezx2431Zm+qMqzSoqW7aOzZjgZvuc8IllrrBWO2cstD/8LkLrYVrY+MJbxM8kT6ZXbCXDisu/jSN/ChIVCFfEmYjavdkCrIyMN3gqFzwBnjFtco9YlPRqyA4DOWFzXmIzOSh77rEskF+noaPS2dUMt6g/32GQbwRR+x/YvJkqizyOwLky2H7aVw2pCgZnIGIshXxZPIUwxriML/O0MpkKRDnFcc8kzeL1IOqQauxRxq9woSZ68pFyVP4dc5JT1cuMGJK0/vWCUKnPSyV9wjUNJQXHV907Fxh+aW398JpPUEeAsjMO8erwWd0w8q4qYDEamoc7+pjz+HEJJjlVYseDR3CN3bpR3vcizpIPHTUlTTRMNY+KTbPRMam+9ZLJzv+SFVZ58hjJQK8aIW0tc51bhP2cuzNfmX2YcYEJ6DQvCWdnj7V6gKOHCB/BebfIUmdvRGyew2mrZSUfXPTAAlnwiRhf5IDzIulR0GusgQiqa5tmU=
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# Japanese Calendar [![Gem Version](https://badge.fury.io/rb/japanese_calendar.svg)](https://badge.fury.io/rb/japanese_calendar) [![Build Status](https://travis-ci.org/RyoYamamotoJP/japanese_calendar.svg?branch=master)](https://travis-ci.org/RyoYamamotoJP/japanese_calendar) [![Code Climate](https://codeclimate.com/github/RyoYamamotoJP/japanese_calendar/badges/gpa.svg)](https://codeclimate.com/github/RyoYamamotoJP/japanese_calendar) [![Test Coverage](https://codeclimate.com/github/RyoYamamotoJP/japanese_calendar/badges/coverage.svg)](https://codeclimate.com/github/RyoYamamotoJP/japanese_calendar/coverage)
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Japanese calendar utility for Ruby.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,23 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
To get the Japanese era name, use the `era_name` method:
|
24
|
+
|
25
|
+
```
|
26
|
+
Time.new(1989, 1, 8).era_name # => "平成"
|
27
|
+
Time.new(1926, 12, 25).era_name # => "昭和"
|
28
|
+
Time.new(1912, 7, 30).era_name # => "大正"
|
29
|
+
Time.new(1868, 1, 25).era_name # => "明治"
|
30
|
+
```
|
31
|
+
|
32
|
+
You can convert to a Japanese year with the `era_year` method:
|
33
|
+
|
34
|
+
```
|
35
|
+
Time.new(2016, 12, 11).era_year # => 28
|
36
|
+
Time.new(1989, 1, 7).era_year # => 64
|
37
|
+
Time.new(1926, 12, 24).era_year # => 15
|
38
|
+
Time.new(1912, 7, 29).era_year # => 45
|
39
|
+
```
|
26
40
|
|
27
41
|
## Development
|
28
42
|
|
@@ -32,10 +46,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
46
|
|
33
47
|
## Contributing
|
34
48
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
49
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/RyoYamamotoJP/japanese_calendar. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
50
|
|
37
51
|
|
38
52
|
## License
|
39
53
|
|
40
54
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
data/japanese_calendar.gemspec
CHANGED
@@ -9,20 +9,10 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Ryo Yamamoto"]
|
10
10
|
spec.email = ["email@ryoyamamoto.jp"]
|
11
11
|
|
12
|
-
spec.summary = "Japanese
|
13
|
-
# spec.description = %q{TODO: Write a longer description or delete this line.}
|
12
|
+
spec.summary = "Japanese calendar utility for Ruby"
|
14
13
|
spec.homepage = "https://github.com/RyoYamamotoJP/japanese_calendar"
|
15
14
|
spec.license = "MIT"
|
16
15
|
|
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
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
17
|
f.match(%r{^(test|spec|features)/})
|
28
18
|
end
|
@@ -33,4 +23,6 @@ Gem::Specification.new do |spec|
|
|
33
23
|
spec.add_development_dependency "bundler", "~> 1.13"
|
34
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
35
25
|
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
+
spec.add_development_dependency "simplecov"
|
27
|
+
spec.add_development_dependency "codeclimate-test-reporter", "~> 1.0.0"
|
36
28
|
end
|
@@ -25,7 +25,7 @@ module JapaneseCalendar
|
|
25
25
|
#
|
26
26
|
# Time.new(2016, 12, 11).era_year # => 28
|
27
27
|
# Time.new(1989, 1, 7).era_year # => 64
|
28
|
-
# Time.new(1926, 12, 24).era_year # =>
|
28
|
+
# Time.new(1926, 12, 24).era_year # => 15
|
29
29
|
# Time.new(1912, 7, 29).era_year # => 45
|
30
30
|
#
|
31
31
|
# Raises an error when the Japanese year cannot be found.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: japanese_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Yamamoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
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: codeclimate-test-reporter
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.0.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.0.0
|
55
83
|
description:
|
56
84
|
email:
|
57
85
|
- email@ryoyamamoto.jp
|
@@ -60,8 +88,10 @@ executables:
|
|
60
88
|
extensions: []
|
61
89
|
extra_rdoc_files: []
|
62
90
|
files:
|
91
|
+
- ".codeclimate.yml"
|
63
92
|
- ".gitignore"
|
64
93
|
- ".rspec"
|
94
|
+
- ".rubocop.yml"
|
65
95
|
- ".travis.yml"
|
66
96
|
- CODE_OF_CONDUCT.md
|
67
97
|
- Gemfile
|
@@ -99,5 +129,5 @@ rubyforge_project:
|
|
99
129
|
rubygems_version: 2.5.2
|
100
130
|
signing_key:
|
101
131
|
specification_version: 4
|
102
|
-
summary: Japanese
|
132
|
+
summary: Japanese calendar utility for Ruby
|
103
133
|
test_files: []
|