era_ja 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.ja.md +1 -1
- data/lib/era_ja/conversion.rb +1 -1
- data/lib/era_ja/version.rb +1 -1
- data/spec/spec_helper.rb +4 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcf0a0de20e3f4e090835b70d95bd314e00969368a7d11930d4f138b10a5a479
|
4
|
+
data.tar.gz: 3faa10bd05537ebe7ac6bd279e32576701b8369ad1ac72c8198f9073fe0a1aa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbbb0bf965c38428ba6c63057ab1c49b1dad5912c46480440386e6c5ce01e39185fa4e65b9de8ac990928d818308fb6183b42b1327192ae52b37da7f578a99bf
|
7
|
+
data.tar.gz: d2a6df2467587f964a74d869de4e59cae8da84ca062b3dda6f61074be7420d212c97d4111d697046f7b92a551b2059b90b9a4e29975520e0b37bb5c074b47ec6
|
data/README.ja.md
CHANGED
data/lib/era_ja/conversion.rb
CHANGED
@@ -30,7 +30,7 @@ module EraJa
|
|
30
30
|
|
31
31
|
@era_format = format.gsub(/%J/, "%J%")
|
32
32
|
str_time = strftime(@era_format)
|
33
|
-
if @era_format =~ /%([
|
33
|
+
if @era_format =~ /%(-?E|[Oo]|1O)/
|
34
34
|
case
|
35
35
|
when self.to_time < ::Time.mktime(1912,7,30)
|
36
36
|
str_time = era_year(year - 1867, :meiji, era_names)
|
data/lib/era_ja/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -26,6 +26,10 @@ RSpec.shared_examples "should equal '令和01年07月02日'" do
|
|
26
26
|
context "with '%O%J%-E年%m月%d日'" do
|
27
27
|
it { expect(subject.to_era("%O%J%-E年%m月%d日")).to eq "令和元年07月02日" }
|
28
28
|
end
|
29
|
+
|
30
|
+
context "with '%-E年%-m月%-d日'" do
|
31
|
+
it { expect(subject.to_era("%-E年%-m月%-d日")).to eq "1年7月2日" }
|
32
|
+
end
|
29
33
|
end
|
30
34
|
|
31
35
|
RSpec.shared_examples "should equal 'R01.05.01'" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: era_ja
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tomi
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -125,7 +125,7 @@ homepage: https://github.com/tomiacannondale/era_ja
|
|
125
125
|
licenses:
|
126
126
|
- MIT
|
127
127
|
metadata: {}
|
128
|
-
post_install_message:
|
128
|
+
post_install_message:
|
129
129
|
rdoc_options: []
|
130
130
|
require_paths:
|
131
131
|
- lib
|
@@ -140,8 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.1.
|
144
|
-
signing_key:
|
143
|
+
rubygems_version: 3.1.4
|
144
|
+
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Convert Date or Time instance to String of Japanese era.
|
147
147
|
test_files:
|