shire 0.0.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.
- data/CHANGELOG +0 -0
- data/LICENSE +15 -0
- data/README +58 -0
- data/lib/shire/core_ext/date.rb +7 -0
- data/lib/shire/core_ext/time/calculations.rb +206 -0
- data/lib/shire/core_ext/time/constants.rb +169 -0
- data/lib/shire/core_ext/time.rb +7 -0
- data/lib/shire/core_ext.rb +1 -0
- data/lib/shire/version.rb +9 -0
- data/lib/shire.rb +3 -0
- metadata +58 -0
data/CHANGELOG
ADDED
|
File without changes
|
data/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Copyright (C) 2006 Stephen Arneil
|
|
2
|
+
|
|
3
|
+
This program is free software; you can redistribute it and/or
|
|
4
|
+
modify it under the terms of the GNU General Public License
|
|
5
|
+
as published by the Free Software Foundation; either version 2
|
|
6
|
+
of the License, or (at your option) any later version.
|
|
7
|
+
|
|
8
|
+
This program is distributed in the hope that it will be useful,
|
|
9
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11
|
+
GNU General Public License for more details.
|
|
12
|
+
|
|
13
|
+
You should have received a copy of the GNU General Public License
|
|
14
|
+
along with this program; if not, write to the Free Software
|
|
15
|
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
data/README
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
= Shire -- Time and Date extensions for hobbits
|
|
2
|
+
|
|
3
|
+
Shire extends the Time and Date classes for hobbits.
|
|
4
|
+
|
|
5
|
+
Shire is based on Tom Braun's DateTime::Fiction::JRRTolkien::Shire[http://search.cpan.org/~tbraun/DateTime-Fiction-JRRTolkien-Shire-0.02/] Perl module and is implemented in Ruby in the style of the ActiveSupport[http://rubyforge.org/projects/activesupport] core extensions.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
== Download
|
|
9
|
+
|
|
10
|
+
The latest version of Shire can be found at
|
|
11
|
+
|
|
12
|
+
* http://rubyforge.org/frs/?group_id=2703
|
|
13
|
+
|
|
14
|
+
The project home page can be found at
|
|
15
|
+
|
|
16
|
+
* http://shire.rubyforge.org
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
== Installation
|
|
20
|
+
|
|
21
|
+
The preferred method of installing Shire is through its GEM file. You'll need to have
|
|
22
|
+
RubyGems[http://rubygems.rubyforge.org/wiki/wiki.pl] installed for that, though. If you have it,
|
|
23
|
+
then use:
|
|
24
|
+
|
|
25
|
+
% [sudo] gem install shire-0.0.1.gem
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
== Time Example
|
|
29
|
+
|
|
30
|
+
require 'shire'
|
|
31
|
+
|
|
32
|
+
time = Time.utc 2006, 12, 21
|
|
33
|
+
puts time.shire_on_date
|
|
34
|
+
|
|
35
|
+
# Mersday 30 Foreyule 7470
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
== Date Example
|
|
39
|
+
|
|
40
|
+
require 'date'
|
|
41
|
+
require 'shire'
|
|
42
|
+
|
|
43
|
+
date = Date.civil 2007, 9, 27
|
|
44
|
+
puts date.shire_on_date
|
|
45
|
+
|
|
46
|
+
# Hevensday 5 Winterfilth 7471
|
|
47
|
+
#
|
|
48
|
+
# Gandalf and the Hobbits leave Rivendell, 1419.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
== License
|
|
52
|
+
|
|
53
|
+
Shire is released under the GPL license.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
== Support
|
|
57
|
+
|
|
58
|
+
You can find the Shire RubyForge page at http://rubyforge.org/projects/shire.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
module Shire
|
|
2
|
+
module CoreExtensions
|
|
3
|
+
module Time
|
|
4
|
+
module Calculations
|
|
5
|
+
# Returns the year.
|
|
6
|
+
def shire_year
|
|
7
|
+
calculate_shire
|
|
8
|
+
@shire_year
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Returns the day of the year.
|
|
12
|
+
def shire_yday
|
|
13
|
+
calculate_shire
|
|
14
|
+
@shire_yday
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Returns whether the year is a leap year.
|
|
18
|
+
def shire_leap_year?
|
|
19
|
+
calculate_shire
|
|
20
|
+
@shire_leap_year
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Returns the holiday day number or nil if the date is not a holiday.
|
|
24
|
+
def shire_holiday
|
|
25
|
+
calculate_shire
|
|
26
|
+
@shire_holiday
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Returns whether the date is a holiday.
|
|
30
|
+
def shire_holiday?
|
|
31
|
+
calculate_shire
|
|
32
|
+
@shire_holiday != nil
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns the name of the holiday or nil if the date is not a holiday.
|
|
36
|
+
def shire_holiday_name
|
|
37
|
+
calculate_shire
|
|
38
|
+
Constants::SHIRE_HOLIDAY_NAMES[shire_holiday] if shire_holiday?
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns the number of the day of the week or nil if not a day of the week.
|
|
42
|
+
def shire_wday
|
|
43
|
+
calculate_shire
|
|
44
|
+
@shire_wday
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns whether the date is a day of the week.
|
|
48
|
+
def shire_wday?
|
|
49
|
+
calculate_shire
|
|
50
|
+
@shire_wday != nil
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns the month number.
|
|
54
|
+
def shire_month
|
|
55
|
+
calculate_shire
|
|
56
|
+
@shire_month
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Returns the day of the month.
|
|
60
|
+
def shire_day
|
|
61
|
+
calculate_shire
|
|
62
|
+
@shire_day
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns the name of the day of the week or nil if not a day of the week.
|
|
66
|
+
def shire_day_name
|
|
67
|
+
calculate_shire
|
|
68
|
+
Constants::SHIRE_DAY_NAMES[shire_wday] if shire_wday
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns the traditional name of the day of the week or nil if not a day of the week.
|
|
72
|
+
def shire_traditional_day_name
|
|
73
|
+
calculate_shire
|
|
74
|
+
Constants::SHIRE_TRADITIONAL_DAY_NAMES[shire_wday] if shire_wday
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Returns the name of the month or nil if not a day of a month.
|
|
78
|
+
def shire_month_name
|
|
79
|
+
calculate_shire
|
|
80
|
+
Constants::SHIRE_MONTH_NAMES[shire_month]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def shire_events
|
|
84
|
+
calculate_shire
|
|
85
|
+
if shire_holiday?
|
|
86
|
+
Constants::SHIRE_EVENTS[0][shire_holiday]
|
|
87
|
+
else
|
|
88
|
+
Constants::SHIRE_EVENTS[shire_month][shire_day]
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def shire_events?
|
|
93
|
+
calculate_shire
|
|
94
|
+
shire_events != nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Returns the date and any events that occurred on that date.
|
|
98
|
+
def shire_on_date
|
|
99
|
+
calculate_shire
|
|
100
|
+
if shire_events?
|
|
101
|
+
"#{shire_to_s}\n\n#{shire_events}"
|
|
102
|
+
else
|
|
103
|
+
"#{shire_to_s}\n"
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Returns the date.
|
|
108
|
+
def shire_to_s
|
|
109
|
+
calculate_shire
|
|
110
|
+
if shire_holiday?
|
|
111
|
+
if shire_wday?
|
|
112
|
+
"#{shire_day_name} #{shire_holiday_name} #{shire_year}"
|
|
113
|
+
else
|
|
114
|
+
"#{shire_holiday_name} #{shire_year}"
|
|
115
|
+
end
|
|
116
|
+
else
|
|
117
|
+
"#{shire_day_name} #{shire_day} #{shire_month_name} #{shire_year}"
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
private
|
|
122
|
+
|
|
123
|
+
def calculate_shire
|
|
124
|
+
return if self.instance_variables.include? '@shire_calculated'
|
|
125
|
+
@shire_year = year + 5464
|
|
126
|
+
@shire_yday = yday + 9
|
|
127
|
+
calculate_year_adjustments
|
|
128
|
+
calculate_year_yday_and_leap_year
|
|
129
|
+
calculate_holiday
|
|
130
|
+
calculate_shire_wday
|
|
131
|
+
calculate_month_and_day
|
|
132
|
+
@shire_calculated = true
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def calculate_year_adjustments
|
|
136
|
+
modyear = @shire_year % 400
|
|
137
|
+
if (modyear > 300) && (modyear < 364): @shire_yday += 1
|
|
138
|
+
elsif modyear == 364: @shire_yday += 1
|
|
139
|
+
elsif ((modyear > 64) && (modyear < 100)) || ((modyear > 164) && (modyear < 200)): @shire_yday -= 1
|
|
140
|
+
elsif (modyear == 100) || (modyear == 200): @shire_yday -= 1
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def calculate_year_yday_and_leap_year
|
|
145
|
+
calculate_leap_year
|
|
146
|
+
if @shire_leap_year && @shire_yday > 366
|
|
147
|
+
@shire_year += 1
|
|
148
|
+
@shire_yday -= 366
|
|
149
|
+
@shire_leap_year = false
|
|
150
|
+
elsif !@shire_leap_year && @shire_yday > 365
|
|
151
|
+
@shire_year += 1
|
|
152
|
+
@shire_yday -= 365
|
|
153
|
+
calculate_leap_year
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def calculate_leap_year
|
|
158
|
+
@shire_leap_year = false
|
|
159
|
+
@shire_leap_year = true if (@shire_year % 4 == 0) && (@shire_year % 100 != 0)
|
|
160
|
+
@shire_leap_year = true if @shire_year % 400 == 0
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def calculate_holiday
|
|
164
|
+
@shire_holiday = nil
|
|
165
|
+
@shire_yday_365 = @shire_yday
|
|
166
|
+
if @shire_leap_year
|
|
167
|
+
@shire_holiday = 4 if @shire_yday == 184
|
|
168
|
+
@shire_yday_365 -= 1 if @shire_yday > 184
|
|
169
|
+
end
|
|
170
|
+
unless @shire_holiday
|
|
171
|
+
case @shire_yday_365
|
|
172
|
+
when 1: @shire_holiday = 1
|
|
173
|
+
when 182: @shire_holiday = 2
|
|
174
|
+
when 183: @shire_holiday = 3
|
|
175
|
+
when 184: @shire_holiday = 5
|
|
176
|
+
when 365: @shire_holiday = 6
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
def calculate_shire_wday
|
|
182
|
+
@shire_yday_364 = @shire_yday_365
|
|
183
|
+
@shire_yday_364 -= 1 if @shire_yday_364 > 183
|
|
184
|
+
if @shire_holiday == 3 || @shire_holiday == 4
|
|
185
|
+
@shire_wday = nil
|
|
186
|
+
else
|
|
187
|
+
@shire_wday = (@shire_yday_364 - 1) % 7
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def calculate_month_and_day
|
|
192
|
+
if @shire_holiday
|
|
193
|
+
@shire_month = nil
|
|
194
|
+
@shire_day = nil
|
|
195
|
+
else
|
|
196
|
+
@shire_yday_360 = @shire_yday_364
|
|
197
|
+
@shire_yday_360 -= 1
|
|
198
|
+
@shire_yday_360 -= 2 if @shire_yday_360 > 180
|
|
199
|
+
@shire_month = ((@shire_yday_360 - 1) / 30) + 1
|
|
200
|
+
@shire_day = ((@shire_yday_360 - 1) % 30) + 1
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
end
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
module Shire
|
|
2
|
+
module CoreExtensions
|
|
3
|
+
module Time
|
|
4
|
+
module Constants
|
|
5
|
+
SHIRE_DAY_NAMES = ['Sterday', 'Sunday', 'Monday', 'Trewsday', 'Hevensday', 'Mersday', 'Highday']
|
|
6
|
+
SHIRE_TRADITIONAL_DAY_NAMES = ['Sterrendei', 'Sunnendei', 'Monendei', 'Trewesdei', 'Hevenesdei', 'Meresdei', 'Highdei']
|
|
7
|
+
SHIRE_MONTH_NAMES = [nil, 'Afteryule', 'Solmath', 'Rethe', 'Astron',
|
|
8
|
+
'Thrimidge', 'Forelithe', 'Afterlithe', 'Wedmath', 'Halimath', 'Winterfilth', 'Blotmath', 'Foreyule']
|
|
9
|
+
SHIRE_HOLIDAY_NAMES = [nil, '2 Yule', '1 Lithe', "Midyear's day", 'Overlithe', '2 Lithe', '1 Yule']
|
|
10
|
+
SHIRE_EVENTS = {
|
|
11
|
+
0 => {
|
|
12
|
+
3 => "Wedding of King Elessar and Arwen, 1419.\n"
|
|
13
|
+
},
|
|
14
|
+
1 => {
|
|
15
|
+
8 => "The Company of the Ring reaches Holland, 1419.\n",
|
|
16
|
+
13 => "The Company of the Ring reaches the West-gate of Moria at nightfall, 1419.\n",
|
|
17
|
+
14 => "The Company of the Ring spends the night in Moria hall 21, 1419.\n",
|
|
18
|
+
15 => "The Bridge of Khazad-dum, and the fall of Gandalf, 1419.\n",
|
|
19
|
+
17 => "The Company of the Ring comes to Caras Galadhon at evening, 1419.\n",
|
|
20
|
+
23 => "Gandalf pursues the Balrog to the peak of Zirakzigil, 1419.\n",
|
|
21
|
+
25 => "Gandalf casts down the Balrog, and passes away.\n" +
|
|
22
|
+
"His body lies on the peak of Zirakzigil, 1419.\n"
|
|
23
|
+
},
|
|
24
|
+
2 => {
|
|
25
|
+
14 => "Frodo and Sam look in the Mirror of Galadriel, 1419.\n" +
|
|
26
|
+
"Gandalf returns to life, and lies in a trance, 1419.\n",
|
|
27
|
+
16 => "Company of the Ring says farewell to Lorien --\n" +
|
|
28
|
+
"Gollum observes departure, 1419.\n",
|
|
29
|
+
17 => "Gwaihir the eagle bears Gandalf to Lorien, 1419.\n",
|
|
30
|
+
25 => "The Company of the Ring pass the Argonath and camp at Parth Galen, 1419.\n" +
|
|
31
|
+
"First battle of the Fords of Isen -- Theodred son of Theoden slain, 1419.\n",
|
|
32
|
+
26 => "Breaking of the Fellowship, 1419.\n" +
|
|
33
|
+
"Death of Boromir; his horn is heard in Minas Tirith, 1419.\n" +
|
|
34
|
+
"Meriadoc and Peregrin captured by Orcs -- Aragorn pursues, 1419.\n" +
|
|
35
|
+
"Eomer hears of the descent of the Orc-band from Emyn Muil, 1419.\n" +
|
|
36
|
+
"Frodo and Samwise enter the eastern Emyn Muil, 1419.\n",
|
|
37
|
+
27 => "Aragorn reaches the west-cliff at sunrise, 1419.\n" +
|
|
38
|
+
"Eomer sets out Eastfold against Theoden's orders to pursue the Orcs, 1419.\n",
|
|
39
|
+
28 => "Eomer overtakes the Orcs just outside of Fangorn Forest, 1419.\n",
|
|
40
|
+
29 => "Meriodoc and Pippin escape and meet Treebeard, 1419.\n" +
|
|
41
|
+
"The Rohirrim attack at sunrise and destroy the Orcs, 1419.\n" +
|
|
42
|
+
"Frodo descends from the Emyn Muil and meets Gollum, 1419.\n" +
|
|
43
|
+
"Faramir sees the funeral boat of Boromir, 1419.\n",
|
|
44
|
+
30 => "Entmoot begins, 1419.\n" +
|
|
45
|
+
"Eomer, returning to Edoras, meets Aragorn, 1419.\n"
|
|
46
|
+
},
|
|
47
|
+
3 => {
|
|
48
|
+
1 => "Aragorn meets Gandalf the White, and they set out for Edoras, 1419.\n" +
|
|
49
|
+
"Faramir leaves Minas Tirith on an errand to Ithilien, 1419.\n",
|
|
50
|
+
2 => "The Rohirrim ride west against Saruman, 1419.\n" +
|
|
51
|
+
"Second battle at the Fords of Isen; Erkenbrand defeated, 1419.\n" +
|
|
52
|
+
"Entmoot ends. Ents march on Isengard and reach it at night, 1419.\n",
|
|
53
|
+
3 => "Theoden retreats to Helm's Deep; battle of the Hornburg begins, 1419.\n" +
|
|
54
|
+
"Ents complete the destruction of Isengard.\n",
|
|
55
|
+
4 => "Theoden and Gandalf set out from Helm's Deep for Isengard, 1419.\n" +
|
|
56
|
+
"Frodo reaches the slag mound on the edge of the of the Morannon, 1419.\n",
|
|
57
|
+
5 => "Theoden reaches Isengard at noon; parley with Saruman in Orthanc, 1419.\n" +
|
|
58
|
+
"Gandalf sets out with Peregrin for Minas Tirith, 1419.\n",
|
|
59
|
+
6 => "Aragorn overtaken by the Dunedain in the early hours, 1419.\n",
|
|
60
|
+
7 => "Frodo taken by Faramir to Henneth Annun, 1419.\n" +
|
|
61
|
+
"Aragorn comes to Dunharrow at nightfall, 1419.\n",
|
|
62
|
+
8 => "Aragorn takes the \"Paths of the Dead\", and reaches Erech at midnight, 1419.\n"+
|
|
63
|
+
"Frodo leaves Henneth Annun, 1419.\n",
|
|
64
|
+
9 => "Gandalf reaches Minas Tirith, 1419.\n" +
|
|
65
|
+
"Darkness begins to flow out of Mordor, 1419.\n",
|
|
66
|
+
10 => "The Dawnless Day, 1419.\n" +
|
|
67
|
+
"The Rohirrim are mustered and ride from Harrowdale, 1419.\n" +
|
|
68
|
+
"Faramir rescued by Gandalf at the gates of Minas Tirith, 1419.\n" +
|
|
69
|
+
"An army from the Morannon takes Cair Andros and passes in Anorien, 1419.\n",
|
|
70
|
+
11 => "Gollum visits Shelob, 1419.\n" +
|
|
71
|
+
"Denethor sends Faramir to Osgiliath, 1419.\n" +
|
|
72
|
+
"Eastern Rohan is invaded and Lorien assaulted, 1419.\n",
|
|
73
|
+
12 => "Gollum leads Frodo in Shelob's lair, 1419.\n" +
|
|
74
|
+
"Ents defeat the invaders of Rohan, 1419.\n",
|
|
75
|
+
13 => "Frodo captured by the Orcs of Cirith Ungol, 1419.\n" +
|
|
76
|
+
"The Pelennor is overrun and Faramir is wounded, 1419.\n" +
|
|
77
|
+
"Aragorn reaches Pelargir and captures the fleet of Umbar, 1419.\n",
|
|
78
|
+
14 => "Samwise finds Frodo in the tower of Cirith Ungol, 1419.\n" +
|
|
79
|
+
"Minas Tirith besieged, 1419.\n",
|
|
80
|
+
15 => "Witch King breaks the gates of Minas Tirith, 1419.\n" +
|
|
81
|
+
"Denethor, Steward of Gondor, burns himself on a pyre, 1419.\n" +
|
|
82
|
+
"The battle of the Pelennor occurs as Theoden and Aragorn arrive, 1419.\n" +
|
|
83
|
+
"Thranduil repels the forces of Dol Guldur in Mirkwood, 1419.\n" +
|
|
84
|
+
"Lorien assaulted for second time, 1419.\n",
|
|
85
|
+
17 => "Battle of Dale, where King Brand and King Dain Ironfoot fall, 1419.\n" +
|
|
86
|
+
"Shagrat brings Frodo's cloak, mail-shirt, and sword to Barad-dur, 1419.\n",
|
|
87
|
+
18 => "Host of the west leaves Minas Tirith, 1419.\n" +
|
|
88
|
+
"Frodo and Sam overtaken by Orcs on the road from Durthang to Udun, 1419.\n",
|
|
89
|
+
19 => "Frodo and Sam escape the Orcs and start on the road toward Mount Doom, 1419.\n",
|
|
90
|
+
22 => "Lorien assaulted for the third time, 1419.\n",
|
|
91
|
+
24 => "Frodo and Sam reach the base of Mount Doom, 1419.\n",
|
|
92
|
+
25 => "Battle of the Host of the West on the slag hill of the Morannon, 1419.\n" +
|
|
93
|
+
"Gollum siezes the Ring of Power and falls into the Cracks of Doom, 1419.\n" +
|
|
94
|
+
"Downfall of Barad-dur and the passing of Sauron!, 1419.\n" +
|
|
95
|
+
"Birth of Elanor the Fair, daughter of Samwise, 1421.\n" +
|
|
96
|
+
"Fourth age begins in the reckoning of Gondor, 1421.\n",
|
|
97
|
+
27 => "Bard II and Thorin III Stonehelm drive the enemy from Dale, 1419.\n",
|
|
98
|
+
28 => "Celeborn crosses the Anduin and begins destruction of Dol Guldur, 1419.\n"
|
|
99
|
+
},
|
|
100
|
+
4 => {
|
|
101
|
+
6 => "The mallorn trea flowers in the party field, 1420.\n",
|
|
102
|
+
8 => "Ring bearers are honored on the fields of Cormallen, 1419.\n",
|
|
103
|
+
12 => "Gandalf arrives in Hobbiton, 1418\n"
|
|
104
|
+
},
|
|
105
|
+
5 => {
|
|
106
|
+
1 => "Crowning of King Elessar, 1419.\n" +
|
|
107
|
+
"Samwise marries Rose, 1420.\n"
|
|
108
|
+
},
|
|
109
|
+
6 => {
|
|
110
|
+
20 => "Sauron attacks Osgiliath, 1418.\n" +
|
|
111
|
+
"Thranduil is attacked, and Gollum escapes, 1418.\n"
|
|
112
|
+
},
|
|
113
|
+
7 => {
|
|
114
|
+
4 => "Boromir sets out from Minas Tirith, 1418\n",
|
|
115
|
+
10 => "Gandalf imprisoned in Orthanc, 1418\n",
|
|
116
|
+
19 => "Funeral Escort of King Theoden leaves Minas Tirith, 1419.\n"
|
|
117
|
+
},
|
|
118
|
+
8 => {
|
|
119
|
+
10 => "Funeral of King Theoden, 1419.\n"
|
|
120
|
+
},
|
|
121
|
+
9 => {
|
|
122
|
+
18 => "Gandalf escapes from Orthanc in the early hours, 1418.\n",
|
|
123
|
+
19 => "Gandalf comes to Edoras as a beggar, and is refused admintance, 1418",
|
|
124
|
+
20 => "Gandalf gains entrance to Edoras. Theoden commands him to go:\n" +
|
|
125
|
+
"\"Take any horse, only be gone ere tomorrow is old\", 1418.\n",
|
|
126
|
+
21 => "The hobbits return to Rivendell, 1419.\n",
|
|
127
|
+
22 => "Birthday of Bilbo and Frodo.\n" +
|
|
128
|
+
"The Black Riders reach Sarn Ford at evening;\n" +
|
|
129
|
+
" they drive off the guard of Rangers, 1418.\n" +
|
|
130
|
+
"Saruman comes to the Shire, 1419.\n",
|
|
131
|
+
23 => "Four Black Riders enter the shire before dawn. The others pursue \n" +
|
|
132
|
+
"the Rangers eastword and then return to watch the Greenway, 1418.\n" +
|
|
133
|
+
"A Black Rider comes to Hobbiton at nightfall, 1418.\n" +
|
|
134
|
+
"Frodo leaves Bag End, 1418.\n" +
|
|
135
|
+
"Gandalf having tamed Shadowfax rides from Rohan, 1418.\n",
|
|
136
|
+
26 => "Frodo comes to Bombadil, 1418\n",
|
|
137
|
+
28 => "The Hobbits are captured by a barrow-wight, 1418.\n",
|
|
138
|
+
29 => "Frodo reaches Bree at night, 1418.\n" +
|
|
139
|
+
"Frodo and Bilbo depart over the sea with the three Keepers, 1421.\n" +
|
|
140
|
+
"End of the Third Age, 1421.\n",
|
|
141
|
+
30 => "Crickhollow and the inn at Bree are raided in the early hours, 1418.\n" +
|
|
142
|
+
"Frodo leaves Bree, 1418.\n",
|
|
143
|
+
},
|
|
144
|
+
10 => {
|
|
145
|
+
3 => "Gandalf attacked at night on Weathertop, 1418.\n",
|
|
146
|
+
5 => "Gandalf and the Hobbits leave Rivendell, 1419.\n",
|
|
147
|
+
6 => "The camp under weathertop is attacked at night and Frodo is wounded, 1418.\n",
|
|
148
|
+
11 => "Glorfindel drives the Black Riders off the Bridge of Mitheithel, 1418.\n",
|
|
149
|
+
13 => "Frodo crosses the Bridge of Mitheithel, 1418.\n",
|
|
150
|
+
18 => "Glorfindel finds Frodo at dusk, 1418.\n" +
|
|
151
|
+
"Gandalf reaches Rivendell, 1418.\n",
|
|
152
|
+
20 => "Escape across the Ford of Bruinen, 1418.\n",
|
|
153
|
+
24 => "Frodo recovers and wakes, 1418.\n" +
|
|
154
|
+
"Boromir arrives at Rivendell at night, 1418.\n",
|
|
155
|
+
25 => "Council of Elrond, 1418.\n",
|
|
156
|
+
30 => "The four Hobbits arrive at the Brandywine Bridge in the dark, 1419.\n"
|
|
157
|
+
},
|
|
158
|
+
11 => {
|
|
159
|
+
3 => "Battle of Bywater and passing of Saruman, 1419.\n" +
|
|
160
|
+
"End of the War of the Ring, 1419.\n"
|
|
161
|
+
},
|
|
162
|
+
12 => {
|
|
163
|
+
25 => "The Company of the Ring leaves Rivendell at dusk.\n"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Dir[File.dirname(__FILE__) + "/core_ext/*.rb"].each { |file| require(file) }
|
data/lib/shire.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
rubygems_version: 0.8.11
|
|
3
|
+
specification_version: 1
|
|
4
|
+
name: shire
|
|
5
|
+
version: !ruby/object:Gem::Version
|
|
6
|
+
version: 0.0.1
|
|
7
|
+
date: 2006-12-07 00:00:00 +00:00
|
|
8
|
+
summary: Shire time.
|
|
9
|
+
require_paths:
|
|
10
|
+
- lib
|
|
11
|
+
email: stephen@arneil.com
|
|
12
|
+
homepage: http://shire.rubyforge.org
|
|
13
|
+
rubyforge_project: shire
|
|
14
|
+
description: Time and Date extensions for hobbits
|
|
15
|
+
autorequire:
|
|
16
|
+
default_executable:
|
|
17
|
+
bindir: bin
|
|
18
|
+
has_rdoc: true
|
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
20
|
+
requirements:
|
|
21
|
+
- - ">"
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: 0.0.0
|
|
24
|
+
version:
|
|
25
|
+
platform: ruby
|
|
26
|
+
signing_key:
|
|
27
|
+
cert_chain:
|
|
28
|
+
authors:
|
|
29
|
+
- Stephen Arneil
|
|
30
|
+
files:
|
|
31
|
+
- CHANGELOG
|
|
32
|
+
- README
|
|
33
|
+
- LICENSE
|
|
34
|
+
- lib/shire
|
|
35
|
+
- lib/shire.rb
|
|
36
|
+
- lib/shire/core_ext
|
|
37
|
+
- lib/shire/core_ext.rb
|
|
38
|
+
- lib/shire/version.rb
|
|
39
|
+
- lib/shire/core_ext/date
|
|
40
|
+
- lib/shire/core_ext/date.rb
|
|
41
|
+
- lib/shire/core_ext/time
|
|
42
|
+
- lib/shire/core_ext/time.rb
|
|
43
|
+
- lib/shire/core_ext/time/calculations.rb
|
|
44
|
+
- lib/shire/core_ext/time/constants.rb
|
|
45
|
+
test_files: []
|
|
46
|
+
|
|
47
|
+
rdoc_options: []
|
|
48
|
+
|
|
49
|
+
extra_rdoc_files: []
|
|
50
|
+
|
|
51
|
+
executables: []
|
|
52
|
+
|
|
53
|
+
extensions: []
|
|
54
|
+
|
|
55
|
+
requirements: []
|
|
56
|
+
|
|
57
|
+
dependencies: []
|
|
58
|
+
|