home_run 0.9.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -216,6 +216,7 @@ extension due to the above differences:
216
216
 
217
217
  * Date::Performance - Date#<=> assumes @ajd instance variable
218
218
  (unnecessary anyway, as home_run is faster)
219
+ * Runt - assumes @ajd instance variable
219
220
 
220
221
  == Reporting issues/bugs
221
222
 
@@ -29,7 +29,6 @@ VALUE rhrd_abbr_daynames;
29
29
  VALUE rhrd_zone_re;
30
30
  VALUE rhrd_zone_dst_re;
31
31
  VALUE rhrd_zone_sign_re;
32
- VALUE rhrd_zones_hash;
33
32
  VALUE rhrd_empty_string;
34
33
  VALUE rhrd_start_num;
35
34
  VALUE rhrd_string_colon;
@@ -64,6 +63,8 @@ ID rhrd_id_usec;
64
63
  #endif
65
64
  ID rhrd_id_utc;
66
65
  ID rhrd_id_utc_offset;
66
+ ID rhrd_id_Format;
67
+ ID rhrd_id_ZONES;
67
68
 
68
69
  #ifdef RUBY19
69
70
  ID rhrd_id__httpdate;
@@ -1969,7 +1970,7 @@ VALUE rhrd_s_zone_to_diff(VALUE klass, VALUE str) {
1969
1970
  long offset = 0;
1970
1971
  long len, i, j;
1971
1972
  char *s;
1972
- VALUE v, e;
1973
+ VALUE v, e, zones;
1973
1974
 
1974
1975
  str = rb_funcall(str, rhrd_id_downcase, 0);
1975
1976
  if(RTEST(rb_funcall(str, rhrd_id_sub_b, 2, rhrd_zone_dst_re, rhrd_empty_string))) {
@@ -1978,8 +1979,12 @@ VALUE rhrd_s_zone_to_diff(VALUE klass, VALUE str) {
1978
1979
  }
1979
1980
  }
1980
1981
 
1981
- if(RTEST(v = rb_hash_aref(rhrd_zones_hash, str))) {
1982
- return LONG2NUM(offset + NUM2LONG(v));
1982
+ zones = rb_const_get(rhrd_class, rhrd_id_Format);
1983
+ if (RTEST(zones) && RTEST(rb_obj_is_kind_of(zones, rb_cModule))) {
1984
+ zones = rb_const_get(zones, rhrd_id_ZONES);
1985
+ if(RTEST(zones) && RTEST(rb_obj_is_kind_of(zones, rb_cHash)) && RTEST(v = rb_hash_aref(zones, str))) {
1986
+ return LONG2NUM(offset + NUM2LONG(v));
1987
+ }
1983
1988
  }
1984
1989
 
1985
1990
  if(RTEST(rb_funcall(str, rhrd_id_sub_b, 2, rhrd_zone_sign_re, rhrd_empty_string))) {
@@ -3991,6 +3996,8 @@ void Init_date_ext(void) {
3991
3996
  #endif
3992
3997
  rhrd_id_utc = rb_intern("utc");
3993
3998
  rhrd_id_utc_offset = rb_intern("utc_offset");
3999
+ rhrd_id_Format = rb_intern("Format");
4000
+ rhrd_id_ZONES = rb_intern("ZONES");
3994
4001
 
3995
4002
  #ifdef RUBY19
3996
4003
  rhrd_id__httpdate = rb_intern("_httpdate");
@@ -4125,178 +4132,6 @@ void Init_date_ext(void) {
4125
4132
  rb_ary_push(rhrd_abbr_daynames, rb_str_new2(rhrd__abbr_day_names[i]));
4126
4133
  }
4127
4134
 
4128
- rhrd_zones_hash = rb_hash_new();
4129
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("a"), INT2FIX(3600));
4130
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("adt"), INT2FIX(-10800));
4131
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("afghanistan"), INT2FIX(16200));
4132
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("ahst"), INT2FIX(-36000));
4133
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("akdt"), INT2FIX(-28800));
4134
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("akst"), INT2FIX(-32400));
4135
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("alaskan"), INT2FIX(-32400));
4136
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("arab"), INT2FIX(10800));
4137
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("arabian"), INT2FIX(14400));
4138
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("arabic"), INT2FIX(10800));
4139
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("art"), INT2FIX(-10800));
4140
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("ast"), INT2FIX(-14400));
4141
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("at"), INT2FIX(-7200));
4142
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("atlantic"), INT2FIX(-14400));
4143
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("aus central"), INT2FIX(34200));
4144
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("aus eastern"), INT2FIX(36000));
4145
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("azores"), INT2FIX(-3600));
4146
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("b"), INT2FIX(7200));
4147
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("brst"), INT2FIX(-7200));
4148
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("brt"), INT2FIX(-10800));
4149
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("bst"), INT2FIX(3600));
4150
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("bt"), INT2FIX(10800));
4151
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("c"), INT2FIX(10800));
4152
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("canada central"), INT2FIX(-21600));
4153
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("cape verde"), INT2FIX(-3600));
4154
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("cat"), INT2FIX(-36000));
4155
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("caucasus"), INT2FIX(14400));
4156
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("cct"), INT2FIX(28800));
4157
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("cdt"), INT2FIX(-18000));
4158
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("cen. australia"), INT2FIX(34200));
4159
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("central"), INT2FIX(-21600));
4160
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("central america"), INT2FIX(-21600));
4161
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("central asia"), INT2FIX(21600));
4162
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("central europe"), INT2FIX(3600));
4163
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("central european"), INT2FIX(3600));
4164
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("central pacific"), INT2FIX(39600));
4165
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("cest"), INT2FIX(7200));
4166
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("cet"), INT2FIX(3600));
4167
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("china"), INT2FIX(28800));
4168
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("clst"), INT2FIX(-10800));
4169
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("clt"), INT2FIX(-14400));
4170
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("cst"), INT2FIX(-21600));
4171
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("d"), INT2FIX(14400));
4172
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("dateline"), INT2FIX(-43200));
4173
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("e"), INT2FIX(18000));
4174
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("e. africa"), INT2FIX(10800));
4175
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("e. australia"), INT2FIX(36000));
4176
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("e. europe"), INT2FIX(7200));
4177
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("e. south america"), INT2FIX(-10800));
4178
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("eadt"), INT2FIX(39600));
4179
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("east"), INT2FIX(36000));
4180
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("eastern"), INT2FIX(-18000));
4181
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("eat"), INT2FIX(10800));
4182
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("edt"), INT2FIX(-14400));
4183
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("eest"), INT2FIX(10800));
4184
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("eet"), INT2FIX(7200));
4185
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("egypt"), INT2FIX(7200));
4186
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("ekaterinburg"), INT2FIX(18000));
4187
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("est"), INT2FIX(-18000));
4188
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("f"), INT2FIX(21600));
4189
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("fiji"), INT2FIX(43200));
4190
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("fle"), INT2FIX(7200));
4191
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("fst"), INT2FIX(7200));
4192
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("fwt"), INT2FIX(3600));
4193
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("g"), INT2FIX(25200));
4194
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("gmt"), INT2FIX(0));
4195
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("greenland"), INT2FIX(-10800));
4196
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("greenwich"), INT2FIX(0));
4197
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("gst"), INT2FIX(36000));
4198
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("gtb"), INT2FIX(7200));
4199
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("h"), INT2FIX(28800));
4200
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("hadt"), INT2FIX(-32400));
4201
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("hast"), INT2FIX(-36000));
4202
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("hawaiian"), INT2FIX(-36000));
4203
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("hdt"), INT2FIX(-32400));
4204
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("hst"), INT2FIX(-36000));
4205
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("i"), INT2FIX(32400));
4206
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("idle"), INT2FIX(43200));
4207
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("idlw"), INT2FIX(-43200));
4208
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("india"), INT2FIX(19800));
4209
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("iran"), INT2FIX(12600));
4210
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("ist"), INT2FIX(19800));
4211
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("jerusalem"), INT2FIX(7200));
4212
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("jst"), INT2FIX(32400));
4213
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("k"), INT2FIX(36000));
4214
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("korea"), INT2FIX(32400));
4215
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("kst"), INT2FIX(32400));
4216
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("l"), INT2FIX(39600));
4217
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("m"), INT2FIX(43200));
4218
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("malay peninsula"), INT2FIX(28800));
4219
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("mdt"), INT2FIX(-21600));
4220
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("mest"), INT2FIX(7200));
4221
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("mesz"), INT2FIX(7200));
4222
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("met"), INT2FIX(3600));
4223
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("mewt"), INT2FIX(3600));
4224
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("mexico"), INT2FIX(-21600));
4225
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("mez"), INT2FIX(3600));
4226
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("mid-atlantic"), INT2FIX(-7200));
4227
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("mountain"), INT2FIX(-25200));
4228
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("msd"), INT2FIX(14400));
4229
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("msk"), INT2FIX(10800));
4230
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("mst"), INT2FIX(-25200));
4231
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("myanmar"), INT2FIX(23400));
4232
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("n"), INT2FIX(-3600));
4233
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("n. central asia"), INT2FIX(21600));
4234
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("ndt"), INT2FIX(-9000));
4235
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("nepal"), INT2FIX(20700));
4236
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("new zealand"), INT2FIX(43200));
4237
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("newfoundland"), INT2FIX(-12600));
4238
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("north asia"), INT2FIX(25200));
4239
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("north asia east"), INT2FIX(28800));
4240
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("nst"), INT2FIX(-12600));
4241
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("nt"), INT2FIX(-39600));
4242
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("nzdt"), INT2FIX(46800));
4243
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("nzst"), INT2FIX(43200));
4244
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("nzt"), INT2FIX(43200));
4245
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("o"), INT2FIX(-7200));
4246
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("p"), INT2FIX(-10800));
4247
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("pacific"), INT2FIX(-28800));
4248
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("pacific sa"), INT2FIX(-14400));
4249
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("pdt"), INT2FIX(-25200));
4250
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("pst"), INT2FIX(-28800));
4251
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("q"), INT2FIX(-14400));
4252
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("r"), INT2FIX(-18000));
4253
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("romance"), INT2FIX(3600));
4254
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("russian"), INT2FIX(10800));
4255
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("s"), INT2FIX(-21600));
4256
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("sa eastern"), INT2FIX(-10800));
4257
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("sa pacific"), INT2FIX(-18000));
4258
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("sa western"), INT2FIX(-14400));
4259
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("samoa"), INT2FIX(-39600));
4260
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("sast"), INT2FIX(7200));
4261
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("se asia"), INT2FIX(25200));
4262
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("sgt"), INT2FIX(28800));
4263
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("south africa"), INT2FIX(7200));
4264
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("sri lanka"), INT2FIX(21600));
4265
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("sst"), INT2FIX(7200));
4266
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("swt"), INT2FIX(3600));
4267
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("t"), INT2FIX(-25200));
4268
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("taipei"), INT2FIX(28800));
4269
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("tasmania"), INT2FIX(36000));
4270
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("tokyo"), INT2FIX(32400));
4271
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("tonga"), INT2FIX(46800));
4272
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("u"), INT2FIX(-28800));
4273
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("us eastern"), INT2FIX(-18000));
4274
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("us mountain"), INT2FIX(-25200));
4275
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("ut"), INT2FIX(0));
4276
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("utc"), INT2FIX(0));
4277
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("v"), INT2FIX(-32400));
4278
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("vladivostok"), INT2FIX(36000));
4279
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("w"), INT2FIX(-36000));
4280
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("w. australia"), INT2FIX(28800));
4281
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("w. central africa"), INT2FIX(3600));
4282
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("w. europe"), INT2FIX(3600));
4283
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("wadt"), INT2FIX(28800));
4284
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("wast"), INT2FIX(25200));
4285
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("wat"), INT2FIX(3600));
4286
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("west"), INT2FIX(3600));
4287
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("west asia"), INT2FIX(18000));
4288
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("west pacific"), INT2FIX(36000));
4289
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("wet"), INT2FIX(0));
4290
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("x"), INT2FIX(-39600));
4291
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("y"), INT2FIX(-43200));
4292
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("yakutsk"), INT2FIX(32400));
4293
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("ydt"), INT2FIX(-28800));
4294
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("yst"), INT2FIX(-32400));
4295
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("z"), INT2FIX(0));
4296
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("zp4"), INT2FIX(14400));
4297
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("zp5"), INT2FIX(18000));
4298
- rb_hash_aset(rhrd_zones_hash, rb_str_new2("zp6"), INT2FIX(21600));
4299
-
4300
4135
  rhrd_start_num = LONG2NUM(RHR_JD_MIN - 1);
