warekky 0.1.0
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.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +26 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/lib/warekky/core_ext.rb +49 -0
- data/lib/warekky/era.rb +44 -0
- data/lib/warekky/era_group.rb +138 -0
- data/lib/warekky/ja.rb +36 -0
- data/lib/warekky.rb +49 -0
- data/spec/core_ext/with_date_spec.rb +152 -0
- data/spec/core_ext/with_date_time_spec.rb +156 -0
- data/spec/core_ext/with_time_spec.rb +156 -0
- data/spec/ja/with_date_spec.rb +142 -0
- data/spec/ja/with_date_time_spec.rb +133 -0
- data/spec/ja/with_time_spec.rb +133 -0
- data/spec/rcov.opts +1 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/warekky/era_group_spec.rb +121 -0
- data/spec/warekky/era_spec.rb +100 -0
- data/spec/warekky_spec.rb +32 -0
- data/warekky.gemspec +76 -0
- metadata +115 -0
@@ -0,0 +1,133 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require File.expand_path('../spec_helper', File.dirname(__FILE__))
|
3
|
+
|
4
|
+
describe "Warekky" do
|
5
|
+
|
6
|
+
before :all do
|
7
|
+
Warekky.era_group_class = Warekky::Ja
|
8
|
+
end
|
9
|
+
|
10
|
+
describe :strftime do
|
11
|
+
it "without era name (元号の指定なし)" do
|
12
|
+
Warekky.strftime(Time.local(1867,12,31), '%Y.%m.%d').should == "1867.12.31"
|
13
|
+
Warekky.strftime(Time.local(1868, 1, 1), '%Y.%m.%d').should == "1868.01.01"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "with alphabet era name (アルファベット表記の元号)" do
|
17
|
+
fmt = '%g%n/%m/%d'
|
18
|
+
Warekky.strftime(Time.local(1867,12,31), fmt).should == "1867/12/31"
|
19
|
+
Warekky.strftime(Time.local(1868, 1, 1), fmt).should == "M01/01/01"
|
20
|
+
Warekky.strftime(Time.local(1912, 7,29), fmt).should == "M45/07/29"
|
21
|
+
Warekky.strftime(Time.local(1912, 7,30), fmt).should == "T01/07/30"
|
22
|
+
Warekky.strftime(Time.local(1926,12,24), fmt).should == "T15/12/24"
|
23
|
+
Warekky.strftime(Time.local(1926,12,25), fmt).should == "S01/12/25"
|
24
|
+
Warekky.strftime(Time.local(1989, 1, 7), fmt).should == "S64/01/07"
|
25
|
+
Warekky.strftime(Time.local(1989, 1, 8), fmt).should == "H01/01/08"
|
26
|
+
Warekky.strftime(Time.local(2010, 6, 9), fmt).should == "H22/06/09"
|
27
|
+
Warekky.strftime(Time.local(2050,12,31), fmt).should == "H62/12/31"
|
28
|
+
end
|
29
|
+
|
30
|
+
it "with chinese charactor era name (漢字表記の元号)" do
|
31
|
+
fmt = '%G%n/%m/%d'
|
32
|
+
Warekky.strftime(Time.local(1867,12,31), fmt).should == "1867/12/31"
|
33
|
+
Warekky.strftime(Time.local(1868, 1, 1), fmt).should == "明治01/01/01"
|
34
|
+
Warekky.strftime(Time.local(1912, 7,29), fmt).should == "明治45/07/29"
|
35
|
+
Warekky.strftime(Time.local(1912, 7,30), fmt).should == "大正01/07/30"
|
36
|
+
Warekky.strftime(Time.local(1926,12,24), fmt).should == "大正15/12/24"
|
37
|
+
Warekky.strftime(Time.local(1926,12,25), fmt).should == "昭和01/12/25"
|
38
|
+
Warekky.strftime(Time.local(1989, 1, 7), fmt).should == "昭和64/01/07"
|
39
|
+
Warekky.strftime(Time.local(1989, 1, 8), fmt).should == "平成01/01/08"
|
40
|
+
Warekky.strftime(Time.local(2010, 6, 9), fmt).should == "平成22/06/09"
|
41
|
+
Warekky.strftime(Time.local(2050,12,31), fmt).should == "平成62/12/31"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe :parse do
|
46
|
+
it "without era name (元号の指定なし)" do
|
47
|
+
Warekky.parse("1867/12/31", :class => Time).should == Time.local(1867,12,31)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "with alphabet era name (アルファベット表記の元号)" do
|
51
|
+
Warekky.parse("M01/01/01", :class => Time).should == Time.local(1868, 1, 1)
|
52
|
+
Warekky.parse("M45/07/29", :class => Time).should == Time.local(1912, 7,29)
|
53
|
+
Warekky.parse("T01/07/30", :class => Time).should == Time.local(1912, 7,30)
|
54
|
+
Warekky.parse("T15/12/24", :class => Time).should == Time.local(1926,12,24)
|
55
|
+
Warekky.parse("S01/12/25", :class => Time).should == Time.local(1926,12,25)
|
56
|
+
Warekky.parse("S64/01/07", :class => Time).should == Time.local(1989, 1, 7)
|
57
|
+
Warekky.parse("H01/01/08", :class => Time).should == Time.local(1989, 1, 8)
|
58
|
+
Warekky.parse("H22/06/09", :class => Time).should == Time.local(2010, 6, 9)
|
59
|
+
Warekky.parse("H62/12/31", :class => Time).should == Time.local(2050,12,31)
|
60
|
+
Warekky.parse("H22/06/09 01:23:45", :class => Time).should == Time.local(2010, 6, 9, 1, 23, 45)
|
61
|
+
end
|
62
|
+
|
63
|
+
context "区切りなし" do
|
64
|
+
it "by Time.parse" do
|
65
|
+
Time.parse("18671231").should == Time.local(1867, 12, 31)
|
66
|
+
Time.parse("18671231 012345") == Time.local(1867, 12, 31, 1, 23, 45)
|
67
|
+
Time.parse("18671231012345") == Time.local(1867, 12, 31, 1, 23, 45)
|
68
|
+
end
|
69
|
+
|
70
|
+
it "by Warekky.parse" do
|
71
|
+
Warekky.parse("M010101", :class => Time).should == Time.local(1868, 1, 1)
|
72
|
+
Warekky.parse("M450729", :class => Time).should == Time.local(1912, 7,29)
|
73
|
+
Warekky.parse("T010730", :class => Time).should == Time.local(1912, 7,30)
|
74
|
+
Warekky.parse("T151224", :class => Time).should == Time.local(1926,12,24)
|
75
|
+
Warekky.parse("S011225", :class => Time).should == Time.local(1926,12,25)
|
76
|
+
Warekky.parse("S640107", :class => Time).should == Time.local(1989, 1, 7)
|
77
|
+
Warekky.parse("H010108", :class => Time).should == Time.local(1989, 1, 8)
|
78
|
+
Warekky.parse("H220609", :class => Time).should == Time.local(2010, 6, 9)
|
79
|
+
Warekky.parse("H621231", :class => Time).should == Time.local(2050,12,31)
|
80
|
+
Warekky.parse("H220609 012345", :class => Time).should == Time.local(2010, 6, 9, 1, 23, 45)
|
81
|
+
Warekky.parse("H220609012345", :class => Time).should == Time.local(2010, 6, 9, 1, 23, 45)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
it "with chinese charactor era name (漢字表記の元号)" do
|
86
|
+
Warekky.parse("明治元年1月1日", :class => Time).should == Time.local(1868, 1, 1)
|
87
|
+
Warekky.parse("明治1年1月1日", :class => Time).should == Time.local(1868, 1, 1)
|
88
|
+
Warekky.parse("明治01年01月01日", :class => Time).should == Time.local(1868, 1, 1)
|
89
|
+
Warekky.parse("明治45年07月29日", :class => Time).should == Time.local(1912, 7,29)
|
90
|
+
Warekky.parse("大正01年07月30日", :class => Time).should == Time.local(1912, 7,30)
|
91
|
+
Warekky.parse("大正15年12月24日", :class => Time).should == Time.local(1926,12,24)
|
92
|
+
Warekky.parse("昭和01年12月25日", :class => Time).should == Time.local(1926,12,25)
|
93
|
+
Warekky.parse("昭和64年01月07日", :class => Time).should == Time.local(1989, 1, 7)
|
94
|
+
Warekky.parse("平成01年01月08日", :class => Time).should == Time.local(1989, 1, 8)
|
95
|
+
Warekky.parse("平成22年06月09日", :class => Time).should == Time.local(2010, 6, 9)
|
96
|
+
Warekky.parse("平成62年12月31日", :class => Time).should == Time.local(2050,12,31)
|
97
|
+
Warekky.parse("平成22年06月09日 12時34分56秒", :class => Time).should == Time.local(2010, 6, 9, 12, 34, 56)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "with chinese charactor short era name (漢字省略表記の元号)" do
|
101
|
+
Warekky.parse("明元年1月1日", :class => Time).should == Time.local(1868, 1, 1)
|
102
|
+
Warekky.parse("明1年1月1日", :class => Time).should == Time.local(1868, 1, 1)
|
103
|
+
Warekky.parse("明01年01月01日", :class => Time).should == Time.local(1868, 1, 1)
|
104
|
+
Warekky.parse("明45年07月29日", :class => Time).should == Time.local(1912, 7,29)
|
105
|
+
Warekky.parse("大01年07月30日", :class => Time).should == Time.local(1912, 7,30)
|
106
|
+
Warekky.parse("大15年12月24日", :class => Time).should == Time.local(1926,12,24)
|
107
|
+
Warekky.parse("昭01年12月25日", :class => Time).should == Time.local(1926,12,25)
|
108
|
+
Warekky.parse("昭64年01月07日", :class => Time).should == Time.local(1989, 1, 7)
|
109
|
+
Warekky.parse("平01年01月08日", :class => Time).should == Time.local(1989, 1, 8)
|
110
|
+
Warekky.parse("平22年06月09日", :class => Time).should == Time.local(2010, 6, 9)
|
111
|
+
Warekky.parse("平62年12月31日", :class => Time).should == Time.local(2050,12,31)
|
112
|
+
end
|
113
|
+
|
114
|
+
|
115
|
+
end
|
116
|
+
|
117
|
+
describe :[] do
|
118
|
+
describe "should return an Era object" do
|
119
|
+
it "for date" do
|
120
|
+
Warekky[Time.local(1867,12,31)].should == nil
|
121
|
+
Warekky[Time.local(1868, 1, 1)].name.should == 'meiji'
|
122
|
+
Warekky[Time.local(1912, 7,29)].name.should == 'meiji'
|
123
|
+
Warekky[Time.local(1912, 7,30)].name.should == 'taisho'
|
124
|
+
Warekky[Time.local(1926,12,24)].name.should == 'taisho'
|
125
|
+
Warekky[Time.local(1926,12,25)].name.should == 'showa'
|
126
|
+
Warekky[Time.local(1989, 1, 7)].name.should == 'showa'
|
127
|
+
Warekky[Time.local(1989, 1, 8)].name.should == 'heisei'
|
128
|
+
Warekky[Time.local(2010, 6, 9)].name.should == 'heisei'
|
129
|
+
Warekky[Time.local(2050,12,31)].name.should == 'heisei'
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
data/spec/rcov.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--exclude "spec/*,gems/*"
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require File.expand_path('../spec_helper', File.dirname(__FILE__))
|
3
|
+
|
4
|
+
class ChineseTest < Warekky::EraGroup
|
5
|
+
# see http://ja.wikipedia.org/wiki/元号一覧_(中国)
|
6
|
+
# pronounciation found on
|
7
|
+
# http://www.mdbg.net/chindict/chindict.php?dss=1&wdrst=1&wdqchi=宣統
|
8
|
+
|
9
|
+
parse_regexp do |era|
|
10
|
+
[ /(?:#{Regexp.escape(era.name)})(?:\d{1,2})/,
|
11
|
+
/(?:#{Regexp.escape(era.sign)})(?:\d{1,2})/]
|
12
|
+
end
|
13
|
+
|
14
|
+
format('%G'){|era, era_year| era.sign if era}
|
15
|
+
format('%n'){|era, era_year| era_year}
|
16
|
+
|
17
|
+
era('1862/01/01', '1974/12/31', :tongzhi , '同治')
|
18
|
+
era('1875/01/01', '1908/12/31', :guangxu , '光緒')
|
19
|
+
era('1909/01/01', '1912/02/12', :xuantong, '宣統')
|
20
|
+
end
|
21
|
+
|
22
|
+
class VietnameseTest < Warekky::EraGroup
|
23
|
+
era('1889/01/01', '1906/12/31', :thanh_thai, '成泰')
|
24
|
+
era('1907/01/01', '1915/12/31', :duy_tan , '維新')
|
25
|
+
era('1916/01/01', '1925/12/31', :khai_djnh , '啓定')
|
26
|
+
era('1926/01/01', '1945/12/31', :bao_dai , '保大')
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
describe Warekky::EraGroup do
|
31
|
+
|
32
|
+
before :all do
|
33
|
+
Warekky.era_group_class = nil
|
34
|
+
end
|
35
|
+
|
36
|
+
describe :era do
|
37
|
+
it "ChineseTest has 3 eras" do
|
38
|
+
ChineseTest.eras.length.should == 3
|
39
|
+
end
|
40
|
+
|
41
|
+
it "VietnameseTest has 4 eras" do
|
42
|
+
VietnameseTest.eras.length.should == 4
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe :[] do
|
47
|
+
before do
|
48
|
+
@era_group = VietnameseTest.new
|
49
|
+
end
|
50
|
+
|
51
|
+
describe "should return an Era object" do
|
52
|
+
it "for era_name" do
|
53
|
+
[:thanh_thai, :duy_tan, :khai_djnh, :bao_dai].each do |era|
|
54
|
+
@era_group[era].class.should == Warekky::Era
|
55
|
+
@era_group[era.to_s].class.should == Warekky::Era
|
56
|
+
end
|
57
|
+
@era_group[nil].should == nil
|
58
|
+
@era_group[''].should == nil
|
59
|
+
@era_group[:unexist_era].should == nil
|
60
|
+
end
|
61
|
+
|
62
|
+
it "for era_name with kanji" do
|
63
|
+
%w[成泰 維新 啓定 保大].each do |era|
|
64
|
+
@era_group[era].class.should == Warekky::Era
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
it "for date" do
|
69
|
+
@era_group[Date.new(1888,12,31)].should == nil
|
70
|
+
@era_group[Date.new(1889, 1, 1)].name.should == 'thanh_thai'
|
71
|
+
@era_group[Date.new(1906,12,31)].name.should == 'thanh_thai'
|
72
|
+
@era_group[Date.new(1907, 1, 1)].name.should == 'duy_tan'
|
73
|
+
@era_group[Date.new(1915,12,31)].name.should == 'duy_tan'
|
74
|
+
@era_group[Date.new(1916, 1, 1)].name.should == 'khai_djnh'
|
75
|
+
@era_group[Date.new(1925,12,31)].name.should == 'khai_djnh'
|
76
|
+
@era_group[Date.new(1926, 1, 1)].name.should == 'bao_dai'
|
77
|
+
@era_group[Date.new(1945,12,31)].name.should == 'bao_dai'
|
78
|
+
@era_group[Date.new(1946, 1, 1)].should == nil
|
79
|
+
@era_group[Date.new(2010, 6,10)].should == nil
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should raise for number" do
|
83
|
+
lambda{
|
84
|
+
@era_group[1]
|
85
|
+
}.should raise_error(ArgumentError)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe :era_replacements do
|
91
|
+
it "should match for names" do
|
92
|
+
regexp1 = ChineseTest.era_replacements
|
93
|
+
regexp1.match("同治").should be_false
|
94
|
+
regexp1.match("光緒").should be_false
|
95
|
+
regexp1.match("宣統").should be_false
|
96
|
+
regexp1.match("1").should be_false
|
97
|
+
regexp1.match("10").should be_false
|
98
|
+
regexp1.match("同治1").should be_true
|
99
|
+
regexp1.match("同治13").should be_true
|
100
|
+
regexp1.match("光緒1").should be_true
|
101
|
+
regexp1.match("光緒34").should be_true
|
102
|
+
regexp1.match("宣統1").should be_true
|
103
|
+
regexp1.match("宣統3").should be_true
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
describe :formats_regexp do
|
108
|
+
it "should match for format" do
|
109
|
+
regexp1 = ChineseTest.formats_regexp
|
110
|
+
regexp1.match("%g").should be_false
|
111
|
+
regexp1.match("%G").should be_true
|
112
|
+
regexp1.match("%N").should be_false
|
113
|
+
regexp1.match("%n").should be_true
|
114
|
+
regexp1.match("%y").should be_false
|
115
|
+
regexp1.match("%Y").should be_false
|
116
|
+
|
117
|
+
regexp1.match("%g%n/%m/%d").should be_true
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require File.expand_path('../spec_helper', File.dirname(__FILE__))
|
3
|
+
|
4
|
+
describe Warekky::Era do
|
5
|
+
|
6
|
+
before :all do
|
7
|
+
Warekky.era_group_class = nil
|
8
|
+
end
|
9
|
+
|
10
|
+
describe :[] do
|
11
|
+
it "access to options" do
|
12
|
+
era = Warekky::Era.new(:meiji , 'M',
|
13
|
+
'1868/01/01', '1912/07/29', :long => '明治', :short => "明")
|
14
|
+
era[:long].should == "明治"
|
15
|
+
era[:short].should == "明"
|
16
|
+
era['long'].should == nil
|
17
|
+
era['short'].should == nil
|
18
|
+
era[:unexist].should == nil
|
19
|
+
era[''].should == nil
|
20
|
+
era[nil].should == nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe :match? do
|
25
|
+
it "both first and last" do
|
26
|
+
era = Warekky::Era.new(:both, "B", "1993/04/01", "1998/03/31")
|
27
|
+
{
|
28
|
+
"1993/03/31" => false,
|
29
|
+
"1993/04/01" => true,
|
30
|
+
"1998/03/31" => true,
|
31
|
+
"1998/04/01" => false,
|
32
|
+
}.each do |str, expected|
|
33
|
+
era.match?(Date.parse(str)).should == expected
|
34
|
+
era.match?(str).should == expected
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
it "only first" do
|
39
|
+
era = Warekky::Era.new(:fitst, "F", "1993/04/01", nil)
|
40
|
+
{
|
41
|
+
"1993/03/31" => false,
|
42
|
+
"1993/04/01" => true,
|
43
|
+
"1998/03/31" => true,
|
44
|
+
"1998/04/01" => true,
|
45
|
+
}.each do |str, expected|
|
46
|
+
era.match?(Date.parse(str)).should == expected
|
47
|
+
era.match?(str).should == expected
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
it "only last" do
|
52
|
+
era = Warekky::Era.new(:last, "L", nil, "1998/03/31")
|
53
|
+
{
|
54
|
+
"1993/03/31" => true,
|
55
|
+
"1993/04/01" => true,
|
56
|
+
"1998/03/31" => true,
|
57
|
+
"1998/04/01" => false,
|
58
|
+
}.each do |str, expected|
|
59
|
+
era.match?(Date.parse(str)).should == expected
|
60
|
+
era.match?(str).should == expected
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe :to_ad_year do
|
66
|
+
it "should return ad year" do
|
67
|
+
era = Warekky::Era.new(:meiji , 'M', '1868/01/01', '1912/07/29')
|
68
|
+
era.to_ad_year(1).should == 1868
|
69
|
+
era.to_ad_year("1").should == 1868
|
70
|
+
era.to_ad_year(2).should == 1869
|
71
|
+
era.to_ad_year(45).should == 1912
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should return ad year for out of range" do
|
75
|
+
era = Warekky::Era.new(:meiji , 'M', '1868/01/01', '1912/07/29')
|
76
|
+
era.to_ad_year(-1).should == 1866
|
77
|
+
era.to_ad_year(0).should == 1867
|
78
|
+
era.to_ad_year(46).should == 1913
|
79
|
+
era.to_ad_year(50).should == 1917
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe :to_era_year do
|
84
|
+
it "should return an era year" do
|
85
|
+
era = Warekky::Era.new(:meiji , 'M', '1868/01/01', '1912/07/29')
|
86
|
+
era.to_era_year(1868).should == 1
|
87
|
+
era.to_era_year("1868").should == 1
|
88
|
+
era.to_era_year(1869).should == 2
|
89
|
+
era.to_era_year(1912).should == 45
|
90
|
+
end
|
91
|
+
|
92
|
+
it "should return ad year for out of range" do
|
93
|
+
era = Warekky::Era.new(:meiji , 'M', '1868/01/01', '1912/07/29')
|
94
|
+
era.to_era_year(1866).should == -1
|
95
|
+
era.to_era_year(1867).should == 0
|
96
|
+
era.to_era_year(1913).should == 46
|
97
|
+
era.to_era_year(1917).should == 50
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require File.expand_path('./spec_helper', File.dirname(__FILE__))
|
3
|
+
|
4
|
+
describe Warekky::Era do
|
5
|
+
|
6
|
+
before :all do
|
7
|
+
Warekky.era_group = nil
|
8
|
+
end
|
9
|
+
|
10
|
+
describe :strftime do
|
11
|
+
it "invoke original method" do
|
12
|
+
d = Date.new(2010, 6, 10)
|
13
|
+
d.should_receive(:strftime).with("%Y/%m/%d")
|
14
|
+
Warekky.strftime(d, "%Y/%m/%d")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe :parse do
|
19
|
+
it "invoke original method" do
|
20
|
+
Warekky.parse("2010/06/10 12:34:56").should == DateTime.new(2010, 6, 10, 12, 34, 56)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe :try_without do
|
25
|
+
it "invoke original method" do
|
26
|
+
Object.respond_to?(:class).should == true
|
27
|
+
Object.respond_to?(:class_with_warekky).should == false
|
28
|
+
Warekky.try_without(Object, :class).should == Class
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
data/warekky.gemspec
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{warekky}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Takeshi AKIMA"]
|
12
|
+
s.date = %q{2010-06-10}
|
13
|
+
s.description = %q{Japanese Era(年号) library and Time, Date, DateTime extensions.}
|
14
|
+
s.email = %q{akm2000@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/warekky.rb",
|
27
|
+
"lib/warekky/core_ext.rb",
|
28
|
+
"lib/warekky/era.rb",
|
29
|
+
"lib/warekky/era_group.rb",
|
30
|
+
"lib/warekky/ja.rb",
|
31
|
+
"spec/core_ext/with_date_spec.rb",
|
32
|
+
"spec/core_ext/with_date_time_spec.rb",
|
33
|
+
"spec/core_ext/with_time_spec.rb",
|
34
|
+
"spec/ja/with_date_spec.rb",
|
35
|
+
"spec/ja/with_date_time_spec.rb",
|
36
|
+
"spec/ja/with_time_spec.rb",
|
37
|
+
"spec/rcov.opts",
|
38
|
+
"spec/spec.opts",
|
39
|
+
"spec/spec_helper.rb",
|
40
|
+
"spec/warekky/era_group_spec.rb",
|
41
|
+
"spec/warekky/era_spec.rb",
|
42
|
+
"spec/warekky_spec.rb",
|
43
|
+
"warekky.gemspec"
|
44
|
+
]
|
45
|
+
s.homepage = %q{http://github.com/akm/warekky}
|
46
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
47
|
+
s.require_paths = ["lib"]
|
48
|
+
s.rubygems_version = %q{1.3.7}
|
49
|
+
s.summary = %q{Japanese Era(年号) library and Time, Date, DateTime extensions.}
|
50
|
+
s.test_files = [
|
51
|
+
"spec/core_ext/with_date_spec.rb",
|
52
|
+
"spec/core_ext/with_date_time_spec.rb",
|
53
|
+
"spec/core_ext/with_time_spec.rb",
|
54
|
+
"spec/ja/with_date_spec.rb",
|
55
|
+
"spec/ja/with_date_time_spec.rb",
|
56
|
+
"spec/ja/with_time_spec.rb",
|
57
|
+
"spec/spec_helper.rb",
|
58
|
+
"spec/warekky/era_group_spec.rb",
|
59
|
+
"spec/warekky/era_spec.rb",
|
60
|
+
"spec/warekky_spec.rb"
|
61
|
+
]
|
62
|
+
|
63
|
+
if s.respond_to? :specification_version then
|
64
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
65
|
+
s.specification_version = 3
|
66
|
+
|
67
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
68
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
69
|
+
else
|
70
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
71
|
+
end
|
72
|
+
else
|
73
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: warekky
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Takeshi AKIMA
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-06-10 00:00:00 +09:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rspec
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 13
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 2
|
33
|
+
- 9
|
34
|
+
version: 1.2.9
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
description: "Japanese Era(\xE5\xB9\xB4\xE5\x8F\xB7) library and Time, Date, DateTime extensions."
|
38
|
+
email: akm2000@gmail.com
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files:
|
44
|
+
- LICENSE
|
45
|
+
- README.rdoc
|
46
|
+
files:
|
47
|
+
- .document
|
48
|
+
- .gitignore
|
49
|
+
- LICENSE
|
50
|
+
- README.rdoc
|
51
|
+
- Rakefile
|
52
|
+
- VERSION
|
53
|
+
- lib/warekky.rb
|
54
|
+
- lib/warekky/core_ext.rb
|
55
|
+
- lib/warekky/era.rb
|
56
|
+
- lib/warekky/era_group.rb
|
57
|
+
- lib/warekky/ja.rb
|
58
|
+
- spec/core_ext/with_date_spec.rb
|
59
|
+
- spec/core_ext/with_date_time_spec.rb
|
60
|
+
- spec/core_ext/with_time_spec.rb
|
61
|
+
- spec/ja/with_date_spec.rb
|
62
|
+
- spec/ja/with_date_time_spec.rb
|
63
|
+
- spec/ja/with_time_spec.rb
|
64
|
+
- spec/rcov.opts
|
65
|
+
- spec/spec.opts
|
66
|
+
- spec/spec_helper.rb
|
67
|
+
- spec/warekky/era_group_spec.rb
|
68
|
+
- spec/warekky/era_spec.rb
|
69
|
+
- spec/warekky_spec.rb
|
70
|
+
- warekky.gemspec
|
71
|
+
has_rdoc: true
|
72
|
+
homepage: http://github.com/akm/warekky
|
73
|
+
licenses: []
|
74
|
+
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options:
|
77
|
+
- --charset=UTF-8
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
version: "0"
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
hash: 3
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
version: "0"
|
98
|
+
requirements: []
|
99
|
+
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 1.3.7
|
102
|
+
signing_key:
|
103
|
+
specification_version: 3
|
104
|
+
summary: "Japanese Era(\xE5\xB9\xB4\xE5\x8F\xB7) library and Time, Date, DateTime extensions."
|
105
|
+
test_files:
|
106
|
+
- spec/core_ext/with_date_spec.rb
|
107
|
+
- spec/core_ext/with_date_time_spec.rb
|
108
|
+
- spec/core_ext/with_time_spec.rb
|
109
|
+
- spec/ja/with_date_spec.rb
|
110
|
+
- spec/ja/with_date_time_spec.rb
|
111
|
+
- spec/ja/with_time_spec.rb
|
112
|
+
- spec/spec_helper.rb
|
113
|
+
- spec/warekky/era_group_spec.rb
|
114
|
+
- spec/warekky/era_spec.rb
|
115
|
+
- spec/warekky_spec.rb
|