era_ja 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/Guardfile +1 -0
- data/README.ja.md +2 -2
- data/README.md +2 -2
- data/era_ja.gemspec +1 -0
- data/lib/era_ja/conversion.rb +2 -5
- data/lib/era_ja/version.rb +1 -1
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0cd9f5424cd1252076c713acee568acc088b793
|
4
|
+
data.tar.gz: 504477b56ccb23b8f4701905a65c109fb66220fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0237e8246990ae7463dc13995e8532280bcfb74a27fc91e9ec6e29ce58409962b9abd2dafdb7781c9eedef06d84ed8d38231190f338bff770bc262c65d37e306
|
7
|
+
data.tar.gz: e8c1ca1ab4fc487152966802bd8526ba4d7976ad91ff1b641b9df248c2e890016fb6184ad7fa622f5f904bbe5d639f60f048d441b9ab94b8f48049db974e0ad0
|
data/.travis.yml
ADDED
data/Guardfile
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
guard 'rspec', :cmd => 'bundle exec rspec --color --format progress', :all_after_pass => false do
|
6
6
|
watch(%r{^spec/.+_spec\.rb$})
|
7
7
|
watch(%r{^lib/era_ja/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
8
|
+
watch('lib/era_ja/conversion.rb') { 'spec' }
|
8
9
|
watch('lib/era_ja.rb') { "spec" }
|
9
10
|
watch('spec/spec_helper.rb') { "spec" }
|
10
11
|
end
|
data/README.ja.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# EraJa
|
1
|
+
# EraJa [![Build Status](https://travis-ci.org/tomiacannondale/era_ja.svg)](https://travis-ci.org/tomiacannondale/era_ja)
|
2
2
|
|
3
3
|
日本の和暦に変換します。
|
4
4
|
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
### ruby version ###
|
20
20
|
|
21
|
-
|
21
|
+
[.travis.yml](https://github.com/tomiacannondale/era_ja/blob/master/.travis.yml ) を確認してください。
|
22
22
|
|
23
23
|
**NOTE** :: era_ja0.4.0からruby1.9.3をサポートしていません。
|
24
24
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# EraJa
|
1
|
+
# EraJa [![Build Status](https://travis-ci.org/tomiacannondale/era_ja.svg)](https://travis-ci.org/tomiacannondale/era_ja)
|
2
2
|
|
3
3
|
Convert to Japanese era.
|
4
4
|
|
@@ -18,7 +18,7 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
### ruby version ###
|
20
20
|
|
21
|
-
|
21
|
+
See [.travis.yml](https://github.com/tomiacannondale/era_ja/blob/master/.travis.yml )
|
22
22
|
|
23
23
|
**NOTE** :: era_ja does not support ruby 1.9.3 since 0.4.0
|
24
24
|
|
data/era_ja.gemspec
CHANGED
@@ -21,4 +21,5 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.add_development_dependency "guard-rspec", '~> 4.5.0'
|
22
22
|
gem.add_development_dependency 'rb-fsevent', '~> 0.9.4'
|
23
23
|
gem.add_development_dependency 'terminal-notifier-guard', '~> 1.6.4'
|
24
|
+
gem.add_development_dependency 'yard', '~> 0.8.7'
|
24
25
|
end
|
data/lib/era_ja/conversion.rb
CHANGED
@@ -25,10 +25,7 @@ module EraJa
|
|
25
25
|
# this argument is same as one element of ERA_NAME_DEFAULTS.
|
26
26
|
# @return [String]
|
27
27
|
def to_era(format = "%o%E.%m.%d", era_names: ERA_NAME_DEFAULTS)
|
28
|
-
@era_format = format.
|
29
|
-
@era_format.gsub!(/%J/, "%J%")
|
30
|
-
@era_format.sub!(/%o/i) { |m| m + ' ' }
|
31
|
-
@era_format.sub!(/%E/) { |m| m + ' ' }
|
28
|
+
@era_format = format.gsub(/%J/, "%J%")
|
32
29
|
str_time = strftime(@era_format)
|
33
30
|
if @era_format =~ /%E/
|
34
31
|
if self.to_time < ::Time.mktime(1868,9,8)
|
@@ -48,7 +45,7 @@ module EraJa
|
|
48
45
|
|
49
46
|
private
|
50
47
|
def era_year(year, era, era_names)
|
51
|
-
strftime(@era_format).sub(/(%J)?%E
|
48
|
+
strftime(@era_format).sub(/(%J)?%E/) { format_year(year, $1) }.sub(/%o/i) { format_era(era, era_names) }
|
52
49
|
end
|
53
50
|
|
54
51
|
def format_era(era, era_names)
|
data/lib/era_ja/version.rb
CHANGED
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: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tomi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.6.4
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: yard
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.8.7
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.8.7
|
83
97
|
description: Convert to Japanese era.
|
84
98
|
email:
|
85
99
|
- tomiacannondale@gmail.com
|
@@ -89,6 +103,7 @@ extra_rdoc_files: []
|
|
89
103
|
files:
|
90
104
|
- ".document"
|
91
105
|
- ".gitignore"
|
106
|
+
- ".travis.yml"
|
92
107
|
- ".yardopts"
|
93
108
|
- Gemfile
|
94
109
|
- Guardfile
|
@@ -133,3 +148,4 @@ test_files:
|
|
133
148
|
- spec/date_spec.rb
|
134
149
|
- spec/spec_helper.rb
|
135
150
|
- spec/time_spec.rb
|
151
|
+
has_rdoc:
|