4301
4136
  rhrd_empty_string = rb_str_new("", 0);
4302
4137
  rhrd_string_colon = rb_str_new(":", 1);
@@ -4312,7 +4147,6 @@ void Init_date_ext(void) {
4312
4147
  /* Register global variables with Garbage collector, so users
4313
4148
  * who remove constants can't crash the interpreter. */
4314
4149
 
4315
- rb_global_variable(&rhrd_zones_hash);
4316
4150
  rb_global_variable(&rhrd_monthnames);
4317
4151
  rb_global_variable(&rhrd_abbr_monthnames);
4318
4152
  rb_global_variable(&rhrd_daynames);
@@ -4336,9 +4170,6 @@ void Init_date_ext(void) {
4336
4170
  /* An integer higher than the highest supported julian day number */
4337
4171
  rb_define_const(rhrd_class, "JULIAN", LONG2NUM(RHR_JD_MAX + 1));
4338
4172
 
4339
- /* A hash mapping lowercase time zone names to offsets
4340
- * in seconds<br />ZONES['pst'] => -28800 */
4341
- rb_define_const(rhrd_class, "ZONES", rhrd_zones_hash);
4342
4173
  /* An array of month names<br />MONTHNAMES[1] => 'January' */
4343
4174
  rb_define_const(rhrd_class, "MONTHNAMES", rhrd_monthnames);
4344
4175
  /* An array of abbreviated month names<br />ABBR_MONTHNAMES[1] => 'Jan' */
@@ -1,7 +1,7 @@
1
1
  # format.rb: Written by Tadayoshi Funaba 1999-2009
2
2
  # $Id: format.rb,v 2.43 2008-01-17 20:16:31+09 tadf Exp $
3
3
 
4
- require 'date' unless defined?(Date::ZONES)
4
+ require 'date' unless defined?(Date::MONTHNAMES)
5
5
 
6
6
  class Date
7
7
  # Holds some constants used by the pure ruby parsing code.
@@ -57,7 +57,83 @@ class Date
57
57
  }
58
58
 
59
59
  # Hash mapping lowercase time zone names to offsets in seconds (e.g. ZONES['pst'] => -28800)
60
- ZONES = Date::ZONES
60
+ ZONES = {
61
+ 'ut' => 0*3600, 'gmt' => 0*3600, 'est' => -5*3600, 'edt' => -4*3600,
62
+ 'cst' => -6*3600, 'cdt' => -5*3600, 'mst' => -7*3600, 'mdt' => -6*3600,
63
+ 'pst' => -8*3600, 'pdt' => -7*3600,
64
+ 'a' => 1*3600, 'b' => 2*3600, 'c' => 3*3600, 'd' => 4*3600,
65
+ 'e' => 5*3600, 'f' => 6*3600, 'g' => 7*3600, 'h' => 8*3600,
66
+ 'i' => 9*3600, 'k' => 10*3600, 'l' => 11*3600, 'm' => 12*3600,
67
+ 'n' => -1*3600, 'o' => -2*3600, 'p' => -3*3600, 'q' => -4*3600,
68
+ 'r' => -5*3600, 's' => -6*3600, 't' => -7*3600, 'u' => -8*3600,
69
+ 'v' => -9*3600, 'w' =>-10*3600, 'x' =>-11*3600, 'y' =>-12*3600,
70
+ 'z' => 0*3600,
71
+
72
+ 'utc' => 0*3600, 'wet' => 0*3600,
73
+ 'at' => -2*3600, 'brst'=> -2*3600, 'ndt' => -(2*3600+1800),
74
+ 'art' => -3*3600, 'adt' => -3*3600, 'brt' => -3*3600, 'clst'=> -3*3600,
75
+ 'nst' => -(3*3600+1800),
76
+ 'ast' => -4*3600, 'clt' => -4*3600,
77
+ 'akdt'=> -8*3600, 'ydt' => -8*3600,
78
+ 'akst'=> -9*3600, 'hadt'=> -9*3600, 'hdt' => -9*3600, 'yst' => -9*3600,
79
+ 'ahst'=>-10*3600, 'cat' =>-10*3600, 'hast'=>-10*3600, 'hst' =>-10*3600,
80
+ 'nt' =>-11*3600,
81
+ 'idlw'=>-12*3600,
82
+ 'bst' => 1*3600, 'cet' => 1*3600, 'fwt' => 1*3600, 'met' => 1*3600,
83
+ 'mewt'=> 1*3600, 'mez' => 1*3600, 'swt' => 1*3600, 'wat' => 1*3600,
84
+ 'west'=> 1*3600,
85
+ 'cest'=> 2*3600, 'eet' => 2*3600, 'fst' => 2*3600, 'mest'=> 2*3600,
86
+ 'mesz'=> 2*3600, 'sast'=> 2*3600, 'sst' => 2*3600,
87
+ 'bt' => 3*3600, 'eat' => 3*3600, 'eest'=> 3*3600, 'msk' => 3*3600,
88
+ 'msd' => 4*3600, 'zp4' => 4*3600,
89
+ 'zp5' => 5*3600, 'ist' => (5*3600+1800),
90
+ 'zp6' => 6*3600,
91
+ 'wast'=> 7*3600,
92
+ 'cct' => 8*3600, 'sgt' => 8*3600, 'wadt'=> 8*3600,
93
+ 'jst' => 9*3600, 'kst' => 9*3600,
94
+ 'east'=> 10*3600, 'gst' => 10*3600,
95
+ 'eadt'=> 11*3600,
96
+ 'idle'=> 12*3600, 'nzst'=> 12*3600, 'nzt' => 12*3600,
97
+ 'nzdt'=> 13*3600,
98
+
99
+ 'afghanistan' => 16200, 'alaskan' => -32400,
100
+ 'arab' => 10800, 'arabian' => 14400,
101
+ 'arabic' => 10800, 'atlantic' => -14400,
102
+ 'aus central' => 34200, 'aus eastern' => 36000,
103
+ 'azores' => -3600, 'canada central' => -21600,
104
+ 'cape verde' => -3600, 'caucasus' => 14400,
105
+ 'cen. australia' => 34200, 'central america' => -21600,
106
+ 'central asia' => 21600, 'central europe' => 3600,
107
+ 'central european' => 3600, 'central pacific' => 39600,
108
+ 'central' => -21600, 'china' => 28800,
109
+ 'dateline' => -43200, 'e. africa' => 10800,
110
+ 'e. australia' => 36000, 'e. europe' => 7200,
111
+ 'e. south america' => -10800, 'eastern' => -18000,
112
+ 'egypt' => 7200, 'ekaterinburg' => 18000,
113
+ 'fiji' => 43200, 'fle' => 7200,
114
+ 'greenland' => -10800, 'greenwich' => 0,
115
+ 'gtb' => 7200, 'hawaiian' => -36000,
116
+ 'india' => 19800, 'iran' => 12600,
117
+ 'jerusalem' => 7200, 'korea' => 32400,
118
+ 'mexico' => -21600, 'mid-atlantic' => -7200,
119
+ 'mountain' => -25200, 'myanmar' => 23400,
120
+ 'n. central asia' => 21600, 'nepal' => 20700,
121
+ 'new zealand' => 43200, 'newfoundland' => -12600,
122
+ 'north asia east' => 28800, 'north asia' => 25200,
123
+ 'pacific sa' => -14400, 'pacific' => -28800,
124
+ 'romance' => 3600, 'russian' => 10800,
125
+ 'sa eastern' => -10800, 'sa pacific' => -18000,
126
+ 'sa western' => -14400, 'samoa' => -39600,
127
+ 'se asia' => 25200, 'malay peninsula' => 28800,
128
+ 'south africa' => 7200, 'sri lanka' => 21600,
129
+ 'taipei' => 28800, 'tasmania' => 36000,
130
+ 'tokyo' => 32400, 'tonga' => 46800,
131
+ 'us eastern' => -18000, 'us mountain' => -25200,
132
+ 'vladivostok' => 36000, 'w. australia' => 28800,
133
+ 'w. central africa' => 3600, 'w. europe' => 3600,
134
+ 'west asia' => 18000, 'west pacific' => 36000,
135
+ 'yakutsk' => 32400
136
+ }
61
137
 
62
138
  [MONTHS, DAYS, ABBR_MONTHS, ABBR_DAYS, ZONES].each do |x|
63
139
  x.freeze
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: home_run
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 9
9
- - 4
10
- version: 0.9.4
9
+ - 0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Evans
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-18 00:00:00 -07:00
18
+ date: 2011-02-01 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21