repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Chungking.rb | lib/tzinfo/data/definitions/Asia/Chungking.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Chungking
include TimezoneDefinition
linked_timezone 'Asia/Chungking', 'Asia/Shanghai'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Baghdad.rb | lib/tzinfo/data/definitions/Asia/Baghdad.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Baghdad
include TimezoneDefinition
timezone 'Asia/Baghdad' do |tz|
tz.offset :o0, 10660, 0, :LMT
tz.offset :o1, 10656, 0, :BMT
tz.offset :o2, 10800, 0, :'+03'
tz.offset :o3, 10800, 3600, :'+04'
tz.transition 1889, 12, :o1, -2524532260, 10417111387, 4320
tz.transition 1917, 12, :o2, -1641005856, 726478313, 300
tz.transition 1982, 4, :o3, 389048400
tz.transition 1982, 9, :o2, 402264000
tz.transition 1983, 3, :o3, 417906000
tz.transition 1983, 9, :o2, 433800000
tz.transition 1984, 3, :o3, 449614800
tz.transition 1984, 9, :o2, 465422400
tz.transition 1985, 3, :o3, 481150800
tz.transition 1985, 9, :o2, 496792800
tz.transition 1986, 3, :o3, 512517600
tz.transition 1986, 9, :o2, 528242400
tz.transition 1987, 3, :o3, 543967200
tz.transition 1987, 9, :o2, 559692000
tz.transition 1988, 3, :o3, 575416800
tz.transition 1988, 9, :o2, 591141600
tz.transition 1989, 3, :o3, 606866400
tz.transition 1989, 9, :o2, 622591200
tz.transition 1990, 3, :o3, 638316000
tz.transition 1990, 9, :o2, 654645600
tz.transition 1991, 4, :o3, 670464000
tz.transition 1991, 10, :o2, 686275200
tz.transition 1992, 4, :o3, 702086400
tz.transition 1992, 10, :o2, 717897600
tz.transition 1993, 4, :o3, 733622400
tz.transition 1993, 10, :o2, 749433600
tz.transition 1994, 4, :o3, 765158400
tz.transition 1994, 10, :o2, 780969600
tz.transition 1995, 4, :o3, 796694400
tz.transition 1995, 10, :o2, 812505600
tz.transition 1996, 4, :o3, 828316800
tz.transition 1996, 10, :o2, 844128000
tz.transition 1997, 4, :o3, 859852800
tz.transition 1997, 10, :o2, 875664000
tz.transition 1998, 4, :o3, 891388800
tz.transition 1998, 10, :o2, 907200000
tz.transition 1999, 4, :o3, 922924800
tz.transition 1999, 10, :o2, 938736000
tz.transition 2000, 4, :o3, 954547200
tz.transition 2000, 10, :o2, 970358400
tz.transition 2001, 4, :o3, 986083200
tz.transition 2001, 10, :o2, 1001894400
tz.transition 2002, 4, :o3, 1017619200
tz.transition 2002, 10, :o2, 1033430400
tz.transition 2003, 4, :o3, 1049155200
tz.transition 2003, 10, :o2, 1064966400
tz.transition 2004, 4, :o3, 1080777600
tz.transition 2004, 10, :o2, 1096588800
tz.transition 2005, 4, :o3, 1112313600
tz.transition 2005, 10, :o2, 1128124800
tz.transition 2006, 4, :o3, 1143849600
tz.transition 2006, 10, :o2, 1159660800
tz.transition 2007, 4, :o3, 1175385600
tz.transition 2007, 10, :o2, 1191196800
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Thimbu.rb | lib/tzinfo/data/definitions/Asia/Thimbu.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Thimbu
include TimezoneDefinition
linked_timezone 'Asia/Thimbu', 'Asia/Thimphu'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Chita.rb | lib/tzinfo/data/definitions/Asia/Chita.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Chita
include TimezoneDefinition
timezone 'Asia/Chita' do |tz|
tz.offset :o0, 27232, 0, :LMT
tz.offset :o1, 28800, 0, :'+08'
tz.offset :o2, 32400, 0, :'+09'
tz.offset :o3, 32400, 3600, :'+10'
tz.offset :o4, 28800, 3600, :'+09'
tz.offset :o5, 36000, 0, :'+10'
tz.transition 1919, 12, :o1, -1579419232, 6540229399, 2700
tz.transition 1930, 6, :o2, -1247558400, 14556889, 6
tz.transition 1981, 3, :o3, 354898800
tz.transition 1981, 9, :o2, 370706400
tz.transition 1982, 3, :o3, 386434800
tz.transition 1982, 9, :o2, 402242400
tz.transition 1983, 3, :o3, 417970800
tz.transition 1983, 9, :o2, 433778400
tz.transition 1984, 3, :o3, 449593200
tz.transition 1984, 9, :o2, 465325200
tz.transition 1985, 3, :o3, 481050000
tz.transition 1985, 9, :o2, 496774800
tz.transition 1986, 3, :o3, 512499600
tz.transition 1986, 9, :o2, 528224400
tz.transition 1987, 3, :o3, 543949200
tz.transition 1987, 9, :o2, 559674000
tz.transition 1988, 3, :o3, 575398800
tz.transition 1988, 9, :o2, 591123600
tz.transition 1989, 3, :o3, 606848400
tz.transition 1989, 9, :o2, 622573200
tz.transition 1990, 3, :o3, 638298000
tz.transition 1990, 9, :o2, 654627600
tz.transition 1991, 3, :o4, 670352400
tz.transition 1991, 9, :o1, 686080800
tz.transition 1992, 1, :o2, 695757600
tz.transition 1992, 3, :o3, 701802000
tz.transition 1992, 9, :o2, 717526800
tz.transition 1993, 3, :o3, 733251600
tz.transition 1993, 9, :o2, 748976400
tz.transition 1994, 3, :o3, 764701200
tz.transition 1994, 9, :o2, 780426000
tz.transition 1995, 3, :o3, 796150800
tz.transition 1995, 9, :o2, 811875600
tz.transition 1996, 3, :o3, 828205200
tz.transition 1996, 10, :o2, 846349200
tz.transition 1997, 3, :o3, 859654800
tz.transition 1997, 10, :o2, 877798800
tz.transition 1998, 3, :o3, 891104400
tz.transition 1998, 10, :o2, 909248400
tz.transition 1999, 3, :o3, 922554000
tz.transition 1999, 10, :o2, 941302800
tz.transition 2000, 3, :o3, 954003600
tz.transition 2000, 10, :o2, 972752400
tz.transition 2001, 3, :o3, 985453200
tz.transition 2001, 10, :o2, 1004202000
tz.transition 2002, 3, :o3, 1017507600
tz.transition 2002, 10, :o2, 1035651600
tz.transition 2003, 3, :o3, 1048957200
tz.transition 2003, 10, :o2, 1067101200
tz.transition 2004, 3, :o3, 1080406800
tz.transition 2004, 10, :o2, 1099155600
tz.transition 2005, 3, :o3, 1111856400
tz.transition 2005, 10, :o2, 1130605200
tz.transition 2006, 3, :o3, 1143306000
tz.transition 2006, 10, :o2, 1162054800
tz.transition 2007, 3, :o3, 1174755600
tz.transition 2007, 10, :o2, 1193504400
tz.transition 2008, 3, :o3, 1206810000
tz.transition 2008, 10, :o2, 1224954000
tz.transition 2009, 3, :o3, 1238259600
tz.transition 2009, 10, :o2, 1256403600
tz.transition 2010, 3, :o3, 1269709200
tz.transition 2010, 10, :o2, 1288458000
tz.transition 2011, 3, :o5, 1301158800
tz.transition 2014, 10, :o1, 1414252800
tz.transition 2016, 3, :o2, 1459015200
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Barnaul.rb | lib/tzinfo/data/definitions/Asia/Barnaul.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Barnaul
include TimezoneDefinition
timezone 'Asia/Barnaul' do |tz|
tz.offset :o0, 20100, 0, :LMT
tz.offset :o1, 21600, 0, :'+06'
tz.offset :o2, 25200, 0, :'+07'
tz.offset :o3, 25200, 3600, :'+08'
tz.offset :o4, 21600, 3600, :'+07'
tz.transition 1919, 12, :o1, -1579844100, 697623053, 288
tz.transition 1930, 6, :o2, -1247551200, 9704593, 4
tz.transition 1981, 3, :o3, 354906000
tz.transition 1981, 9, :o2, 370713600
tz.transition 1982, 3, :o3, 386442000
tz.transition 1982, 9, :o2, 402249600
tz.transition 1983, 3, :o3, 417978000
tz.transition 1983, 9, :o2, 433785600
tz.transition 1984, 3, :o3, 449600400
tz.transition 1984, 9, :o2, 465332400
tz.transition 1985, 3, :o3, 481057200
tz.transition 1985, 9, :o2, 496782000
tz.transition 1986, 3, :o3, 512506800
tz.transition 1986, 9, :o2, 528231600
tz.transition 1987, 3, :o3, 543956400
tz.transition 1987, 9, :o2, 559681200
tz.transition 1988, 3, :o3, 575406000
tz.transition 1988, 9, :o2, 591130800
tz.transition 1989, 3, :o3, 606855600
tz.transition 1989, 9, :o2, 622580400
tz.transition 1990, 3, :o3, 638305200
tz.transition 1990, 9, :o2, 654634800
tz.transition 1991, 3, :o4, 670359600
tz.transition 1991, 9, :o1, 686088000
tz.transition 1992, 1, :o2, 695764800
tz.transition 1992, 3, :o3, 701809200
tz.transition 1992, 9, :o2, 717534000
tz.transition 1993, 3, :o3, 733258800
tz.transition 1993, 9, :o2, 748983600
tz.transition 1994, 3, :o3, 764708400
tz.transition 1994, 9, :o2, 780433200
tz.transition 1995, 3, :o3, 796158000
tz.transition 1995, 5, :o4, 801590400
tz.transition 1995, 9, :o1, 811886400
tz.transition 1996, 3, :o4, 828216000
tz.transition 1996, 10, :o1, 846360000
tz.transition 1997, 3, :o4, 859665600
tz.transition 1997, 10, :o1, 877809600
tz.transition 1998, 3, :o4, 891115200
tz.transition 1998, 10, :o1, 909259200
tz.transition 1999, 3, :o4, 922564800
tz.transition 1999, 10, :o1, 941313600
tz.transition 2000, 3, :o4, 954014400
tz.transition 2000, 10, :o1, 972763200
tz.transition 2001, 3, :o4, 985464000
tz.transition 2001, 10, :o1, 1004212800
tz.transition 2002, 3, :o4, 1017518400
tz.transition 2002, 10, :o1, 1035662400
tz.transition 2003, 3, :o4, 1048968000
tz.transition 2003, 10, :o1, 1067112000
tz.transition 2004, 3, :o4, 1080417600
tz.transition 2004, 10, :o1, 1099166400
tz.transition 2005, 3, :o4, 1111867200
tz.transition 2005, 10, :o1, 1130616000
tz.transition 2006, 3, :o4, 1143316800
tz.transition 2006, 10, :o1, 1162065600
tz.transition 2007, 3, :o4, 1174766400
tz.transition 2007, 10, :o1, 1193515200
tz.transition 2008, 3, :o4, 1206820800
tz.transition 2008, 10, :o1, 1224964800
tz.transition 2009, 3, :o4, 1238270400
tz.transition 2009, 10, :o1, 1256414400
tz.transition 2010, 3, :o4, 1269720000
tz.transition 2010, 10, :o1, 1288468800
tz.transition 2011, 3, :o2, 1301169600
tz.transition 2014, 10, :o1, 1414263600
tz.transition 2016, 3, :o2, 1459022400
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Baku.rb | lib/tzinfo/data/definitions/Asia/Baku.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Baku
include TimezoneDefinition
timezone 'Asia/Baku' do |tz|
tz.offset :o0, 11964, 0, :LMT
tz.offset :o1, 10800, 0, :'+03'
tz.offset :o2, 14400, 0, :'+04'
tz.offset :o3, 14400, 3600, :'+05'
tz.offset :o4, 10800, 3600, :'+04'
tz.transition 1924, 5, :o1, -1441163964, 17452133003, 7200
tz.transition 1957, 2, :o2, -405140400, 19487187, 8
tz.transition 1981, 3, :o3, 354916800
tz.transition 1981, 9, :o2, 370724400
tz.transition 1982, 3, :o3, 386452800
tz.transition 1982, 9, :o2, 402260400
tz.transition 1983, 3, :o3, 417988800
tz.transition 1983, 9, :o2, 433796400
tz.transition 1984, 3, :o3, 449611200
tz.transition 1984, 9, :o2, 465343200
tz.transition 1985, 3, :o3, 481068000
tz.transition 1985, 9, :o2, 496792800
tz.transition 1986, 3, :o3, 512517600
tz.transition 1986, 9, :o2, 528242400
tz.transition 1987, 3, :o3, 543967200
tz.transition 1987, 9, :o2, 559692000
tz.transition 1988, 3, :o3, 575416800
tz.transition 1988, 9, :o2, 591141600
tz.transition 1989, 3, :o3, 606866400
tz.transition 1989, 9, :o2, 622591200
tz.transition 1990, 3, :o3, 638316000
tz.transition 1990, 9, :o2, 654645600
tz.transition 1991, 3, :o4, 670370400
tz.transition 1991, 9, :o1, 686098800
tz.transition 1992, 3, :o4, 701823600
tz.transition 1992, 9, :o2, 717548400
tz.transition 1996, 3, :o3, 828234000
tz.transition 1996, 10, :o2, 846378000
tz.transition 1997, 3, :o3, 859680000
tz.transition 1997, 10, :o2, 877824000
tz.transition 1998, 3, :o3, 891129600
tz.transition 1998, 10, :o2, 909273600
tz.transition 1999, 3, :o3, 922579200
tz.transition 1999, 10, :o2, 941328000
tz.transition 2000, 3, :o3, 954028800
tz.transition 2000, 10, :o2, 972777600
tz.transition 2001, 3, :o3, 985478400
tz.transition 2001, 10, :o2, 1004227200
tz.transition 2002, 3, :o3, 1017532800
tz.transition 2002, 10, :o2, 1035676800
tz.transition 2003, 3, :o3, 1048982400
tz.transition 2003, 10, :o2, 1067126400
tz.transition 2004, 3, :o3, 1080432000
tz.transition 2004, 10, :o2, 1099180800
tz.transition 2005, 3, :o3, 1111881600
tz.transition 2005, 10, :o2, 1130630400
tz.transition 2006, 3, :o3, 1143331200
tz.transition 2006, 10, :o2, 1162080000
tz.transition 2007, 3, :o3, 1174780800
tz.transition 2007, 10, :o2, 1193529600
tz.transition 2008, 3, :o3, 1206835200
tz.transition 2008, 10, :o2, 1224979200
tz.transition 2009, 3, :o3, 1238284800
tz.transition 2009, 10, :o2, 1256428800
tz.transition 2010, 3, :o3, 1269734400
tz.transition 2010, 10, :o2, 1288483200
tz.transition 2011, 3, :o3, 1301184000
tz.transition 2011, 10, :o2, 1319932800
tz.transition 2012, 3, :o3, 1332633600
tz.transition 2012, 10, :o2, 1351382400
tz.transition 2013, 3, :o3, 1364688000
tz.transition 2013, 10, :o2, 1382832000
tz.transition 2014, 3, :o3, 1396137600
tz.transition 2014, 10, :o2, 1414281600
tz.transition 2015, 3, :o3, 1427587200
tz.transition 2015, 10, :o2, 1445731200
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Hovd.rb | lib/tzinfo/data/definitions/Asia/Hovd.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Hovd
include TimezoneDefinition
timezone 'Asia/Hovd' do |tz|
tz.offset :o0, 21996, 0, :LMT
tz.offset :o1, 21600, 0, :'+06'
tz.offset :o2, 25200, 0, :'+07'
tz.offset :o3, 25200, 3600, :'+08'
tz.transition 1905, 7, :o1, -2032927596, 5800939789, 2400
tz.transition 1977, 12, :o2, 252439200
tz.transition 1983, 3, :o3, 417978000
tz.transition 1983, 9, :o2, 433785600
tz.transition 1984, 3, :o3, 449600400
tz.transition 1984, 9, :o2, 465321600
tz.transition 1985, 3, :o3, 481050000
tz.transition 1985, 9, :o2, 496771200
tz.transition 1986, 3, :o3, 512499600
tz.transition 1986, 9, :o2, 528220800
tz.transition 1987, 3, :o3, 543949200
tz.transition 1987, 9, :o2, 559670400
tz.transition 1988, 3, :o3, 575398800
tz.transition 1988, 9, :o2, 591120000
tz.transition 1989, 3, :o3, 606848400
tz.transition 1989, 9, :o2, 622569600
tz.transition 1990, 3, :o3, 638298000
tz.transition 1990, 9, :o2, 654624000
tz.transition 1991, 3, :o3, 670352400
tz.transition 1991, 9, :o2, 686073600
tz.transition 1992, 3, :o3, 701802000
tz.transition 1992, 9, :o2, 717523200
tz.transition 1993, 3, :o3, 733251600
tz.transition 1993, 9, :o2, 748972800
tz.transition 1994, 3, :o3, 764701200
tz.transition 1994, 9, :o2, 780422400
tz.transition 1995, 3, :o3, 796150800
tz.transition 1995, 9, :o2, 811872000
tz.transition 1996, 3, :o3, 828205200
tz.transition 1996, 9, :o2, 843926400
tz.transition 1997, 3, :o3, 859654800
tz.transition 1997, 9, :o2, 875376000
tz.transition 1998, 3, :o3, 891104400
tz.transition 1998, 9, :o2, 906825600
tz.transition 2001, 4, :o3, 988398000
tz.transition 2001, 9, :o2, 1001700000
tz.transition 2002, 3, :o3, 1017428400
tz.transition 2002, 9, :o2, 1033149600
tz.transition 2003, 3, :o3, 1048878000
tz.transition 2003, 9, :o2, 1064599200
tz.transition 2004, 3, :o3, 1080327600
tz.transition 2004, 9, :o2, 1096048800
tz.transition 2005, 3, :o3, 1111777200
tz.transition 2005, 9, :o2, 1127498400
tz.transition 2006, 3, :o3, 1143226800
tz.transition 2006, 9, :o2, 1159552800
tz.transition 2015, 3, :o3, 1427482800
tz.transition 2015, 9, :o2, 1443196800
tz.transition 2016, 3, :o3, 1458932400
tz.transition 2016, 9, :o2, 1474646400
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Krasnoyarsk.rb | lib/tzinfo/data/definitions/Asia/Krasnoyarsk.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Krasnoyarsk
include TimezoneDefinition
timezone 'Asia/Krasnoyarsk' do |tz|
tz.offset :o0, 22286, 0, :LMT
tz.offset :o1, 21600, 0, :'+06'
tz.offset :o2, 25200, 0, :'+07'
tz.offset :o3, 25200, 3600, :'+08'
tz.offset :o4, 21600, 3600, :'+07'
tz.offset :o5, 28800, 0, :'+08'
tz.transition 1920, 1, :o1, -1577513486, 104644623257, 43200
tz.transition 1930, 6, :o2, -1247551200, 9704593, 4
tz.transition 1981, 3, :o3, 354906000
tz.transition 1981, 9, :o2, 370713600
tz.transition 1982, 3, :o3, 386442000
tz.transition 1982, 9, :o2, 402249600
tz.transition 1983, 3, :o3, 417978000
tz.transition 1983, 9, :o2, 433785600
tz.transition 1984, 3, :o3, 449600400
tz.transition 1984, 9, :o2, 465332400
tz.transition 1985, 3, :o3, 481057200
tz.transition 1985, 9, :o2, 496782000
tz.transition 1986, 3, :o3, 512506800
tz.transition 1986, 9, :o2, 528231600
tz.transition 1987, 3, :o3, 543956400
tz.transition 1987, 9, :o2, 559681200
tz.transition 1988, 3, :o3, 575406000
tz.transition 1988, 9, :o2, 591130800
tz.transition 1989, 3, :o3, 606855600
tz.transition 1989, 9, :o2, 622580400
tz.transition 1990, 3, :o3, 638305200
tz.transition 1990, 9, :o2, 654634800
tz.transition 1991, 3, :o4, 670359600
tz.transition 1991, 9, :o1, 686088000
tz.transition 1992, 1, :o2, 695764800
tz.transition 1992, 3, :o3, 701809200
tz.transition 1992, 9, :o2, 717534000
tz.transition 1993, 3, :o3, 733258800
tz.transition 1993, 9, :o2, 748983600
tz.transition 1994, 3, :o3, 764708400
tz.transition 1994, 9, :o2, 780433200
tz.transition 1995, 3, :o3, 796158000
tz.transition 1995, 9, :o2, 811882800
tz.transition 1996, 3, :o3, 828212400
tz.transition 1996, 10, :o2, 846356400
tz.transition 1997, 3, :o3, 859662000
tz.transition 1997, 10, :o2, 877806000
tz.transition 1998, 3, :o3, 891111600
tz.transition 1998, 10, :o2, 909255600
tz.transition 1999, 3, :o3, 922561200
tz.transition 1999, 10, :o2, 941310000
tz.transition 2000, 3, :o3, 954010800
tz.transition 2000, 10, :o2, 972759600
tz.transition 2001, 3, :o3, 985460400
tz.transition 2001, 10, :o2, 1004209200
tz.transition 2002, 3, :o3, 1017514800
tz.transition 2002, 10, :o2, 1035658800
tz.transition 2003, 3, :o3, 1048964400
tz.transition 2003, 10, :o2, 1067108400
tz.transition 2004, 3, :o3, 1080414000
tz.transition 2004, 10, :o2, 1099162800
tz.transition 2005, 3, :o3, 1111863600
tz.transition 2005, 10, :o2, 1130612400
tz.transition 2006, 3, :o3, 1143313200
tz.transition 2006, 10, :o2, 1162062000
tz.transition 2007, 3, :o3, 1174762800
tz.transition 2007, 10, :o2, 1193511600
tz.transition 2008, 3, :o3, 1206817200
tz.transition 2008, 10, :o2, 1224961200
tz.transition 2009, 3, :o3, 1238266800
tz.transition 2009, 10, :o2, 1256410800
tz.transition 2010, 3, :o3, 1269716400
tz.transition 2010, 10, :o2, 1288465200
tz.transition 2011, 3, :o5, 1301166000
tz.transition 2014, 10, :o2, 1414260000
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Dhaka.rb | lib/tzinfo/data/definitions/Asia/Dhaka.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Dhaka
include TimezoneDefinition
timezone 'Asia/Dhaka' do |tz|
tz.offset :o0, 21700, 0, :LMT
tz.offset :o1, 21200, 0, :HMT
tz.offset :o2, 23400, 0, :'+0630'
tz.offset :o3, 19800, 0, :'+0530'
tz.offset :o4, 21600, 0, :'+06'
tz.offset :o5, 21600, 3600, :'+07'
tz.transition 1889, 12, :o1, -2524543300, 2083422167, 864
tz.transition 1941, 9, :o2, -891582800, 524937943, 216
tz.transition 1942, 5, :o3, -872058600, 116663723, 48
tz.transition 1942, 8, :o2, -862637400, 116668957, 48
tz.transition 1951, 9, :o4, -576138600, 116828123, 48
tz.transition 2009, 6, :o5, 1245430800
tz.transition 2009, 12, :o4, 1262278800
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Dubai.rb | lib/tzinfo/data/definitions/Asia/Dubai.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Dubai
include TimezoneDefinition
timezone 'Asia/Dubai' do |tz|
tz.offset :o0, 13272, 0, :LMT
tz.offset :o1, 14400, 0, :'+04'
tz.transition 1919, 12, :o1, -1577936472, 8720367647, 3600
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Ulaanbaatar.rb | lib/tzinfo/data/definitions/Asia/Ulaanbaatar.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Ulaanbaatar
include TimezoneDefinition
timezone 'Asia/Ulaanbaatar' do |tz|
tz.offset :o0, 25652, 0, :LMT
tz.offset :o1, 25200, 0, :'+07'
tz.offset :o2, 28800, 0, :'+08'
tz.offset :o3, 28800, 3600, :'+09'
tz.transition 1905, 7, :o1, -2032931252, 52208457187, 21600
tz.transition 1977, 12, :o2, 252435600
tz.transition 1983, 3, :o3, 417974400
tz.transition 1983, 9, :o2, 433782000
tz.transition 1984, 3, :o3, 449596800
tz.transition 1984, 9, :o2, 465318000
tz.transition 1985, 3, :o3, 481046400
tz.transition 1985, 9, :o2, 496767600
tz.transition 1986, 3, :o3, 512496000
tz.transition 1986, 9, :o2, 528217200
tz.transition 1987, 3, :o3, 543945600
tz.transition 1987, 9, :o2, 559666800
tz.transition 1988, 3, :o3, 575395200
tz.transition 1988, 9, :o2, 591116400
tz.transition 1989, 3, :o3, 606844800
tz.transition 1989, 9, :o2, 622566000
tz.transition 1990, 3, :o3, 638294400
tz.transition 1990, 9, :o2, 654620400
tz.transition 1991, 3, :o3, 670348800
tz.transition 1991, 9, :o2, 686070000
tz.transition 1992, 3, :o3, 701798400
tz.transition 1992, 9, :o2, 717519600
tz.transition 1993, 3, :o3, 733248000
tz.transition 1993, 9, :o2, 748969200
tz.transition 1994, 3, :o3, 764697600
tz.transition 1994, 9, :o2, 780418800
tz.transition 1995, 3, :o3, 796147200
tz.transition 1995, 9, :o2, 811868400
tz.transition 1996, 3, :o3, 828201600
tz.transition 1996, 9, :o2, 843922800
tz.transition 1997, 3, :o3, 859651200
tz.transition 1997, 9, :o2, 875372400
tz.transition 1998, 3, :o3, 891100800
tz.transition 1998, 9, :o2, 906822000
tz.transition 2001, 4, :o3, 988394400
tz.transition 2001, 9, :o2, 1001696400
tz.transition 2002, 3, :o3, 1017424800
tz.transition 2002, 9, :o2, 1033146000
tz.transition 2003, 3, :o3, 1048874400
tz.transition 2003, 9, :o2, 1064595600
tz.transition 2004, 3, :o3, 1080324000
tz.transition 2004, 9, :o2, 1096045200
tz.transition 2005, 3, :o3, 1111773600
tz.transition 2005, 9, :o2, 1127494800
tz.transition 2006, 3, :o3, 1143223200
tz.transition 2006, 9, :o2, 1159549200
tz.transition 2015, 3, :o3, 1427479200
tz.transition 2015, 9, :o2, 1443193200
tz.transition 2016, 3, :o3, 1458928800
tz.transition 2016, 9, :o2, 1474642800
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Seoul.rb | lib/tzinfo/data/definitions/Asia/Seoul.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Seoul
include TimezoneDefinition
timezone 'Asia/Seoul' do |tz|
tz.offset :o0, 30472, 0, :LMT
tz.offset :o1, 30600, 0, :KST
tz.offset :o2, 32400, 0, :JST
tz.offset :o3, 32400, 0, :KST
tz.offset :o4, 32400, 3600, :KDT
tz.offset :o5, 30600, 3600, :KDT
tz.transition 1908, 3, :o1, -1948782472, 26114747191, 10800
tz.transition 1911, 12, :o2, -1830414600, 116131303, 48
tz.transition 1945, 9, :o3, -767350800, 19453649, 8
tz.transition 1948, 5, :o4, -681210000, 19461625, 8
tz.transition 1948, 9, :o3, -672228000, 29193685, 12
tz.transition 1949, 4, :o4, -654771600, 19464073, 8
tz.transition 1949, 9, :o3, -640864800, 29198041, 12
tz.transition 1950, 3, :o4, -623408400, 19466977, 8
tz.transition 1950, 9, :o3, -609415200, 29202409, 12
tz.transition 1951, 5, :o4, -588848400, 19470177, 8
tz.transition 1951, 9, :o3, -577965600, 29206777, 12
tz.transition 1954, 3, :o1, -498128400, 19478577, 8
tz.transition 1955, 5, :o5, -462702600, 116891143, 48
tz.transition 1955, 9, :o1, -451733400, 116897237, 48
tz.transition 1956, 5, :o5, -429784200, 116909431, 48
tz.transition 1956, 9, :o1, -418296600, 116915813, 48
tz.transition 1957, 5, :o5, -399544200, 116926231, 48
tz.transition 1957, 9, :o1, -387451800, 116932949, 48
tz.transition 1958, 5, :o5, -368094600, 116943703, 48
tz.transition 1958, 9, :o1, -356002200, 116950421, 48
tz.transition 1959, 5, :o5, -336645000, 116961175, 48
tz.transition 1959, 9, :o1, -324552600, 116967893, 48
tz.transition 1960, 4, :o5, -305195400, 116978647, 48
tz.transition 1960, 9, :o1, -293103000, 116985365, 48
tz.transition 1961, 8, :o3, -264933000, 117001015, 48
tz.transition 1987, 5, :o4, 547578000
tz.transition 1987, 10, :o3, 560883600
tz.transition 1988, 5, :o4, 579027600
tz.transition 1988, 10, :o3, 592333200
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Yekaterinburg.rb | lib/tzinfo/data/definitions/Asia/Yekaterinburg.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Yekaterinburg
include TimezoneDefinition
timezone 'Asia/Yekaterinburg' do |tz|
tz.offset :o0, 14553, 0, :LMT
tz.offset :o1, 13505, 0, :PMT
tz.offset :o2, 14400, 0, :'+04'
tz.offset :o3, 18000, 0, :'+05'
tz.offset :o4, 18000, 3600, :'+06'
tz.offset :o5, 14400, 3600, :'+05'
tz.offset :o6, 21600, 0, :'+06'
tz.transition 1916, 7, :o1, -1688270553, 7747351461, 3200
tz.transition 1919, 7, :o2, -1592610305, 41854829939, 17280
tz.transition 1930, 6, :o3, -1247544000, 7278445, 3
tz.transition 1981, 3, :o4, 354913200
tz.transition 1981, 9, :o3, 370720800
tz.transition 1982, 3, :o4, 386449200
tz.transition 1982, 9, :o3, 402256800
tz.transition 1983, 3, :o4, 417985200
tz.transition 1983, 9, :o3, 433792800
tz.transition 1984, 3, :o4, 449607600
tz.transition 1984, 9, :o3, 465339600
tz.transition 1985, 3, :o4, 481064400
tz.transition 1985, 9, :o3, 496789200
tz.transition 1986, 3, :o4, 512514000
tz.transition 1986, 9, :o3, 528238800
tz.transition 1987, 3, :o4, 543963600
tz.transition 1987, 9, :o3, 559688400
tz.transition 1988, 3, :o4, 575413200
tz.transition 1988, 9, :o3, 591138000
tz.transition 1989, 3, :o4, 606862800
tz.transition 1989, 9, :o3, 622587600
tz.transition 1990, 3, :o4, 638312400
tz.transition 1990, 9, :o3, 654642000
tz.transition 1991, 3, :o5, 670366800
tz.transition 1991, 9, :o2, 686095200
tz.transition 1992, 1, :o3, 695772000
tz.transition 1992, 3, :o4, 701816400
tz.transition 1992, 9, :o3, 717541200
tz.transition 1993, 3, :o4, 733266000
tz.transition 1993, 9, :o3, 748990800
tz.transition 1994, 3, :o4, 764715600
tz.transition 1994, 9, :o3, 780440400
tz.transition 1995, 3, :o4, 796165200
tz.transition 1995, 9, :o3, 811890000
tz.transition 1996, 3, :o4, 828219600
tz.transition 1996, 10, :o3, 846363600
tz.transition 1997, 3, :o4, 859669200
tz.transition 1997, 10, :o3, 877813200
tz.transition 1998, 3, :o4, 891118800
tz.transition 1998, 10, :o3, 909262800
tz.transition 1999, 3, :o4, 922568400
tz.transition 1999, 10, :o3, 941317200
tz.transition 2000, 3, :o4, 954018000
tz.transition 2000, 10, :o3, 972766800
tz.transition 2001, 3, :o4, 985467600
tz.transition 2001, 10, :o3, 1004216400
tz.transition 2002, 3, :o4, 1017522000
tz.transition 2002, 10, :o3, 1035666000
tz.transition 2003, 3, :o4, 1048971600
tz.transition 2003, 10, :o3, 1067115600
tz.transition 2004, 3, :o4, 1080421200
tz.transition 2004, 10, :o3, 1099170000
tz.transition 2005, 3, :o4, 1111870800
tz.transition 2005, 10, :o3, 1130619600
tz.transition 2006, 3, :o4, 1143320400
tz.transition 2006, 10, :o3, 1162069200
tz.transition 2007, 3, :o4, 1174770000
tz.transition 2007, 10, :o3, 1193518800
tz.transition 2008, 3, :o4, 1206824400
tz.transition 2008, 10, :o3, 1224968400
tz.transition 2009, 3, :o4, 1238274000
tz.transition 2009, 10, :o3, 1256418000
tz.transition 2010, 3, :o4, 1269723600
tz.transition 2010, 10, :o3, 1288472400
tz.transition 2011, 3, :o6, 1301173200
tz.transition 2014, 10, :o3, 1414267200
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Istanbul.rb | lib/tzinfo/data/definitions/Asia/Istanbul.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Istanbul
include TimezoneDefinition
linked_timezone 'Asia/Istanbul', 'Europe/Istanbul'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Qyzylorda.rb | lib/tzinfo/data/definitions/Asia/Qyzylorda.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Qyzylorda
include TimezoneDefinition
timezone 'Asia/Qyzylorda' do |tz|
tz.offset :o0, 15712, 0, :LMT
tz.offset :o1, 14400, 0, :'+04'
tz.offset :o2, 18000, 0, :'+05'
tz.offset :o3, 18000, 3600, :'+06'
tz.offset :o4, 21600, 0, :'+06'
tz.offset :o5, 14400, 3600, :'+05'
tz.transition 1924, 5, :o1, -1441167712, 6544549759, 2700
tz.transition 1930, 6, :o2, -1247544000, 7278445, 3
tz.transition 1981, 3, :o3, 354913200
tz.transition 1981, 9, :o4, 370720800
tz.transition 1982, 3, :o3, 386445600
tz.transition 1982, 9, :o2, 402256800
tz.transition 1983, 3, :o3, 417985200
tz.transition 1983, 9, :o2, 433792800
tz.transition 1984, 3, :o3, 449607600
tz.transition 1984, 9, :o2, 465339600
tz.transition 1985, 3, :o3, 481064400
tz.transition 1985, 9, :o2, 496789200
tz.transition 1986, 3, :o3, 512514000
tz.transition 1986, 9, :o2, 528238800
tz.transition 1987, 3, :o3, 543963600
tz.transition 1987, 9, :o2, 559688400
tz.transition 1988, 3, :o3, 575413200
tz.transition 1988, 9, :o2, 591138000
tz.transition 1989, 3, :o3, 606862800
tz.transition 1989, 9, :o2, 622587600
tz.transition 1990, 3, :o3, 638312400
tz.transition 1990, 9, :o2, 654642000
tz.transition 1991, 3, :o5, 670366800
tz.transition 1991, 9, :o2, 686095200
tz.transition 1992, 1, :o4, 695768400
tz.transition 1992, 3, :o3, 701812800
tz.transition 1992, 9, :o2, 717541200
tz.transition 1993, 3, :o3, 733266000
tz.transition 1993, 9, :o2, 748990800
tz.transition 1994, 3, :o3, 764715600
tz.transition 1994, 9, :o2, 780440400
tz.transition 1995, 3, :o3, 796165200
tz.transition 1995, 9, :o2, 811890000
tz.transition 1996, 3, :o3, 828219600
tz.transition 1996, 10, :o2, 846363600
tz.transition 1997, 3, :o3, 859669200
tz.transition 1997, 10, :o2, 877813200
tz.transition 1998, 3, :o3, 891118800
tz.transition 1998, 10, :o2, 909262800
tz.transition 1999, 3, :o3, 922568400
tz.transition 1999, 10, :o2, 941317200
tz.transition 2000, 3, :o3, 954018000
tz.transition 2000, 10, :o2, 972766800
tz.transition 2001, 3, :o3, 985467600
tz.transition 2001, 10, :o2, 1004216400
tz.transition 2002, 3, :o3, 1017522000
tz.transition 2002, 10, :o2, 1035666000
tz.transition 2003, 3, :o3, 1048971600
tz.transition 2003, 10, :o2, 1067115600
tz.transition 2004, 3, :o3, 1080421200
tz.transition 2004, 10, :o4, 1099170000
tz.transition 2018, 12, :o2, 1545328800
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Tashkent.rb | lib/tzinfo/data/definitions/Asia/Tashkent.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Tashkent
include TimezoneDefinition
timezone 'Asia/Tashkent' do |tz|
tz.offset :o0, 16631, 0, :LMT
tz.offset :o1, 18000, 0, :'+05'
tz.offset :o2, 21600, 0, :'+06'
tz.offset :o3, 21600, 3600, :'+07'
tz.offset :o4, 18000, 3600, :'+06'
tz.transition 1924, 5, :o1, -1441168631, 209425591369, 86400
tz.transition 1930, 6, :o2, -1247547600, 58227559, 24
tz.transition 1981, 3, :o3, 354909600
tz.transition 1981, 9, :o2, 370717200
tz.transition 1982, 3, :o3, 386445600
tz.transition 1982, 9, :o2, 402253200
tz.transition 1983, 3, :o3, 417981600
tz.transition 1983, 9, :o2, 433789200
tz.transition 1984, 3, :o3, 449604000
tz.transition 1984, 9, :o2, 465336000
tz.transition 1985, 3, :o3, 481060800
tz.transition 1985, 9, :o2, 496785600
tz.transition 1986, 3, :o3, 512510400
tz.transition 1986, 9, :o2, 528235200
tz.transition 1987, 3, :o3, 543960000
tz.transition 1987, 9, :o2, 559684800
tz.transition 1988, 3, :o3, 575409600
tz.transition 1988, 9, :o2, 591134400
tz.transition 1989, 3, :o3, 606859200
tz.transition 1989, 9, :o2, 622584000
tz.transition 1990, 3, :o3, 638308800
tz.transition 1990, 9, :o2, 654638400
tz.transition 1991, 3, :o4, 670363200
tz.transition 1991, 9, :o1, 686091600
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Riyadh.rb | lib/tzinfo/data/definitions/Asia/Riyadh.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Riyadh
include TimezoneDefinition
timezone 'Asia/Riyadh' do |tz|
tz.offset :o0, 11212, 0, :LMT
tz.offset :o1, 10800, 0, :'+03'
tz.transition 1947, 3, :o1, -719636812, 52536780797, 21600
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Ujung_Pandang.rb | lib/tzinfo/data/definitions/Asia/Ujung_Pandang.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Ujung_Pandang
include TimezoneDefinition
linked_timezone 'Asia/Ujung_Pandang', 'Asia/Makassar'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Ho_Chi_Minh.rb | lib/tzinfo/data/definitions/Asia/Ho_Chi_Minh.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Ho_Chi_Minh
include TimezoneDefinition
timezone 'Asia/Ho_Chi_Minh' do |tz|
tz.offset :o0, 25590, 0, :LMT
tz.offset :o1, 25590, 0, :PLMT
tz.offset :o2, 25200, 0, :'+07'
tz.offset :o3, 28800, 0, :'+08'
tz.offset :o4, 32400, 0, :'+09'
tz.transition 1906, 6, :o1, -2004073590, 6962089547, 2880
tz.transition 1911, 4, :o2, -1851577590, 6967172747, 2880
tz.transition 1942, 12, :o3, -852105600, 14584351, 6
tz.transition 1945, 3, :o4, -782643600, 19452233, 8
tz.transition 1945, 9, :o2, -767869200, 19453601, 8
tz.transition 1947, 3, :o3, -718095600, 58374629, 24
tz.transition 1955, 6, :o2, -457772400, 58446941, 24
tz.transition 1959, 12, :o3, -315648000, 14621605, 6
tz.transition 1975, 6, :o2, 171820800
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Katmandu.rb | lib/tzinfo/data/definitions/Asia/Katmandu.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Katmandu
include TimezoneDefinition
linked_timezone 'Asia/Katmandu', 'Asia/Kathmandu'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Almaty.rb | lib/tzinfo/data/definitions/Asia/Almaty.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Almaty
include TimezoneDefinition
timezone 'Asia/Almaty' do |tz|
tz.offset :o0, 18468, 0, :LMT
tz.offset :o1, 18000, 0, :'+05'
tz.offset :o2, 21600, 0, :'+06'
tz.offset :o3, 21600, 3600, :'+07'
tz.offset :o4, 18000, 3600, :'+06'
tz.transition 1924, 5, :o1, -1441170468, 1939125829, 800
tz.transition 1930, 6, :o2, -1247547600, 58227559, 24
tz.transition 1981, 3, :o3, 354909600
tz.transition 1981, 9, :o2, 370717200
tz.transition 1982, 3, :o3, 386445600
tz.transition 1982, 9, :o2, 402253200
tz.transition 1983, 3, :o3, 417981600
tz.transition 1983, 9, :o2, 433789200
tz.transition 1984, 3, :o3, 449604000
tz.transition 1984, 9, :o2, 465336000
tz.transition 1985, 3, :o3, 481060800
tz.transition 1985, 9, :o2, 496785600
tz.transition 1986, 3, :o3, 512510400
tz.transition 1986, 9, :o2, 528235200
tz.transition 1987, 3, :o3, 543960000
tz.transition 1987, 9, :o2, 559684800
tz.transition 1988, 3, :o3, 575409600
tz.transition 1988, 9, :o2, 591134400
tz.transition 1989, 3, :o3, 606859200
tz.transition 1989, 9, :o2, 622584000
tz.transition 1990, 3, :o3, 638308800
tz.transition 1990, 9, :o2, 654638400
tz.transition 1991, 3, :o4, 670363200
tz.transition 1991, 9, :o1, 686091600
tz.transition 1992, 1, :o2, 695768400
tz.transition 1992, 3, :o3, 701812800
tz.transition 1992, 9, :o2, 717537600
tz.transition 1993, 3, :o3, 733262400
tz.transition 1993, 9, :o2, 748987200
tz.transition 1994, 3, :o3, 764712000
tz.transition 1994, 9, :o2, 780436800
tz.transition 1995, 3, :o3, 796161600
tz.transition 1995, 9, :o2, 811886400
tz.transition 1996, 3, :o3, 828216000
tz.transition 1996, 10, :o2, 846360000
tz.transition 1997, 3, :o3, 859665600
tz.transition 1997, 10, :o2, 877809600
tz.transition 1998, 3, :o3, 891115200
tz.transition 1998, 10, :o2, 909259200
tz.transition 1999, 3, :o3, 922564800
tz.transition 1999, 10, :o2, 941313600
tz.transition 2000, 3, :o3, 954014400
tz.transition 2000, 10, :o2, 972763200
tz.transition 2001, 3, :o3, 985464000
tz.transition 2001, 10, :o2, 1004212800
tz.transition 2002, 3, :o3, 1017518400
tz.transition 2002, 10, :o2, 1035662400
tz.transition 2003, 3, :o3, 1048968000
tz.transition 2003, 10, :o2, 1067112000
tz.transition 2004, 3, :o3, 1080417600
tz.transition 2004, 10, :o2, 1099166400
tz.transition 2024, 2, :o1, 1709229600
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Yerevan.rb | lib/tzinfo/data/definitions/Asia/Yerevan.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Yerevan
include TimezoneDefinition
timezone 'Asia/Yerevan' do |tz|
tz.offset :o0, 10680, 0, :LMT
tz.offset :o1, 10800, 0, :'+03'
tz.offset :o2, 14400, 0, :'+04'
tz.offset :o3, 14400, 3600, :'+05'
tz.offset :o4, 10800, 3600, :'+04'
tz.transition 1924, 5, :o1, -1441162680, 1745213311, 720
tz.transition 1957, 2, :o2, -405140400, 19487187, 8
tz.transition 1981, 3, :o3, 354916800
tz.transition 1981, 9, :o2, 370724400
tz.transition 1982, 3, :o3, 386452800
tz.transition 1982, 9, :o2, 402260400
tz.transition 1983, 3, :o3, 417988800
tz.transition 1983, 9, :o2, 433796400
tz.transition 1984, 3, :o3, 449611200
tz.transition 1984, 9, :o2, 465343200
tz.transition 1985, 3, :o3, 481068000
tz.transition 1985, 9, :o2, 496792800
tz.transition 1986, 3, :o3, 512517600
tz.transition 1986, 9, :o2, 528242400
tz.transition 1987, 3, :o3, 543967200
tz.transition 1987, 9, :o2, 559692000
tz.transition 1988, 3, :o3, 575416800
tz.transition 1988, 9, :o2, 591141600
tz.transition 1989, 3, :o3, 606866400
tz.transition 1989, 9, :o2, 622591200
tz.transition 1990, 3, :o3, 638316000
tz.transition 1990, 9, :o2, 654645600
tz.transition 1991, 3, :o4, 670370400
tz.transition 1991, 9, :o1, 686098800
tz.transition 1992, 3, :o4, 701823600
tz.transition 1992, 9, :o1, 717548400
tz.transition 1993, 3, :o4, 733273200
tz.transition 1993, 9, :o1, 748998000
tz.transition 1994, 3, :o4, 764722800
tz.transition 1994, 9, :o1, 780447600
tz.transition 1995, 3, :o4, 796172400
tz.transition 1995, 9, :o2, 811897200
tz.transition 1997, 3, :o3, 859672800
tz.transition 1997, 10, :o2, 877816800
tz.transition 1998, 3, :o3, 891122400
tz.transition 1998, 10, :o2, 909266400
tz.transition 1999, 3, :o3, 922572000
tz.transition 1999, 10, :o2, 941320800
tz.transition 2000, 3, :o3, 954021600
tz.transition 2000, 10, :o2, 972770400
tz.transition 2001, 3, :o3, 985471200
tz.transition 2001, 10, :o2, 1004220000
tz.transition 2002, 3, :o3, 1017525600
tz.transition 2002, 10, :o2, 1035669600
tz.transition 2003, 3, :o3, 1048975200
tz.transition 2003, 10, :o2, 1067119200
tz.transition 2004, 3, :o3, 1080424800
tz.transition 2004, 10, :o2, 1099173600
tz.transition 2005, 3, :o3, 1111874400
tz.transition 2005, 10, :o2, 1130623200
tz.transition 2006, 3, :o3, 1143324000
tz.transition 2006, 10, :o2, 1162072800
tz.transition 2007, 3, :o3, 1174773600
tz.transition 2007, 10, :o2, 1193522400
tz.transition 2008, 3, :o3, 1206828000
tz.transition 2008, 10, :o2, 1224972000
tz.transition 2009, 3, :o3, 1238277600
tz.transition 2009, 10, :o2, 1256421600
tz.transition 2010, 3, :o3, 1269727200
tz.transition 2010, 10, :o2, 1288476000
tz.transition 2011, 3, :o3, 1301176800
tz.transition 2011, 10, :o2, 1319925600
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Bahrain.rb | lib/tzinfo/data/definitions/Asia/Bahrain.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Bahrain
include TimezoneDefinition
linked_timezone 'Asia/Bahrain', 'Asia/Qatar'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Beirut.rb | lib/tzinfo/data/definitions/Asia/Beirut.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Beirut
include TimezoneDefinition
timezone 'Asia/Beirut' do |tz|
tz.offset :o0, 8520, 0, :LMT
tz.offset :o1, 7200, 0, :EET
tz.offset :o2, 7200, 3600, :EEST
tz.transition 1879, 12, :o1, -2840149320, 1733555089, 720
tz.transition 1920, 3, :o2, -1570413600, 29068937, 12
tz.transition 1920, 10, :o1, -1552186800, 19380979, 8
tz.transition 1921, 4, :o2, -1538359200, 29073389, 12
tz.transition 1921, 10, :o1, -1522551600, 19383723, 8
tz.transition 1922, 3, :o2, -1507514400, 29077673, 12
tz.transition 1922, 10, :o1, -1490583600, 19386683, 8
tz.transition 1923, 4, :o2, -1473645600, 29082377, 12
tz.transition 1923, 9, :o1, -1460948400, 19389427, 8
tz.transition 1957, 4, :o2, -399866400, 29231513, 12
tz.transition 1957, 9, :o1, -386650800, 19488899, 8
tz.transition 1958, 4, :o2, -368330400, 29235893, 12
tz.transition 1958, 9, :o1, -355114800, 19491819, 8
tz.transition 1959, 4, :o2, -336794400, 29240273, 12
tz.transition 1959, 9, :o1, -323578800, 19494739, 8
tz.transition 1960, 4, :o2, -305172000, 29244665, 12
tz.transition 1960, 9, :o1, -291956400, 19497667, 8
tz.transition 1961, 4, :o2, -273636000, 29249045, 12
tz.transition 1961, 9, :o1, -260420400, 19500587, 8
tz.transition 1972, 6, :o2, 78012000
tz.transition 1972, 9, :o1, 86734800
tz.transition 1973, 4, :o2, 105055200
tz.transition 1973, 9, :o1, 118270800
tz.transition 1974, 4, :o2, 136591200
tz.transition 1974, 9, :o1, 149806800
tz.transition 1975, 4, :o2, 168127200
tz.transition 1975, 9, :o1, 181342800
tz.transition 1976, 4, :o2, 199749600
tz.transition 1976, 9, :o1, 212965200
tz.transition 1977, 4, :o2, 231285600
tz.transition 1977, 9, :o1, 244501200
tz.transition 1978, 4, :o2, 262735200
tz.transition 1978, 9, :o1, 275950800
tz.transition 1984, 4, :o2, 452210400
tz.transition 1984, 10, :o1, 466722000
tz.transition 1985, 4, :o2, 483746400
tz.transition 1985, 10, :o1, 498258000
tz.transition 1986, 4, :o2, 515282400
tz.transition 1986, 10, :o1, 529794000
tz.transition 1987, 4, :o2, 546818400
tz.transition 1987, 10, :o1, 561330000
tz.transition 1988, 5, :o2, 581119200
tz.transition 1988, 10, :o1, 592952400
tz.transition 1989, 5, :o2, 610754400
tz.transition 1989, 10, :o1, 624488400
tz.transition 1990, 4, :o2, 641512800
tz.transition 1990, 10, :o1, 656024400
tz.transition 1991, 4, :o2, 673048800
tz.transition 1991, 10, :o1, 687560400
tz.transition 1992, 4, :o2, 704671200
tz.transition 1992, 10, :o1, 718146000
tz.transition 1993, 3, :o2, 733269600
tz.transition 1993, 9, :o1, 748990800
tz.transition 1994, 3, :o2, 764719200
tz.transition 1994, 9, :o1, 780440400
tz.transition 1995, 3, :o2, 796168800
tz.transition 1995, 9, :o1, 811890000
tz.transition 1996, 3, :o2, 828223200
tz.transition 1996, 9, :o1, 843944400
tz.transition 1997, 3, :o2, 859672800
tz.transition 1997, 9, :o1, 875394000
tz.transition 1998, 3, :o2, 891122400
tz.transition 1998, 9, :o1, 906843600
tz.transition 1999, 3, :o2, 922572000
tz.transition 1999, 10, :o1, 941317200
tz.transition 2000, 3, :o2, 954021600
tz.transition 2000, 10, :o1, 972766800
tz.transition 2001, 3, :o2, 985471200
tz.transition 2001, 10, :o1, 1004216400
tz.transition 2002, 3, :o2, 1017525600
tz.transition 2002, 10, :o1, 1035666000
tz.transition 2003, 3, :o2, 1048975200
tz.transition 2003, 10, :o1, 1067115600
tz.transition 2004, 3, :o2, 1080424800
tz.transition 2004, 10, :o1, 1099170000
tz.transition 2005, 3, :o2, 1111874400
tz.transition 2005, 10, :o1, 1130619600
tz.transition 2006, 3, :o2, 1143324000
tz.transition 2006, 10, :o1, 1162069200
tz.transition 2007, 3, :o2, 1174773600
tz.transition 2007, 10, :o1, 1193518800
tz.transition 2008, 3, :o2, 1206828000
tz.transition 2008, 10, :o1, 1224968400
tz.transition 2009, 3, :o2, 1238277600
tz.transition 2009, 10, :o1, 1256418000
tz.transition 2010, 3, :o2, 1269727200
tz.transition 2010, 10, :o1, 1288472400
tz.transition 2011, 3, :o2, 1301176800
tz.transition 2011, 10, :o1, 1319922000
tz.transition 2012, 3, :o2, 1332626400
tz.transition 2012, 10, :o1, 1351371600
tz.transition 2013, 3, :o2, 1364680800
tz.transition 2013, 10, :o1, 1382821200
tz.transition 2014, 3, :o2, 1396130400
tz.transition 2014, 10, :o1, 1414270800
tz.transition 2015, 3, :o2, 1427580000
tz.transition 2015, 10, :o1, 1445720400
tz.transition 2016, 3, :o2, 1459029600
tz.transition 2016, 10, :o1, 1477774800
tz.transition 2017, 3, :o2, 1490479200
tz.transition 2017, 10, :o1, 1509224400
tz.transition 2018, 3, :o2, 1521928800
tz.transition 2018, 10, :o1, 1540674000
tz.transition 2019, 3, :o2, 1553983200
tz.transition 2019, 10, :o1, 1572123600
tz.transition 2020, 3, :o2, 1585432800
tz.transition 2020, 10, :o1, 1603573200
tz.transition 2021, 3, :o2, 1616882400
tz.transition 2021, 10, :o1, 1635627600
tz.transition 2022, 3, :o2, 1648332000
tz.transition 2022, 10, :o1, 1667077200
tz.transition 2023, 3, :o2, 1679781600
tz.transition 2023, 10, :o1, 1698526800
tz.transition 2024, 3, :o2, 1711836000
tz.transition 2024, 10, :o1, 1729976400
tz.transition 2025, 3, :o2, 1743285600
tz.transition 2025, 10, :o1, 1761426000
tz.transition 2026, 3, :o2, 1774735200
tz.transition 2026, 10, :o1, 1792875600
tz.transition 2027, 3, :o2, 1806184800
tz.transition 2027, 10, :o1, 1824930000
tz.transition 2028, 3, :o2, 1837634400
tz.transition 2028, 10, :o1, 1856379600
tz.transition 2029, 3, :o2, 1869084000
tz.transition 2029, 10, :o1, 1887829200
tz.transition 2030, 3, :o2, 1901138400
tz.transition 2030, 10, :o1, 1919278800
tz.transition 2031, 3, :o2, 1932588000
tz.transition 2031, 10, :o1, 1950728400
tz.transition 2032, 3, :o2, 1964037600
tz.transition 2032, 10, :o1, 1982782800
tz.transition 2033, 3, :o2, 1995487200
tz.transition 2033, 10, :o1, 2014232400
tz.transition 2034, 3, :o2, 2026936800
tz.transition 2034, 10, :o1, 2045682000
tz.transition 2035, 3, :o2, 2058386400
tz.transition 2035, 10, :o1, 2077131600
tz.transition 2036, 3, :o2, 2090440800
tz.transition 2036, 10, :o1, 2108581200
tz.transition 2037, 3, :o2, 2121890400
tz.transition 2037, 10, :o1, 2140030800
tz.transition 2038, 3, :o2, 2153340000, 29586125, 12
tz.transition 2038, 10, :o1, 2172085200, 19725819, 8
tz.transition 2039, 3, :o2, 2184789600, 29590493, 12
tz.transition 2039, 10, :o1, 2203534800, 19728731, 8
tz.transition 2040, 3, :o2, 2216239200, 29594861, 12
tz.transition 2040, 10, :o1, 2234984400, 19731643, 8
tz.transition 2041, 3, :o2, 2248293600, 29599313, 12
tz.transition 2041, 10, :o1, 2266434000, 19734555, 8
tz.transition 2042, 3, :o2, 2279743200, 29603681, 12
tz.transition 2042, 10, :o1, 2297883600, 19737467, 8
tz.transition 2043, 3, :o2, 2311192800, 29608049, 12
tz.transition 2043, 10, :o1, 2329333200, 19740379, 8
tz.transition 2044, 3, :o2, 2342642400, 29612417, 12
tz.transition 2044, 10, :o1, 2361387600, 19743347, 8
tz.transition 2045, 3, :o2, 2374092000, 29616785, 12
tz.transition 2045, 10, :o1, 2392837200, 19746259, 8
tz.transition 2046, 3, :o2, 2405541600, 29621153, 12
tz.transition 2046, 10, :o1, 2424286800, 19749171, 8
tz.transition 2047, 3, :o2, 2437596000, 29625605, 12
tz.transition 2047, 10, :o1, 2455736400, 19752083, 8
tz.transition 2048, 3, :o2, 2469045600, 29629973, 12
tz.transition 2048, 10, :o1, 2487186000, 19754995, 8
tz.transition 2049, 3, :o2, 2500495200, 29634341, 12
tz.transition 2049, 10, :o1, 2519240400, 19757963, 8
tz.transition 2050, 3, :o2, 2531944800, 29638709, 12
tz.transition 2050, 10, :o1, 2550690000, 19760875, 8
tz.transition 2051, 3, :o2, 2563394400, 29643077, 12
tz.transition 2051, 10, :o1, 2582139600, 19763787, 8
tz.transition 2052, 3, :o2, 2595448800, 29647529, 12
tz.transition 2052, 10, :o1, 2613589200, 19766699, 8
tz.transition 2053, 3, :o2, 2626898400, 29651897, 12
tz.transition 2053, 10, :o1, 2645038800, 19769611, 8
tz.transition 2054, 3, :o2, 2658348000, 29656265, 12
tz.transition 2054, 10, :o1, 2676488400, 19772523, 8
tz.transition 2055, 3, :o2, 2689797600, 29660633, 12
tz.transition 2055, 10, :o1, 2708542800, 19775491, 8
tz.transition 2056, 3, :o2, 2721247200, 29665001, 12
tz.transition 2056, 10, :o1, 2739992400, 19778403, 8
tz.transition 2057, 3, :o2, 2752696800, 29669369, 12
tz.transition 2057, 10, :o1, 2771442000, 19781315, 8
tz.transition 2058, 3, :o2, 2784751200, 29673821, 12
tz.transition 2058, 10, :o1, 2802891600, 19784227, 8
tz.transition 2059, 3, :o2, 2816200800, 29678189, 12
tz.transition 2059, 10, :o1, 2834341200, 19787139, 8
tz.transition 2060, 3, :o2, 2847650400, 29682557, 12
tz.transition 2060, 10, :o1, 2866395600, 19790107, 8
tz.transition 2061, 3, :o2, 2879100000, 29686925, 12
tz.transition 2061, 10, :o1, 2897845200, 19793019, 8
tz.transition 2062, 3, :o2, 2910549600, 29691293, 12
tz.transition 2062, 10, :o1, 2929294800, 19795931, 8
tz.transition 2063, 3, :o2, 2941999200, 29695661, 12
tz.transition 2063, 10, :o1, 2960744400, 19798843, 8
tz.transition 2064, 3, :o2, 2974053600, 29700113, 12
tz.transition 2064, 10, :o1, 2992194000, 19801755, 8
tz.transition 2065, 3, :o2, 3005503200, 29704481, 12
tz.transition 2065, 10, :o1, 3023643600, 19804667, 8
tz.transition 2066, 3, :o2, 3036952800, 29708849, 12
tz.transition 2066, 10, :o1, 3055698000, 19807635, 8
tz.transition 2067, 3, :o2, 3068402400, 29713217, 12
tz.transition 2067, 10, :o1, 3087147600, 19810547, 8
tz.transition 2068, 3, :o2, 3099852000, 29717585, 12
tz.transition 2068, 10, :o1, 3118597200, 19813459, 8
tz.transition 2069, 3, :o2, 3131906400, 29722037, 12
tz.transition 2069, 10, :o1, 3150046800, 19816371, 8
tz.transition 2070, 3, :o2, 3163356000, 29726405, 12
tz.transition 2070, 10, :o1, 3181496400, 19819283, 8
tz.transition 2071, 3, :o2, 3194805600, 29730773, 12
tz.transition 2071, 10, :o1, 3212946000, 19822195, 8
tz.transition 2072, 3, :o2, 3226255200, 29735141, 12
tz.transition 2072, 10, :o1, 3245000400, 19825163, 8
tz.transition 2073, 3, :o2, 3257704800, 29739509, 12
tz.transition 2073, 10, :o1, 3276450000, 19828075, 8
tz.transition 2074, 3, :o2, 3289154400, 29743877, 12
tz.transition 2074, 10, :o1, 3307899600, 19830987, 8
tz.transition 2075, 3, :o2, 3321208800, 29748329, 12
tz.transition 2075, 10, :o1, 3339349200, 19833899, 8
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Kuwait.rb | lib/tzinfo/data/definitions/Asia/Kuwait.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Kuwait
include TimezoneDefinition
linked_timezone 'Asia/Kuwait', 'Asia/Riyadh'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Calcutta.rb | lib/tzinfo/data/definitions/Asia/Calcutta.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Calcutta
include TimezoneDefinition
linked_timezone 'Asia/Calcutta', 'Asia/Kolkata'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Kashgar.rb | lib/tzinfo/data/definitions/Asia/Kashgar.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Kashgar
include TimezoneDefinition
linked_timezone 'Asia/Kashgar', 'Asia/Urumqi'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Chongqing.rb | lib/tzinfo/data/definitions/Asia/Chongqing.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Chongqing
include TimezoneDefinition
linked_timezone 'Asia/Chongqing', 'Asia/Shanghai'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Hong_Kong.rb | lib/tzinfo/data/definitions/Asia/Hong_Kong.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Hong_Kong
include TimezoneDefinition
timezone 'Asia/Hong_Kong' do |tz|
tz.offset :o0, 27402, 0, :LMT
tz.offset :o1, 28800, 0, :HKT
tz.offset :o2, 28800, 3600, :HKST
tz.offset :o3, 28800, 1800, :HKWT
tz.offset :o4, 32400, 0, :JST
tz.transition 1904, 10, :o1, -2056690800, 58002797, 24
tz.transition 1941, 6, :o2, -900910800, 58323847, 24
tz.transition 1941, 9, :o3, -891579600, 58326439, 24
tz.transition 1941, 12, :o4, -884248200, 116656951, 48
tz.transition 1945, 11, :o1, -761209200, 58362653, 24
tz.transition 1946, 4, :o2, -747907200, 14591587, 6
tz.transition 1946, 11, :o1, -728541000, 38914485, 16
tz.transition 1947, 4, :o2, -717049800, 38916613, 16
tz.transition 1947, 11, :o1, -697091400, 38920309, 16
tz.transition 1948, 5, :o2, -683785800, 38922773, 16
tz.transition 1948, 10, :o1, -668061000, 38925685, 16
tz.transition 1949, 4, :o2, -654755400, 38928149, 16
tz.transition 1949, 10, :o1, -636611400, 38931509, 16
tz.transition 1950, 4, :o2, -623305800, 38933973, 16
tz.transition 1950, 10, :o1, -605161800, 38937333, 16
tz.transition 1951, 3, :o2, -591856200, 38939797, 16
tz.transition 1951, 10, :o1, -573712200, 38943157, 16
tz.transition 1952, 4, :o2, -559801800, 38945733, 16
tz.transition 1952, 11, :o1, -541657800, 38949093, 16
tz.transition 1953, 4, :o2, -528352200, 38951557, 16
tz.transition 1953, 10, :o1, -510211800, 116864749, 48
tz.transition 1954, 3, :o2, -498112200, 38957157, 16
tz.transition 1954, 10, :o1, -478762200, 116882221, 48
tz.transition 1955, 3, :o2, -466662600, 38962981, 16
tz.transition 1955, 11, :o1, -446707800, 116900029, 48
tz.transition 1956, 3, :o2, -435213000, 38968805, 16
tz.transition 1956, 11, :o1, -415258200, 116917501, 48
tz.transition 1957, 3, :o2, -403158600, 38974741, 16
tz.transition 1957, 11, :o1, -383808600, 116934973, 48
tz.transition 1958, 3, :o2, -371709000, 38980565, 16
tz.transition 1958, 11, :o1, -352359000, 116952445, 48
tz.transition 1959, 3, :o2, -340259400, 38986389, 16
tz.transition 1959, 10, :o1, -320909400, 116969917, 48
tz.transition 1960, 3, :o2, -308809800, 38992213, 16
tz.transition 1960, 11, :o1, -288855000, 116987725, 48
tz.transition 1961, 3, :o2, -277360200, 38998037, 16
tz.transition 1961, 11, :o1, -257405400, 117005197, 48
tz.transition 1962, 3, :o2, -245910600, 39003861, 16
tz.transition 1962, 11, :o1, -225955800, 117022669, 48
tz.transition 1963, 3, :o2, -213856200, 39009797, 16
tz.transition 1963, 11, :o1, -194506200, 117040141, 48
tz.transition 1964, 3, :o2, -182406600, 39015621, 16
tz.transition 1964, 10, :o1, -163056600, 117057613, 48
tz.transition 1965, 4, :o2, -148537800, 39021893, 16
tz.transition 1965, 10, :o1, -132816600, 117074413, 48
tz.transition 1966, 4, :o2, -117088200, 39027717, 16
tz.transition 1966, 10, :o1, -101367000, 117091885, 48
tz.transition 1967, 4, :o2, -85638600, 39033541, 16
tz.transition 1967, 10, :o1, -69312600, 117109693, 48
tz.transition 1968, 4, :o2, -53584200, 39039477, 16
tz.transition 1968, 10, :o1, -37863000, 117127165, 48
tz.transition 1969, 4, :o2, -22134600, 39045301, 16
tz.transition 1969, 10, :o1, -6413400, 117144637, 48
tz.transition 1970, 4, :o2, 9315000
tz.transition 1970, 10, :o1, 25036200
tz.transition 1971, 4, :o2, 40764600
tz.transition 1971, 10, :o1, 56485800
tz.transition 1972, 4, :o2, 72214200
tz.transition 1972, 10, :o1, 88540200
tz.transition 1973, 4, :o2, 104268600
tz.transition 1973, 10, :o1, 119989800
tz.transition 1973, 12, :o2, 126041400
tz.transition 1974, 10, :o1, 151439400
tz.transition 1975, 4, :o2, 167167800
tz.transition 1975, 10, :o1, 182889000
tz.transition 1976, 4, :o2, 198617400
tz.transition 1976, 10, :o1, 214338600
tz.transition 1979, 5, :o2, 295385400
tz.transition 1979, 10, :o1, 309292200
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Dushanbe.rb | lib/tzinfo/data/definitions/Asia/Dushanbe.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Dushanbe
include TimezoneDefinition
timezone 'Asia/Dushanbe' do |tz|
tz.offset :o0, 16512, 0, :LMT
tz.offset :o1, 18000, 0, :'+05'
tz.offset :o2, 21600, 0, :'+06'
tz.offset :o3, 21600, 3600, :'+07'
tz.offset :o4, 18000, 3600, :'+06'
tz.transition 1924, 5, :o1, -1441168512, 1090758289, 450
tz.transition 1930, 6, :o2, -1247547600, 58227559, 24
tz.transition 1981, 3, :o3, 354909600
tz.transition 1981, 9, :o2, 370717200
tz.transition 1982, 3, :o3, 386445600
tz.transition 1982, 9, :o2, 402253200
tz.transition 1983, 3, :o3, 417981600
tz.transition 1983, 9, :o2, 433789200
tz.transition 1984, 3, :o3, 449604000
tz.transition 1984, 9, :o2, 465336000
tz.transition 1985, 3, :o3, 481060800
tz.transition 1985, 9, :o2, 496785600
tz.transition 1986, 3, :o3, 512510400
tz.transition 1986, 9, :o2, 528235200
tz.transition 1987, 3, :o3, 543960000
tz.transition 1987, 9, :o2, 559684800
tz.transition 1988, 3, :o3, 575409600
tz.transition 1988, 9, :o2, 591134400
tz.transition 1989, 3, :o3, 606859200
tz.transition 1989, 9, :o2, 622584000
tz.transition 1990, 3, :o3, 638308800
tz.transition 1990, 9, :o2, 654638400
tz.transition 1991, 3, :o4, 670363200
tz.transition 1991, 9, :o1, 684363600
end
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Muscat.rb | lib/tzinfo/data/definitions/Asia/Muscat.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Muscat
include TimezoneDefinition
linked_timezone 'Asia/Muscat', 'Asia/Dubai'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Asia/Saigon.rb | lib/tzinfo/data/definitions/Asia/Saigon.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Asia
module Saigon
include TimezoneDefinition
linked_timezone 'Asia/Saigon', 'Asia/Ho_Chi_Minh'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/definitions/Arctic/Longyearbyen.rb | lib/tzinfo/data/definitions/Arctic/Longyearbyen.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Arctic
module Longyearbyen
include TimezoneDefinition
linked_timezone 'Arctic/Longyearbyen', 'Europe/Berlin'
end
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/indexes/timezones.rb | lib/tzinfo/data/indexes/timezones.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Indexes
module Timezones
include TimezoneIndexDefinition
timezone 'Africa/Abidjan'
linked_timezone 'Africa/Accra'
linked_timezone 'Africa/Addis_Ababa'
timezone 'Africa/Algiers'
linked_timezone 'Africa/Asmara'
linked_timezone 'Africa/Asmera'
linked_timezone 'Africa/Bamako'
linked_timezone 'Africa/Bangui'
linked_timezone 'Africa/Banjul'
timezone 'Africa/Bissau'
linked_timezone 'Africa/Blantyre'
linked_timezone 'Africa/Brazzaville'
linked_timezone 'Africa/Bujumbura'
timezone 'Africa/Cairo'
timezone 'Africa/Casablanca'
timezone 'Africa/Ceuta'
linked_timezone 'Africa/Conakry'
linked_timezone 'Africa/Dakar'
linked_timezone 'Africa/Dar_es_Salaam'
linked_timezone 'Africa/Djibouti'
linked_timezone 'Africa/Douala'
timezone 'Africa/El_Aaiun'
linked_timezone 'Africa/Freetown'
linked_timezone 'Africa/Gaborone'
linked_timezone 'Africa/Harare'
timezone 'Africa/Johannesburg'
timezone 'Africa/Juba'
linked_timezone 'Africa/Kampala'
timezone 'Africa/Khartoum'
linked_timezone 'Africa/Kigali'
linked_timezone 'Africa/Kinshasa'
timezone 'Africa/Lagos'
linked_timezone 'Africa/Libreville'
linked_timezone 'Africa/Lome'
linked_timezone 'Africa/Luanda'
linked_timezone 'Africa/Lubumbashi'
linked_timezone 'Africa/Lusaka'
linked_timezone 'Africa/Malabo'
timezone 'Africa/Maputo'
linked_timezone 'Africa/Maseru'
linked_timezone 'Africa/Mbabane'
linked_timezone 'Africa/Mogadishu'
timezone 'Africa/Monrovia'
timezone 'Africa/Nairobi'
timezone 'Africa/Ndjamena'
linked_timezone 'Africa/Niamey'
linked_timezone 'Africa/Nouakchott'
linked_timezone 'Africa/Ouagadougou'
linked_timezone 'Africa/Porto-Novo'
timezone 'Africa/Sao_Tome'
linked_timezone 'Africa/Timbuktu'
timezone 'Africa/Tripoli'
timezone 'Africa/Tunis'
timezone 'Africa/Windhoek'
timezone 'America/Adak'
timezone 'America/Anchorage'
linked_timezone 'America/Anguilla'
linked_timezone 'America/Antigua'
timezone 'America/Araguaina'
timezone 'America/Argentina/Buenos_Aires'
timezone 'America/Argentina/Catamarca'
linked_timezone 'America/Argentina/ComodRivadavia'
timezone 'America/Argentina/Cordoba'
timezone 'America/Argentina/Jujuy'
timezone 'America/Argentina/La_Rioja'
timezone 'America/Argentina/Mendoza'
timezone 'America/Argentina/Rio_Gallegos'
timezone 'America/Argentina/Salta'
timezone 'America/Argentina/San_Juan'
timezone 'America/Argentina/San_Luis'
timezone 'America/Argentina/Tucuman'
timezone 'America/Argentina/Ushuaia'
linked_timezone 'America/Aruba'
timezone 'America/Asuncion'
linked_timezone 'America/Atikokan'
linked_timezone 'America/Atka'
timezone 'America/Bahia'
timezone 'America/Bahia_Banderas'
timezone 'America/Barbados'
timezone 'America/Belem'
timezone 'America/Belize'
linked_timezone 'America/Blanc-Sablon'
timezone 'America/Boa_Vista'
timezone 'America/Bogota'
timezone 'America/Boise'
linked_timezone 'America/Buenos_Aires'
timezone 'America/Cambridge_Bay'
timezone 'America/Campo_Grande'
timezone 'America/Cancun'
timezone 'America/Caracas'
linked_timezone 'America/Catamarca'
timezone 'America/Cayenne'
linked_timezone 'America/Cayman'
timezone 'America/Chicago'
timezone 'America/Chihuahua'
timezone 'America/Ciudad_Juarez'
linked_timezone 'America/Coral_Harbour'
linked_timezone 'America/Cordoba'
timezone 'America/Costa_Rica'
timezone 'America/Coyhaique'
linked_timezone 'America/Creston'
timezone 'America/Cuiaba'
linked_timezone 'America/Curacao'
timezone 'America/Danmarkshavn'
timezone 'America/Dawson'
timezone 'America/Dawson_Creek'
timezone 'America/Denver'
timezone 'America/Detroit'
linked_timezone 'America/Dominica'
timezone 'America/Edmonton'
timezone 'America/Eirunepe'
timezone 'America/El_Salvador'
linked_timezone 'America/Ensenada'
timezone 'America/Fort_Nelson'
linked_timezone 'America/Fort_Wayne'
timezone 'America/Fortaleza'
timezone 'America/Glace_Bay'
linked_timezone 'America/Godthab'
timezone 'America/Goose_Bay'
timezone 'America/Grand_Turk'
linked_timezone 'America/Grenada'
linked_timezone 'America/Guadeloupe'
timezone 'America/Guatemala'
timezone 'America/Guayaquil'
timezone 'America/Guyana'
timezone 'America/Halifax'
timezone 'America/Havana'
timezone 'America/Hermosillo'
timezone 'America/Indiana/Indianapolis'
timezone 'America/Indiana/Knox'
timezone 'America/Indiana/Marengo'
timezone 'America/Indiana/Petersburg'
timezone 'America/Indiana/Tell_City'
timezone 'America/Indiana/Vevay'
timezone 'America/Indiana/Vincennes'
timezone 'America/Indiana/Winamac'
linked_timezone 'America/Indianapolis'
timezone 'America/Inuvik'
timezone 'America/Iqaluit'
timezone 'America/Jamaica'
linked_timezone 'America/Jujuy'
timezone 'America/Juneau'
timezone 'America/Kentucky/Louisville'
timezone 'America/Kentucky/Monticello'
linked_timezone 'America/Knox_IN'
linked_timezone 'America/Kralendijk'
timezone 'America/La_Paz'
timezone 'America/Lima'
timezone 'America/Los_Angeles'
linked_timezone 'America/Louisville'
linked_timezone 'America/Lower_Princes'
timezone 'America/Maceio'
timezone 'America/Managua'
timezone 'America/Manaus'
linked_timezone 'America/Marigot'
timezone 'America/Martinique'
timezone 'America/Matamoros'
timezone 'America/Mazatlan'
linked_timezone 'America/Mendoza'
timezone 'America/Menominee'
timezone 'America/Merida'
timezone 'America/Metlakatla'
timezone 'America/Mexico_City'
timezone 'America/Miquelon'
timezone 'America/Moncton'
timezone 'America/Monterrey'
timezone 'America/Montevideo'
linked_timezone 'America/Montreal'
linked_timezone 'America/Montserrat'
linked_timezone 'America/Nassau'
timezone 'America/New_York'
linked_timezone 'America/Nipigon'
timezone 'America/Nome'
timezone 'America/Noronha'
timezone 'America/North_Dakota/Beulah'
timezone 'America/North_Dakota/Center'
timezone 'America/North_Dakota/New_Salem'
timezone 'America/Nuuk'
timezone 'America/Ojinaga'
timezone 'America/Panama'
linked_timezone 'America/Pangnirtung'
timezone 'America/Paramaribo'
timezone 'America/Phoenix'
timezone 'America/Port-au-Prince'
linked_timezone 'America/Port_of_Spain'
linked_timezone 'America/Porto_Acre'
timezone 'America/Porto_Velho'
timezone 'America/Puerto_Rico'
timezone 'America/Punta_Arenas'
linked_timezone 'America/Rainy_River'
timezone 'America/Rankin_Inlet'
timezone 'America/Recife'
timezone 'America/Regina'
timezone 'America/Resolute'
timezone 'America/Rio_Branco'
linked_timezone 'America/Rosario'
linked_timezone 'America/Santa_Isabel'
timezone 'America/Santarem'
timezone 'America/Santiago'
timezone 'America/Santo_Domingo'
timezone 'America/Sao_Paulo'
timezone 'America/Scoresbysund'
linked_timezone 'America/Shiprock'
timezone 'America/Sitka'
linked_timezone 'America/St_Barthelemy'
timezone 'America/St_Johns'
linked_timezone 'America/St_Kitts'
linked_timezone 'America/St_Lucia'
linked_timezone 'America/St_Thomas'
linked_timezone 'America/St_Vincent'
timezone 'America/Swift_Current'
timezone 'America/Tegucigalpa'
timezone 'America/Thule'
linked_timezone 'America/Thunder_Bay'
timezone 'America/Tijuana'
timezone 'America/Toronto'
linked_timezone 'America/Tortola'
timezone 'America/Vancouver'
linked_timezone 'America/Virgin'
timezone 'America/Whitehorse'
timezone 'America/Winnipeg'
timezone 'America/Yakutat'
linked_timezone 'America/Yellowknife'
timezone 'Antarctica/Casey'
timezone 'Antarctica/Davis'
linked_timezone 'Antarctica/DumontDUrville'
timezone 'Antarctica/Macquarie'
timezone 'Antarctica/Mawson'
linked_timezone 'Antarctica/McMurdo'
timezone 'Antarctica/Palmer'
timezone 'Antarctica/Rothera'
linked_timezone 'Antarctica/South_Pole'
linked_timezone 'Antarctica/Syowa'
timezone 'Antarctica/Troll'
timezone 'Antarctica/Vostok'
linked_timezone 'Arctic/Longyearbyen'
linked_timezone 'Asia/Aden'
timezone 'Asia/Almaty'
timezone 'Asia/Amman'
timezone 'Asia/Anadyr'
timezone 'Asia/Aqtau'
timezone 'Asia/Aqtobe'
timezone 'Asia/Ashgabat'
linked_timezone 'Asia/Ashkhabad'
timezone 'Asia/Atyrau'
timezone 'Asia/Baghdad'
linked_timezone 'Asia/Bahrain'
timezone 'Asia/Baku'
timezone 'Asia/Bangkok'
timezone 'Asia/Barnaul'
timezone 'Asia/Beirut'
timezone 'Asia/Bishkek'
linked_timezone 'Asia/Brunei'
linked_timezone 'Asia/Calcutta'
timezone 'Asia/Chita'
linked_timezone 'Asia/Choibalsan'
linked_timezone 'Asia/Chongqing'
linked_timezone 'Asia/Chungking'
timezone 'Asia/Colombo'
linked_timezone 'Asia/Dacca'
timezone 'Asia/Damascus'
timezone 'Asia/Dhaka'
timezone 'Asia/Dili'
timezone 'Asia/Dubai'
timezone 'Asia/Dushanbe'
timezone 'Asia/Famagusta'
timezone 'Asia/Gaza'
linked_timezone 'Asia/Harbin'
timezone 'Asia/Hebron'
timezone 'Asia/Ho_Chi_Minh'
timezone 'Asia/Hong_Kong'
timezone 'Asia/Hovd'
timezone 'Asia/Irkutsk'
linked_timezone 'Asia/Istanbul'
timezone 'Asia/Jakarta'
timezone 'Asia/Jayapura'
timezone 'Asia/Jerusalem'
timezone 'Asia/Kabul'
timezone 'Asia/Kamchatka'
timezone 'Asia/Karachi'
linked_timezone 'Asia/Kashgar'
timezone 'Asia/Kathmandu'
linked_timezone 'Asia/Katmandu'
timezone 'Asia/Khandyga'
timezone 'Asia/Kolkata'
timezone 'Asia/Krasnoyarsk'
linked_timezone 'Asia/Kuala_Lumpur'
timezone 'Asia/Kuching'
linked_timezone 'Asia/Kuwait'
linked_timezone 'Asia/Macao'
timezone 'Asia/Macau'
timezone 'Asia/Magadan'
timezone 'Asia/Makassar'
timezone 'Asia/Manila'
linked_timezone 'Asia/Muscat'
timezone 'Asia/Nicosia'
timezone 'Asia/Novokuznetsk'
timezone 'Asia/Novosibirsk'
timezone 'Asia/Omsk'
timezone 'Asia/Oral'
linked_timezone 'Asia/Phnom_Penh'
timezone 'Asia/Pontianak'
timezone 'Asia/Pyongyang'
timezone 'Asia/Qatar'
timezone 'Asia/Qostanay'
timezone 'Asia/Qyzylorda'
linked_timezone 'Asia/Rangoon'
timezone 'Asia/Riyadh'
linked_timezone 'Asia/Saigon'
timezone 'Asia/Sakhalin'
timezone 'Asia/Samarkand'
timezone 'Asia/Seoul'
timezone 'Asia/Shanghai'
timezone 'Asia/Singapore'
timezone 'Asia/Srednekolymsk'
timezone 'Asia/Taipei'
timezone 'Asia/Tashkent'
timezone 'Asia/Tbilisi'
timezone 'Asia/Tehran'
linked_timezone 'Asia/Tel_Aviv'
linked_timezone 'Asia/Thimbu'
timezone 'Asia/Thimphu'
timezone 'Asia/Tokyo'
timezone 'Asia/Tomsk'
linked_timezone 'Asia/Ujung_Pandang'
timezone 'Asia/Ulaanbaatar'
linked_timezone 'Asia/Ulan_Bator'
timezone 'Asia/Urumqi'
timezone 'Asia/Ust-Nera'
linked_timezone 'Asia/Vientiane'
timezone 'Asia/Vladivostok'
timezone 'Asia/Yakutsk'
timezone 'Asia/Yangon'
timezone 'Asia/Yekaterinburg'
timezone 'Asia/Yerevan'
timezone 'Atlantic/Azores'
timezone 'Atlantic/Bermuda'
timezone 'Atlantic/Canary'
timezone 'Atlantic/Cape_Verde'
linked_timezone 'Atlantic/Faeroe'
timezone 'Atlantic/Faroe'
linked_timezone 'Atlantic/Jan_Mayen'
timezone 'Atlantic/Madeira'
linked_timezone 'Atlantic/Reykjavik'
timezone 'Atlantic/South_Georgia'
linked_timezone 'Atlantic/St_Helena'
timezone 'Atlantic/Stanley'
linked_timezone 'Australia/ACT'
timezone 'Australia/Adelaide'
timezone 'Australia/Brisbane'
timezone 'Australia/Broken_Hill'
linked_timezone 'Australia/Canberra'
linked_timezone 'Australia/Currie'
timezone 'Australia/Darwin'
timezone 'Australia/Eucla'
timezone 'Australia/Hobart'
linked_timezone 'Australia/LHI'
timezone 'Australia/Lindeman'
timezone 'Australia/Lord_Howe'
timezone 'Australia/Melbourne'
linked_timezone 'Australia/NSW'
linked_timezone 'Australia/North'
timezone 'Australia/Perth'
linked_timezone 'Australia/Queensland'
linked_timezone 'Australia/South'
timezone 'Australia/Sydney'
linked_timezone 'Australia/Tasmania'
linked_timezone 'Australia/Victoria'
linked_timezone 'Australia/West'
linked_timezone 'Australia/Yancowinna'
linked_timezone 'Brazil/Acre'
linked_timezone 'Brazil/DeNoronha'
linked_timezone 'Brazil/East'
linked_timezone 'Brazil/West'
linked_timezone 'CET'
linked_timezone 'CST6CDT'
linked_timezone 'Canada/Atlantic'
linked_timezone 'Canada/Central'
linked_timezone 'Canada/Eastern'
linked_timezone 'Canada/Mountain'
linked_timezone 'Canada/Newfoundland'
linked_timezone 'Canada/Pacific'
linked_timezone 'Canada/Saskatchewan'
linked_timezone 'Canada/Yukon'
linked_timezone 'Chile/Continental'
linked_timezone 'Chile/EasterIsland'
linked_timezone 'Cuba'
linked_timezone 'EET'
linked_timezone 'EST'
linked_timezone 'EST5EDT'
linked_timezone 'Egypt'
linked_timezone 'Eire'
timezone 'Etc/GMT'
linked_timezone 'Etc/GMT+0'
timezone 'Etc/GMT+1'
timezone 'Etc/GMT+10'
timezone 'Etc/GMT+11'
timezone 'Etc/GMT+12'
timezone 'Etc/GMT+2'
timezone 'Etc/GMT+3'
timezone 'Etc/GMT+4'
timezone 'Etc/GMT+5'
timezone 'Etc/GMT+6'
timezone 'Etc/GMT+7'
timezone 'Etc/GMT+8'
timezone 'Etc/GMT+9'
linked_timezone 'Etc/GMT-0'
timezone 'Etc/GMT-1'
timezone 'Etc/GMT-10'
timezone 'Etc/GMT-11'
timezone 'Etc/GMT-12'
timezone 'Etc/GMT-13'
timezone 'Etc/GMT-14'
timezone 'Etc/GMT-2'
timezone 'Etc/GMT-3'
timezone 'Etc/GMT-4'
timezone 'Etc/GMT-5'
timezone 'Etc/GMT-6'
timezone 'Etc/GMT-7'
timezone 'Etc/GMT-8'
timezone 'Etc/GMT-9'
linked_timezone 'Etc/GMT0'
linked_timezone 'Etc/Greenwich'
linked_timezone 'Etc/UCT'
timezone 'Etc/UTC'
linked_timezone 'Etc/Universal'
linked_timezone 'Etc/Zulu'
linked_timezone 'Europe/Amsterdam'
timezone 'Europe/Andorra'
timezone 'Europe/Astrakhan'
timezone 'Europe/Athens'
linked_timezone 'Europe/Belfast'
timezone 'Europe/Belgrade'
timezone 'Europe/Berlin'
linked_timezone 'Europe/Bratislava'
timezone 'Europe/Brussels'
timezone 'Europe/Bucharest'
timezone 'Europe/Budapest'
linked_timezone 'Europe/Busingen'
timezone 'Europe/Chisinau'
linked_timezone 'Europe/Copenhagen'
timezone 'Europe/Dublin'
timezone 'Europe/Gibraltar'
linked_timezone 'Europe/Guernsey'
timezone 'Europe/Helsinki'
linked_timezone 'Europe/Isle_of_Man'
timezone 'Europe/Istanbul'
linked_timezone 'Europe/Jersey'
timezone 'Europe/Kaliningrad'
linked_timezone 'Europe/Kiev'
timezone 'Europe/Kirov'
timezone 'Europe/Kyiv'
timezone 'Europe/Lisbon'
linked_timezone 'Europe/Ljubljana'
timezone 'Europe/London'
linked_timezone 'Europe/Luxembourg'
timezone 'Europe/Madrid'
timezone 'Europe/Malta'
linked_timezone 'Europe/Mariehamn'
timezone 'Europe/Minsk'
linked_timezone 'Europe/Monaco'
timezone 'Europe/Moscow'
linked_timezone 'Europe/Nicosia'
linked_timezone 'Europe/Oslo'
timezone 'Europe/Paris'
linked_timezone 'Europe/Podgorica'
timezone 'Europe/Prague'
timezone 'Europe/Riga'
timezone 'Europe/Rome'
timezone 'Europe/Samara'
linked_timezone 'Europe/San_Marino'
linked_timezone 'Europe/Sarajevo'
timezone 'Europe/Saratov'
timezone 'Europe/Simferopol'
linked_timezone 'Europe/Skopje'
timezone 'Europe/Sofia'
linked_timezone 'Europe/Stockholm'
timezone 'Europe/Tallinn'
timezone 'Europe/Tirane'
linked_timezone 'Europe/Tiraspol'
timezone 'Europe/Ulyanovsk'
linked_timezone 'Europe/Uzhgorod'
linked_timezone 'Europe/Vaduz'
linked_timezone 'Europe/Vatican'
timezone 'Europe/Vienna'
timezone 'Europe/Vilnius'
timezone 'Europe/Volgograd'
timezone 'Europe/Warsaw'
linked_timezone 'Europe/Zagreb'
linked_timezone 'Europe/Zaporozhye'
timezone 'Europe/Zurich'
timezone 'Factory'
linked_timezone 'GB'
linked_timezone 'GB-Eire'
linked_timezone 'GMT'
linked_timezone 'GMT+0'
linked_timezone 'GMT-0'
linked_timezone 'GMT0'
linked_timezone 'Greenwich'
linked_timezone 'HST'
linked_timezone 'Hongkong'
linked_timezone 'Iceland'
linked_timezone 'Indian/Antananarivo'
timezone 'Indian/Chagos'
linked_timezone 'Indian/Christmas'
linked_timezone 'Indian/Cocos'
linked_timezone 'Indian/Comoro'
linked_timezone 'Indian/Kerguelen'
linked_timezone 'Indian/Mahe'
timezone 'Indian/Maldives'
timezone 'Indian/Mauritius'
linked_timezone 'Indian/Mayotte'
linked_timezone 'Indian/Reunion'
linked_timezone 'Iran'
linked_timezone 'Israel'
linked_timezone 'Jamaica'
linked_timezone 'Japan'
linked_timezone 'Kwajalein'
linked_timezone 'Libya'
linked_timezone 'MET'
linked_timezone 'MST'
linked_timezone 'MST7MDT'
linked_timezone 'Mexico/BajaNorte'
linked_timezone 'Mexico/BajaSur'
linked_timezone 'Mexico/General'
linked_timezone 'NZ'
linked_timezone 'NZ-CHAT'
linked_timezone 'Navajo'
linked_timezone 'PRC'
linked_timezone 'PST8PDT'
timezone 'Pacific/Apia'
timezone 'Pacific/Auckland'
timezone 'Pacific/Bougainville'
timezone 'Pacific/Chatham'
linked_timezone 'Pacific/Chuuk'
timezone 'Pacific/Easter'
timezone 'Pacific/Efate'
linked_timezone 'Pacific/Enderbury'
timezone 'Pacific/Fakaofo'
timezone 'Pacific/Fiji'
linked_timezone 'Pacific/Funafuti'
timezone 'Pacific/Galapagos'
timezone 'Pacific/Gambier'
timezone 'Pacific/Guadalcanal'
timezone 'Pacific/Guam'
timezone 'Pacific/Honolulu'
linked_timezone 'Pacific/Johnston'
timezone 'Pacific/Kanton'
timezone 'Pacific/Kiritimati'
timezone 'Pacific/Kosrae'
timezone 'Pacific/Kwajalein'
linked_timezone 'Pacific/Majuro'
timezone 'Pacific/Marquesas'
linked_timezone 'Pacific/Midway'
timezone 'Pacific/Nauru'
timezone 'Pacific/Niue'
timezone 'Pacific/Norfolk'
timezone 'Pacific/Noumea'
timezone 'Pacific/Pago_Pago'
timezone 'Pacific/Palau'
timezone 'Pacific/Pitcairn'
linked_timezone 'Pacific/Pohnpei'
linked_timezone 'Pacific/Ponape'
timezone 'Pacific/Port_Moresby'
timezone 'Pacific/Rarotonga'
linked_timezone 'Pacific/Saipan'
linked_timezone 'Pacific/Samoa'
timezone 'Pacific/Tahiti'
timezone 'Pacific/Tarawa'
timezone 'Pacific/Tongatapu'
linked_timezone 'Pacific/Truk'
linked_timezone 'Pacific/Wake'
linked_timezone 'Pacific/Wallis'
linked_timezone 'Pacific/Yap'
linked_timezone 'Poland'
linked_timezone 'Portugal'
linked_timezone 'ROC'
linked_timezone 'ROK'
linked_timezone 'Singapore'
linked_timezone 'Turkey'
linked_timezone 'UCT'
linked_timezone 'US/Alaska'
linked_timezone 'US/Aleutian'
linked_timezone 'US/Arizona'
linked_timezone 'US/Central'
linked_timezone 'US/East-Indiana'
linked_timezone 'US/Eastern'
linked_timezone 'US/Hawaii'
linked_timezone 'US/Indiana-Starke'
linked_timezone 'US/Michigan'
linked_timezone 'US/Mountain'
linked_timezone 'US/Pacific'
linked_timezone 'US/Samoa'
linked_timezone 'UTC'
linked_timezone 'Universal'
linked_timezone 'W-SU'
linked_timezone 'WET'
linked_timezone 'Zulu'
end
end
end
end
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | false |
tzinfo/tzinfo-data | https://github.com/tzinfo/tzinfo-data/blob/f73295c364520a6d99dc0d8135a3751e03a4c079/lib/tzinfo/data/indexes/countries.rb | lib/tzinfo/data/indexes/countries.rb | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Indexes
module Countries
include CountryIndexDefinition
country 'AD', 'Andorra' do |c|
c.timezone 'Europe/Andorra', 85, 2, 91, 60
end
country 'AE', 'United Arab Emirates' do |c|
c.timezone 'Asia/Dubai', 253, 10, 553, 10, 'Crozet'
end
country 'AF', 'Afghanistan' do |c|
c.timezone 'Asia/Kabul', 2071, 60, 346, 5
end
country 'AG', 'Antigua & Barbuda' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'AI', 'Anguilla' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'AL', 'Albania' do |c|
c.timezone 'Europe/Tirane', 124, 3, 119, 6
end
country 'AM', 'Armenia' do |c|
c.timezone 'Asia/Yerevan', 2411, 60, 89, 2
end
country 'AO', 'Angola' do |c|
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'AQ', 'Antarctica' do |c|
c.timezone 'Antarctica/Casey', -3977, 60, 6631, 60, 'Casey'
c.timezone 'Antarctica/Davis', -823, 12, 2339, 30, 'Davis'
c.timezone 'Antarctica/Mawson', -338, 5, 3773, 60, 'Mawson'
c.timezone 'Antarctica/Palmer', -324, 5, -641, 10, 'Palmer'
c.timezone 'Antarctica/Rothera', -2027, 30, -1022, 15, 'Rothera'
c.timezone 'Antarctica/Troll', -259241, 3600, 507, 200, 'Troll'
c.timezone 'Antarctica/Vostok', -392, 5, 1069, 10, 'Vostok'
c.timezone 'Pacific/Auckland', -553, 15, 5243, 30, 'New Zealand time'
c.timezone 'Pacific/Port_Moresby', -19, 2, 883, 6, 'Papua New Guinea (most areas), Chuuk, Yap, Dumont d’Urville'
c.timezone 'Asia/Riyadh', 739, 30, 2803, 60, 'Syowa'
c.timezone 'Asia/Singapore', 77, 60, 2077, 20, 'peninsular Malaysia, Concordia'
end
country 'AR', 'Argentina' do |c|
c.timezone 'America/Argentina/Buenos_Aires', -173, 5, -1169, 20, 'Buenos Aires (BA, CF)'
c.timezone 'America/Argentina/Cordoba', -157, 5, -3851, 60, 'most areas: CB, CC, CN, ER, FM, MN, SE, SF'
c.timezone 'America/Argentina/Salta', -1487, 60, -785, 12, 'Salta (SA, LP, NQ, RN)'
c.timezone 'America/Argentina/Jujuy', -1451, 60, -653, 10, 'Jujuy (JY)'
c.timezone 'America/Argentina/Tucuman', -1609, 60, -3913, 60, 'Tucumán (TM)'
c.timezone 'America/Argentina/Catamarca', -427, 15, -3947, 60, 'Catamarca (CT), Chubut (CH)'
c.timezone 'America/Argentina/La_Rioja', -883, 30, -1337, 20, 'La Rioja (LR)'
c.timezone 'America/Argentina/San_Juan', -473, 15, -4111, 60, 'San Juan (SJ)'
c.timezone 'America/Argentina/Mendoza', -1973, 60, -4129, 60, 'Mendoza (MZ)'
c.timezone 'America/Argentina/San_Luis', -1999, 60, -1327, 20, 'San Luis (SL)'
c.timezone 'America/Argentina/Rio_Gallegos', -1549, 30, -4153, 60, 'Santa Cruz (SC)'
c.timezone 'America/Argentina/Ushuaia', -274, 5, -683, 10, 'Tierra del Fuego (TF)'
end
country 'AS', 'Samoa (American)' do |c|
c.timezone 'Pacific/Pago_Pago', -214, 15, -1707, 10, 'Midway'
end
country 'AT', 'Austria' do |c|
c.timezone 'Europe/Vienna', 2893, 60, 49, 3
end
country 'AU', 'Australia' do |c|
c.timezone 'Australia/Lord_Howe', -631, 20, 1909, 12, 'Lord Howe Island'
c.timezone 'Antarctica/Macquarie', -109, 2, 3179, 20, 'Macquarie Island'
c.timezone 'Australia/Hobart', -2573, 60, 8839, 60, 'Tasmania'
c.timezone 'Australia/Melbourne', -2269, 60, 4349, 30, 'Victoria'
c.timezone 'Australia/Sydney', -508, 15, 9073, 60, 'New South Wales (most areas)'
c.timezone 'Australia/Broken_Hill', -639, 20, 2829, 20, 'New South Wales (Yancowinna)'
c.timezone 'Australia/Brisbane', -412, 15, 4591, 30, 'Queensland (most areas)'
c.timezone 'Australia/Lindeman', -304, 15, 149, 1, 'Queensland (Whitsunday Islands)'
c.timezone 'Australia/Adelaide', -419, 12, 1663, 12, 'South Australia'
c.timezone 'Australia/Darwin', -187, 15, 785, 6, 'Northern Territory'
c.timezone 'Australia/Perth', -639, 20, 2317, 20, 'Western Australia (most areas)'
c.timezone 'Australia/Eucla', -1903, 60, 1933, 15, 'Western Australia (Eucla)'
c.timezone 'Asia/Tokyo', 32089, 900, 503081, 3600, 'Eyre Bird Observatory'
end
country 'AW', 'Aruba' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'AX', 'Åland Islands' do |c|
c.timezone 'Europe/Helsinki', 361, 6, 749, 30
end
country 'AZ', 'Azerbaijan' do |c|
c.timezone 'Asia/Baku', 2423, 60, 997, 20
end
country 'BA', 'Bosnia & Herzegovina' do |c|
c.timezone 'Europe/Belgrade', 269, 6, 41, 2
end
country 'BB', 'Barbados' do |c|
c.timezone 'America/Barbados', 131, 10, -3577, 60
end
country 'BD', 'Bangladesh' do |c|
c.timezone 'Asia/Dhaka', 1423, 60, 1085, 12
end
country 'BE', 'Belgium' do |c|
c.timezone 'Europe/Brussels', 305, 6, 13, 3
end
country 'BF', 'Burkina Faso' do |c|
c.timezone 'Africa/Abidjan', 319, 60, -121, 30
end
country 'BG', 'Bulgaria' do |c|
c.timezone 'Europe/Sofia', 2561, 60, 1399, 60
end
country 'BH', 'Bahrain' do |c|
c.timezone 'Asia/Qatar', 1517, 60, 773, 15
end
country 'BI', 'Burundi' do |c|
c.timezone 'Africa/Maputo', -779, 30, 391, 12, 'Central Africa Time'
end
country 'BJ', 'Benin' do |c|
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'BL', 'St Barthelemy' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'BM', 'Bermuda' do |c|
c.timezone 'Atlantic/Bermuda', 1937, 60, -1943, 30
end
country 'BN', 'Brunei' do |c|
c.timezone 'Asia/Kuching', 31, 20, 331, 3, 'Sabah, Sarawak'
end
country 'BO', 'Bolivia' do |c|
c.timezone 'America/La_Paz', -33, 2, -1363, 20
end
country 'BQ', 'Caribbean NL' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'BR', 'Brazil' do |c|
c.timezone 'America/Noronha', -77, 20, -389, 12, 'Atlantic islands'
c.timezone 'America/Belem', -29, 20, -2909, 60, 'Pará (east), Amapá'
c.timezone 'America/Fortaleza', -223, 60, -77, 2, 'Brazil (northeast: MA, PI, CE, RN, PB)'
c.timezone 'America/Recife', -161, 20, -349, 10, 'Pernambuco'
c.timezone 'America/Araguaina', -36, 5, -241, 5, 'Tocantins'
c.timezone 'America/Maceio', -29, 3, -2143, 60, 'Alagoas, Sergipe'
c.timezone 'America/Bahia', -779, 60, -2311, 60, 'Bahia'
c.timezone 'America/Sao_Paulo', -353, 15, -2797, 60, 'Brazil (southeast: GO, DF, MG, ES, RJ, SP, PR, SC, RS)'
c.timezone 'America/Campo_Grande', -409, 20, -3277, 60, 'Mato Grosso do Sul'
c.timezone 'America/Cuiaba', -187, 12, -673, 12, 'Mato Grosso'
c.timezone 'America/Santarem', -73, 30, -823, 15, 'Pará (west)'
c.timezone 'America/Porto_Velho', -263, 30, -639, 10, 'Rondônia'
c.timezone 'America/Boa_Vista', 169, 60, -182, 3, 'Roraima'
c.timezone 'America/Manaus', -47, 15, -3601, 60, 'Amazonas (east)'
c.timezone 'America/Eirunepe', -20, 3, -1048, 15, 'Amazonas (west)'
c.timezone 'America/Rio_Branco', -299, 30, -339, 5, 'Acre'
end
country 'BS', 'Bahamas' do |c|
c.timezone 'America/Toronto', 873, 20, -4763, 60, 'Eastern - ON & QC (most areas)'
end
country 'BT', 'Bhutan' do |c|
c.timezone 'Asia/Thimphu', 412, 15, 1793, 20
end
country 'BV', 'Bouvet Island'
country 'BW', 'Botswana' do |c|
c.timezone 'Africa/Maputo', -779, 30, 391, 12, 'Central Africa Time'
end
country 'BY', 'Belarus' do |c|
c.timezone 'Europe/Minsk', 539, 10, 827, 30
end
country 'BZ', 'Belize' do |c|
c.timezone 'America/Belize', 35, 2, -441, 5
end
country 'CA', 'Canada' do |c|
c.timezone 'America/St_Johns', 1427, 30, -3163, 60, 'Newfoundland, Labrador (SE)'
c.timezone 'America/Halifax', 893, 20, -318, 5, 'Atlantic - NS (most areas), PE'
c.timezone 'America/Glace_Bay', 231, 5, -1199, 20, 'Atlantic - NS (Cape Breton)'
c.timezone 'America/Moncton', 461, 10, -3887, 60, 'Atlantic - New Brunswick'
c.timezone 'America/Goose_Bay', 160, 3, -725, 12, 'Atlantic - Labrador (most areas)'
c.timezone 'America/Toronto', 873, 20, -4763, 60, 'Eastern - ON & QC (most areas)'
c.timezone 'America/Iqaluit', 956, 15, -1027, 15, 'Eastern - NU (most areas)'
c.timezone 'America/Winnipeg', 2993, 60, -1943, 20, 'Central - ON (west), Manitoba'
c.timezone 'America/Resolute', 33613, 450, -22759, 240, 'Central - NU (Resolute)'
c.timezone 'America/Rankin_Inlet', 3769, 60, -331499, 3600, 'Central - NU (central)'
c.timezone 'America/Regina', 252, 5, -2093, 20, 'CST - SK (most areas)'
c.timezone 'America/Swift_Current', 3017, 60, -647, 6, 'CST - SK (midwest)'
c.timezone 'America/Edmonton', 1071, 20, -1702, 15, 'Mountain - AB, BC(E), NT(E), SK(W)'
c.timezone 'America/Cambridge_Bay', 24881, 360, -37819, 360, 'Mountain - NU (west)'
c.timezone 'America/Inuvik', 246059, 3600, -8023, 60, 'Mountain - NT (west)'
c.timezone 'America/Dawson_Creek', 1673, 30, -3607, 30, 'MST - BC (Dawson Cr, Ft St John)'
c.timezone 'America/Fort_Nelson', 294, 5, -1227, 10, 'MST - BC (Ft Nelson)'
c.timezone 'America/Whitehorse', 3643, 60, -2701, 20, 'MST - Yukon (east)'
c.timezone 'America/Dawson', 961, 15, -1673, 12, 'MST - Yukon (west)'
c.timezone 'America/Vancouver', 739, 15, -7387, 60, 'Pacific - BC (most areas)'
c.timezone 'America/Panama', 269, 30, -1193, 15, 'EST - ON (Atikokan), NU (Coral H)'
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
c.timezone 'America/Phoenix', 20069, 600, -16811, 150, 'MST - AZ (most areas), Creston BC'
end
country 'CC', 'Cocos (Keeling) Islands' do |c|
c.timezone 'Asia/Yangon', 1007, 60, 577, 6
end
country 'CD', 'Congo (Dem. Rep.)' do |c|
c.timezone 'Africa/Maputo', -779, 30, 391, 12, 'Central Africa Time'
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'CF', 'Central African Rep.' do |c|
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'CG', 'Congo (Rep.)' do |c|
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'CH', 'Switzerland' do |c|
c.timezone 'Europe/Zurich', 2843, 60, 128, 15, 'Büsingen'
end
country 'CI', 'Côte d’Ivoire' do |c|
c.timezone 'Africa/Abidjan', 319, 60, -121, 30
end
country 'CK', 'Cook Islands' do |c|
c.timezone 'Pacific/Rarotonga', -637, 30, -4793, 30
end
country 'CL', 'Chile' do |c|
c.timezone 'America/Santiago', -669, 20, -212, 3, 'most of Chile'
c.timezone 'America/Coyhaique', -1367, 30, -1081, 15, 'Aysén Region'
c.timezone 'America/Punta_Arenas', -1063, 20, -851, 12, 'Magallanes Region'
c.timezone 'Pacific/Easter', -543, 20, -3283, 30, 'Easter Island'
end
country 'CM', 'Cameroon' do |c|
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'CN', 'China' do |c|
c.timezone 'Asia/Shanghai', 937, 30, 1822, 15, 'Beijing Time'
c.timezone 'Asia/Urumqi', 219, 5, 1051, 12, 'Xinjiang Time'
end
country 'CO', 'Colombia' do |c|
c.timezone 'America/Bogota', 23, 5, -889, 12
end
country 'CR', 'Costa Rica' do |c|
c.timezone 'America/Costa_Rica', 149, 15, -1009, 12
end
country 'CU', 'Cuba' do |c|
c.timezone 'America/Havana', 347, 15, -2471, 30
end
country 'CV', 'Cape Verde' do |c|
c.timezone 'Atlantic/Cape_Verde', 179, 12, -1411, 60
end
country 'CW', 'Curaçao' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'CX', 'Christmas Island' do |c|
c.timezone 'Asia/Bangkok', 55, 4, 6031, 60, 'north Vietnam'
end
country 'CY', 'Cyprus' do |c|
c.timezone 'Asia/Nicosia', 211, 6, 1001, 30, 'most of Cyprus'
c.timezone 'Asia/Famagusta', 2107, 60, 679, 20, 'Northern Cyprus'
end
country 'CZ', 'Czech Republic' do |c|
c.timezone 'Europe/Prague', 601, 12, 433, 30
end
country 'DE', 'Germany' do |c|
c.timezone 'Europe/Berlin', 105, 2, 401, 30, 'most of Germany'
c.timezone 'Europe/Zurich', 2843, 60, 128, 15, 'Büsingen'
end
country 'DJ', 'Djibouti' do |c|
c.timezone 'Africa/Nairobi', -77, 60, 2209, 60
end
country 'DK', 'Denmark' do |c|
c.timezone 'Europe/Berlin', 105, 2, 401, 30, 'most of Germany'
end
country 'DM', 'Dominica' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'DO', 'Dominican Republic' do |c|
c.timezone 'America/Santo_Domingo', 277, 15, -699, 10
end
country 'DZ', 'Algeria' do |c|
c.timezone 'Africa/Algiers', 2207, 60, 61, 20
end
country 'EC', 'Ecuador' do |c|
c.timezone 'America/Guayaquil', -13, 6, -479, 6, 'Ecuador (mainland)'
c.timezone 'Pacific/Galapagos', -9, 10, -448, 5, 'Galápagos Islands'
end
country 'EE', 'Estonia' do |c|
c.timezone 'Europe/Tallinn', 713, 12, 99, 4
end
country 'EG', 'Egypt' do |c|
c.timezone 'Africa/Cairo', 601, 20, 125, 4
end
country 'EH', 'Western Sahara' do |c|
c.timezone 'Africa/El_Aaiun', 543, 20, -66, 5
end
country 'ER', 'Eritrea' do |c|
c.timezone 'Africa/Nairobi', -77, 60, 2209, 60
end
country 'ES', 'Spain' do |c|
c.timezone 'Europe/Madrid', 202, 5, -221, 60, 'Spain (mainland)'
c.timezone 'Africa/Ceuta', 2153, 60, -319, 60, 'Ceuta, Melilla'
c.timezone 'Atlantic/Canary', 281, 10, -77, 5, 'Canary Islands'
end
country 'ET', 'Ethiopia' do |c|
c.timezone 'Africa/Nairobi', -77, 60, 2209, 60
end
country 'FI', 'Finland' do |c|
c.timezone 'Europe/Helsinki', 361, 6, 749, 30
end
country 'FJ', 'Fiji' do |c|
c.timezone 'Pacific/Fiji', -272, 15, 2141, 12
end
country 'FK', 'Falkland Islands' do |c|
c.timezone 'Atlantic/Stanley', -517, 10, -1157, 20
end
country 'FM', 'Micronesia' do |c|
c.timezone 'Pacific/Kosrae', 319, 60, 9779, 60, 'Kosrae'
c.timezone 'Pacific/Port_Moresby', -19, 2, 883, 6, 'Papua New Guinea (most areas), Chuuk, Yap, Dumont d’Urville'
c.timezone 'Pacific/Guadalcanal', -143, 15, 801, 5, 'Pohnpei'
end
country 'FO', 'Faroe Islands' do |c|
c.timezone 'Atlantic/Faroe', 3721, 60, -203, 30
end
country 'FR', 'France' do |c|
c.timezone 'Europe/Paris', 733, 15, 7, 3
end
country 'GA', 'Gabon' do |c|
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'GB', 'Britain (UK)' do |c|
c.timezone 'Europe/London', 6181, 120, -451, 3600
end
country 'GD', 'Grenada' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'GE', 'Georgia' do |c|
c.timezone 'Asia/Tbilisi', 2503, 60, 2689, 60
end
country 'GF', 'French Guiana' do |c|
c.timezone 'America/Cayenne', 74, 15, -157, 3
end
country 'GG', 'Guernsey' do |c|
c.timezone 'Europe/London', 6181, 120, -451, 3600
end
country 'GH', 'Ghana' do |c|
c.timezone 'Africa/Abidjan', 319, 60, -121, 30
end
country 'GI', 'Gibraltar' do |c|
c.timezone 'Europe/Gibraltar', 542, 15, -107, 20
end
country 'GL', 'Greenland' do |c|
c.timezone 'America/Nuuk', 3851, 60, -776, 15, 'most of Greenland'
c.timezone 'America/Danmarkshavn', 2303, 30, -56, 3, 'National Park (east coast)'
c.timezone 'America/Scoresbysund', 4229, 60, -659, 30, 'Scoresbysund/Ittoqqortoormiit'
c.timezone 'America/Thule', 2297, 30, -4127, 60, 'Thule/Pituffik'
end
country 'GM', 'Gambia' do |c|
c.timezone 'Africa/Abidjan', 319, 60, -121, 30
end
country 'GN', 'Guinea' do |c|
c.timezone 'Africa/Abidjan', 319, 60, -121, 30
end
country 'GP', 'Guadeloupe' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'GQ', 'Equatorial Guinea' do |c|
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'GR', 'Greece' do |c|
c.timezone 'Europe/Athens', 1139, 30, 1423, 60
end
country 'GS', 'South Georgia & the South Sandwich Islands' do |c|
c.timezone 'Atlantic/South_Georgia', -814, 15, -548, 15
end
country 'GT', 'Guatemala' do |c|
c.timezone 'America/Guatemala', 439, 30, -5431, 60
end
country 'GU', 'Guam' do |c|
c.timezone 'Pacific/Guam', 202, 15, 579, 4
end
country 'GW', 'Guinea-Bissau' do |c|
c.timezone 'Africa/Bissau', 237, 20, -187, 12
end
country 'GY', 'Guyana' do |c|
c.timezone 'America/Guyana', 34, 5, -349, 6
end
country 'HK', 'Hong Kong' do |c|
c.timezone 'Asia/Hong_Kong', 1337, 60, 2283, 20
end
country 'HM', 'Heard Island & McDonald Islands'
country 'HN', 'Honduras' do |c|
c.timezone 'America/Tegucigalpa', 141, 10, -5233, 60
end
country 'HR', 'Croatia' do |c|
c.timezone 'Europe/Belgrade', 269, 6, 41, 2
end
country 'HT', 'Haiti' do |c|
c.timezone 'America/Port-au-Prince', 278, 15, -217, 3
end
country 'HU', 'Hungary' do |c|
c.timezone 'Europe/Budapest', 95, 2, 229, 12
end
country 'ID', 'Indonesia' do |c|
c.timezone 'Asia/Jakarta', -37, 6, 534, 5, 'Java, Sumatra'
c.timezone 'Asia/Pontianak', -1, 30, 328, 3, 'Borneo (west, central)'
c.timezone 'Asia/Makassar', -307, 60, 597, 5, 'Borneo (east, south), Sulawesi/Celebes, Bali, Nusa Tengarra, Timor (west)'
c.timezone 'Asia/Jayapura', -38, 15, 1407, 10, 'New Guinea (West Papua / Irian Jaya), Malukus/Moluccas'
end
country 'IE', 'Ireland' do |c|
c.timezone 'Europe/Dublin', 160, 3, -25, 4
end
country 'IL', 'Israel' do |c|
c.timezone 'Asia/Jerusalem', 11441, 360, 63403, 1800
end
country 'IM', 'Isle of Man' do |c|
c.timezone 'Europe/London', 6181, 120, -451, 3600
end
country 'IN', 'India' do |c|
c.timezone 'Asia/Kolkata', 338, 15, 2651, 30
end
country 'IO', 'British Indian Ocean Territory' do |c|
c.timezone 'Indian/Chagos', -22, 3, 869, 12
end
country 'IQ', 'Iraq' do |c|
c.timezone 'Asia/Baghdad', 667, 20, 533, 12
end
country 'IR', 'Iran' do |c|
c.timezone 'Asia/Tehran', 107, 3, 1543, 30
end
country 'IS', 'Iceland' do |c|
c.timezone 'Africa/Abidjan', 319, 60, -121, 30
end
country 'IT', 'Italy' do |c|
c.timezone 'Europe/Rome', 419, 10, 749, 60
end
country 'JE', 'Jersey' do |c|
c.timezone 'Europe/London', 6181, 120, -451, 3600
end
country 'JM', 'Jamaica' do |c|
c.timezone 'America/Jamaica', 12937, 720, -11519, 150
end
country 'JO', 'Jordan' do |c|
c.timezone 'Asia/Amman', 639, 20, 539, 15
end
country 'JP', 'Japan' do |c|
c.timezone 'Asia/Tokyo', 32089, 900, 503081, 3600, 'Eyre Bird Observatory'
end
country 'KE', 'Kenya' do |c|
c.timezone 'Africa/Nairobi', -77, 60, 2209, 60
end
country 'KG', 'Kyrgyzstan' do |c|
c.timezone 'Asia/Bishkek', 429, 10, 373, 5
end
country 'KH', 'Cambodia' do |c|
c.timezone 'Asia/Bangkok', 55, 4, 6031, 60, 'north Vietnam'
end
country 'KI', 'Kiribati' do |c|
c.timezone 'Pacific/Tarawa', 17, 12, 173, 1, 'Gilberts, Marshalls, Wake'
c.timezone 'Pacific/Kanton', -167, 60, -10303, 60, 'Phoenix Islands'
c.timezone 'Pacific/Kiritimati', 28, 15, -472, 3, 'Line Islands'
end
country 'KM', 'Comoros' do |c|
c.timezone 'Africa/Nairobi', -77, 60, 2209, 60
end
country 'KN', 'St Kitts & Nevis' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'KP', 'Korea (North)' do |c|
c.timezone 'Asia/Pyongyang', 2341, 60, 503, 4
end
country 'KR', 'Korea (South)' do |c|
c.timezone 'Asia/Seoul', 751, 20, 3809, 30
end
country 'KW', 'Kuwait' do |c|
c.timezone 'Asia/Riyadh', 739, 30, 2803, 60, 'Syowa'
end
country 'KY', 'Cayman Islands' do |c|
c.timezone 'America/Panama', 269, 30, -1193, 15, 'EST - ON (Atikokan), NU (Coral H)'
end
country 'KZ', 'Kazakhstan' do |c|
c.timezone 'Asia/Almaty', 173, 4, 1539, 20, 'most of Kazakhstan'
c.timezone 'Asia/Qyzylorda', 224, 5, 982, 15, 'Qyzylorda/Kyzylorda/Kzyl-Orda'
c.timezone 'Asia/Qostanay', 266, 5, 3817, 60, 'Qostanay/Kostanay/Kustanay'
c.timezone 'Asia/Aqtobe', 3017, 60, 343, 6, 'Aqtöbe/Aktobe'
c.timezone 'Asia/Aqtau', 2671, 60, 754, 15, 'Mangghystaū/Mankistau'
c.timezone 'Asia/Atyrau', 2827, 60, 779, 15, 'Atyraū/Atirau/Gur’yev'
c.timezone 'Asia/Oral', 3073, 60, 1027, 20, 'West Kazakhstan'
end
country 'LA', 'Laos' do |c|
c.timezone 'Asia/Bangkok', 55, 4, 6031, 60, 'north Vietnam'
end
country 'LB', 'Lebanon' do |c|
c.timezone 'Asia/Beirut', 2033, 60, 71, 2
end
country 'LC', 'St Lucia' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'LI', 'Liechtenstein' do |c|
c.timezone 'Europe/Zurich', 2843, 60, 128, 15, 'Büsingen'
end
country 'LK', 'Sri Lanka' do |c|
c.timezone 'Asia/Colombo', 104, 15, 1597, 20
end
country 'LR', 'Liberia' do |c|
c.timezone 'Africa/Monrovia', 63, 10, -647, 60
end
country 'LS', 'Lesotho' do |c|
c.timezone 'Africa/Johannesburg', -105, 4, 28, 1
end
country 'LT', 'Lithuania' do |c|
c.timezone 'Europe/Vilnius', 3281, 60, 1519, 60
end
country 'LU', 'Luxembourg' do |c|
c.timezone 'Europe/Brussels', 305, 6, 13, 3
end
country 'LV', 'Latvia' do |c|
c.timezone 'Europe/Riga', 1139, 20, 241, 10
end
country 'LY', 'Libya' do |c|
c.timezone 'Africa/Tripoli', 329, 10, 791, 60
end
country 'MA', 'Morocco' do |c|
c.timezone 'Africa/Casablanca', 673, 20, -91, 12
end
country 'MC', 'Monaco' do |c|
c.timezone 'Europe/Paris', 733, 15, 7, 3
end
country 'MD', 'Moldova' do |c|
c.timezone 'Europe/Chisinau', 47, 1, 173, 6
end
country 'ME', 'Montenegro' do |c|
c.timezone 'Europe/Belgrade', 269, 6, 41, 2
end
country 'MF', 'St Martin (French)' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'MG', 'Madagascar' do |c|
c.timezone 'Africa/Nairobi', -77, 60, 2209, 60
end
country 'MH', 'Marshall Islands' do |c|
c.timezone 'Pacific/Kwajalein', 109, 12, 502, 3, 'Kwajalein'
c.timezone 'Pacific/Tarawa', 17, 12, 173, 1, 'Gilberts, Marshalls, Wake'
end
country 'MK', 'North Macedonia' do |c|
c.timezone 'Europe/Belgrade', 269, 6, 41, 2
end
country 'ML', 'Mali' do |c|
c.timezone 'Africa/Abidjan', 319, 60, -121, 30
end
country 'MM', 'Myanmar (Burma)' do |c|
c.timezone 'Asia/Yangon', 1007, 60, 577, 6
end
country 'MN', 'Mongolia' do |c|
c.timezone 'Asia/Ulaanbaatar', 575, 12, 6413, 60, 'most of Mongolia'
c.timezone 'Asia/Hovd', 2881, 60, 1833, 20, 'Bayan-Ölgii, Hovd, Uvs'
end
country 'MO', 'Macau' do |c|
c.timezone 'Asia/Macau', 7991, 360, 2725, 24
end
country 'MP', 'Northern Mariana Islands' do |c|
c.timezone 'Pacific/Guam', 202, 15, 579, 4
end
country 'MQ', 'Martinique' do |c|
c.timezone 'America/Martinique', 73, 5, -733, 12
end
country 'MR', 'Mauritania' do |c|
c.timezone 'Africa/Abidjan', 319, 60, -121, 30
end
country 'MS', 'Montserrat' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'MT', 'Malta' do |c|
c.timezone 'Europe/Malta', 359, 10, 871, 60
end
country 'MU', 'Mauritius' do |c|
c.timezone 'Indian/Mauritius', -121, 6, 115, 2
end
country 'MV', 'Maldives' do |c|
c.timezone 'Indian/Maldives', 25, 6, 147, 2, 'Kerguelen, St Paul I, Amsterdam I'
end
country 'MW', 'Malawi' do |c|
c.timezone 'Africa/Maputo', -779, 30, 391, 12, 'Central Africa Time'
end
country 'MX', 'Mexico' do |c|
c.timezone 'America/Mexico_City', 97, 5, -1983, 20, 'Central Mexico'
c.timezone 'America/Cancun', 253, 12, -2603, 30, 'Quintana Roo'
c.timezone 'America/Merida', 629, 30, -5377, 60, 'Campeche, Yucatán'
c.timezone 'America/Monterrey', 77, 3, -6019, 60, 'Durango; Coahuila, Nuevo León, Tamaulipas (most areas)'
c.timezone 'America/Matamoros', 155, 6, -195, 2, 'Coahuila, Nuevo León, Tamaulipas (US border)'
c.timezone 'America/Chihuahua', 859, 30, -1273, 12, 'Chihuahua (most areas)'
c.timezone 'America/Ciudad_Juarez', 476, 15, -6389, 60, 'Chihuahua (US border - west)'
c.timezone 'America/Ojinaga', 887, 30, -1253, 12, 'Chihuahua (US border - east)'
c.timezone 'America/Mazatlan', 1393, 60, -1277, 12, 'Baja California Sur, Nayarit (most areas), Sinaloa'
c.timezone 'America/Bahia_Banderas', 104, 5, -421, 4, 'Bahía de Banderas'
c.timezone 'America/Hermosillo', 436, 15, -3329, 30, 'Sonora'
c.timezone 'America/Tijuana', 488, 15, -7021, 60, 'Baja California'
end
country 'MY', 'Malaysia' do |c|
c.timezone 'Asia/Kuching', 31, 20, 331, 3, 'Sabah, Sarawak'
c.timezone 'Asia/Singapore', 77, 60, 2077, 20, 'peninsular Malaysia, Concordia'
end
country 'MZ', 'Mozambique' do |c|
c.timezone 'Africa/Maputo', -779, 30, 391, 12, 'Central Africa Time'
end
country 'NA', 'Namibia' do |c|
c.timezone 'Africa/Windhoek', -677, 30, 171, 10
end
country 'NC', 'New Caledonia' do |c|
c.timezone 'Pacific/Noumea', -334, 15, 3329, 20
end
country 'NE', 'Niger' do |c|
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'NF', 'Norfolk Island' do |c|
c.timezone 'Pacific/Norfolk', -581, 20, 5039, 30
end
country 'NG', 'Nigeria' do |c|
c.timezone 'Africa/Lagos', 129, 20, 17, 5, 'West Africa Time'
end
country 'NI', 'Nicaragua' do |c|
c.timezone 'America/Managua', 243, 20, -5177, 60
end
country 'NL', 'Netherlands' do |c|
c.timezone 'Europe/Brussels', 305, 6, 13, 3
end
country 'NO', 'Norway' do |c|
c.timezone 'Europe/Berlin', 105, 2, 401, 30, 'most of Germany'
end
country 'NP', 'Nepal' do |c|
c.timezone 'Asia/Kathmandu', 1663, 60, 5119, 60
end
country 'NR', 'Nauru' do |c|
c.timezone 'Pacific/Nauru', -31, 60, 2003, 12
end
country 'NU', 'Niue' do |c|
c.timezone 'Pacific/Niue', -1141, 60, -2039, 12
end
country 'NZ', 'New Zealand' do |c|
c.timezone 'Pacific/Auckland', -553, 15, 5243, 30, 'New Zealand time'
c.timezone 'Pacific/Chatham', -879, 20, -3531, 20, 'Chatham Islands'
end
country 'OM', 'Oman' do |c|
c.timezone 'Asia/Dubai', 253, 10, 553, 10, 'Crozet'
end
country 'PA', 'Panama' do |c|
c.timezone 'America/Panama', 269, 30, -1193, 15, 'EST - ON (Atikokan), NU (Coral H)'
end
country 'PE', 'Peru' do |c|
c.timezone 'America/Lima', -241, 20, -1541, 20
end
country 'PF', 'French Polynesia' do |c|
c.timezone 'Pacific/Tahiti', -263, 15, -4487, 30, 'Society Islands'
c.timezone 'Pacific/Marquesas', -9, 1, -279, 2, 'Marquesas Islands'
c.timezone 'Pacific/Gambier', -347, 15, -2699, 20, 'Gambier Islands'
end
country 'PG', 'Papua New Guinea' do |c|
c.timezone 'Pacific/Port_Moresby', -19, 2, 883, 6, 'Papua New Guinea (most areas), Chuuk, Yap, Dumont d’Urville'
c.timezone 'Pacific/Bougainville', -373, 60, 4667, 30, 'Bougainville'
end
country 'PH', 'Philippines' do |c|
c.timezone 'Asia/Manila', 1094, 75, 108871, 900
end
country 'PK', 'Pakistan' do |c|
c.timezone 'Asia/Karachi', 373, 15, 1341, 20
end
country 'PL', 'Poland' do |c|
c.timezone 'Europe/Warsaw', 209, 4, 21, 1
end
country 'PM', 'St Pierre & Miquelon' do |c|
c.timezone 'America/Miquelon', 941, 20, -169, 3
end
country 'PN', 'Pitcairn' do |c|
c.timezone 'Pacific/Pitcairn', -376, 15, -1561, 12
end
country 'PR', 'Puerto Rico' do |c|
c.timezone 'America/Puerto_Rico', 11081, 600, -118991, 1800, 'AST - QC (Lower North Shore)'
end
country 'PS', 'Palestine' do |c|
c.timezone 'Asia/Gaza', 63, 2, 517, 15, 'Gaza Strip'
c.timezone 'Asia/Hebron', 473, 15, 7019, 200, 'West Bank'
end
country 'PT', 'Portugal' do |c|
c.timezone 'Europe/Lisbon', 2323, 60, -137, 15, 'Portugal (mainland)'
c.timezone 'Atlantic/Madeira', 979, 30, -169, 10, 'Madeira Islands'
c.timezone 'Atlantic/Azores', 566, 15, -77, 3, 'Azores'
end
country 'PW', 'Palau' do |c|
c.timezone 'Pacific/Palau', 22, 3, 8069, 60
end
country 'PY', 'Paraguay' do |c|
c.timezone 'America/Asuncion', -379, 15, -173, 3
end
country 'QA', 'Qatar' do |c|
c.timezone 'Asia/Qatar', 1517, 60, 773, 15
end
country 'RE', 'Réunion' do |c|
c.timezone 'Asia/Dubai', 253, 10, 553, 10, 'Crozet'
end
country 'RO', 'Romania' do |c|
c.timezone 'Europe/Bucharest', 1333, 30, 261, 10
end
country 'RS', 'Serbia' do |c|
c.timezone 'Europe/Belgrade', 269, 6, 41, 2
end
country 'RU', 'Russia' do |c|
| ruby | MIT | f73295c364520a6d99dc0d8135a3751e03a4c079 | 2026-01-04T17:51:12.680542Z | true |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/spec/api_spec.rb | spec/api_spec.rb | require 'spec_helper'
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/spec/parser_spec.rb | spec/parser_spec.rb | require "spec_helper"
describe Tumblargh::Parser do
subject { Tumblargh::Parser.new }
describe "given invalid input" do
it "should throw an error if there is an unclosed block" do
subject.html = <<-eos
{block:Text}
{block:Title}<h1>{Title}</h1>{block:Title}
<p>{Body}</p>
{/block:text}
eos
lambda { subject.tree }.should raise_error Tumblargh::ParserError
end
end
describe "given something that kinda looks like a tag but isn't" do
before do
subject.html = "<div>{CustomCSS</div>"
end
it "should NOT throw an error if there is a malformed tag" do
lambda { subject.tree }.should_not raise_error Tumblargh::ParserError
end
it "should generate the following tree" do
subject.tree.should == [[:Literal, "<div>"], [:Literal, "{"], [:Literal, "CustomCSS</div>"]]
end
end
describe "when given a bunch of css" do
before do
@input = <<-eos
.container{*zoom:1;margin:auto;width:960px;max-width:100%;position:relative}.container:after{content:"";display:table;clear:both}.dot-sprite,#clients .nav .dots li,#clients .nav .dots li.active,#fullscreen_nav .nav .dots li,#fullscreen_nav .nav .dots li.active{background:url("../images/dot-sa49b299bc4.png") no-repeat}body.index{min-width:1000px}body.fullscreen{overflow-x:hidden}#clients{height:461px;overflow:visible;background:#fff url("../images/homepage-clients-bg.png") repeat-x 0 0px}#clients .frame{width:958px;height:448px;margin:0 auto;position:relative;-moz-border-radius:7px;-webkit-border-radius:7px;-o-border-radius:7px;-ms-border-radius:7px;-khtml-border-radius:7px;border-radius:7px;-moz-box-shadow:#000 0px 1px 2px;-webkit-box-shadow:#000 0px 1px 2px;-o-box-shadow:#000 0px 1px 2px;box-shadow:#000 0px 1px 2px;background:#262626}
#title a{
text-decoration:none;
color:#fff;
font-weight:bold;
text-shadow: #fff 0px 1px 0px;
padding:0;
display:block;
}
#title b {height:93px;
width:36px;
position: absolute;
top:0px;
}
#title b.left {
background: url(http://static.tumblr.com/xsp9wak/Shikloi1h/background-title.png) top left;
left:-36px; }
#title b.right {right:-36px;}
eos
subject.html = @input
end
it "should NOT throw an error" do
lambda { subject.tree }.should_not raise_error Tumblargh::ParserError
end
it "its output should match its input" do
subject.to_s.should eql @input
end
end
describe "given a simple partial" do
before do
subject.html = <<-eos
{block:Text}
{block:Title}<h1>{Title}</h1>{/block:Title}
<p>{Body}</p>
{/block:text}
eos
end
it "should not contain any custom appearance options" do
subject.options.empty?.should be_true
end
it "should contain the following tree" do
expected = [
[:Literal, " "],
[:Block, "Text", {},
[:Block, "Title", {},
[:Literal, "<h1>"],
[:Tag, "Title"],
[:Literal, "</h1>"]
],
[:Literal, "<p>"],
[:Tag, "Body"],
[:Literal, "</p>\n "]
]
]
# Yes, Array.== Array is a deep value based comparison
subject.tree.should == expected
end
end
describe "given jake's solstice theme" do
before do
subject.html = open(File.join(FIXTURE_PATH, "themes", "solstice.html")).read
end
it "should contain the correct appearance options" do
subject.options.should == {
"image" => {
"background" => ""
},
"if" => {
"showpeopleifollow" => true,
"showmyportraitphoto" => true,
"showvialinkswithrebloggedposts" => true,
"useclassicpaging" => false,
"hidedisquscommentcountifzero" => false
},
"text" => {
"disqusshortname" => "",
"googleanalyticsid" => ""
}
}
end
it "should contain exacty one Posts block" do
matches = subject.tree.select do |n|
n[0] == :Block && n[1] == "Posts"
end
matches.size.should eql 1
end
end
describe "block arguments" do
context "with a single argument" do
before do
subject.html = <<-eos
{block:JumpPagination length="5"}
{block:CurrentPage}<span class="current-page">{PageNumber}</span>{/block:CurrentPage}
{/block:JumpPagination}
eos
end
it "should contain the following tree" do
expected = [
[:Literal, " "],
[:Block, "JumpPagination", { "length" => "5" },
[:Block, "CurrentPage", {},
[:Literal, "<span class=\"current-page\">"],
[:Tag, "PageNumber"],
[:Literal, "</span>"]
]
]
]
subject.tree.should == expected
end
end
context "with multiple arguments" do
before do
subject.html = <<-eos
{block:Something length="5" offset="2" foo="bar"}{/block:Something}
eos
end
it "should contain the following tree" do
expected = [
[:Literal, " "],
[:Block, "Something", { "length" => "5", "offset" => "2", "foo" => "bar" }]
]
subject.tree.should == expected
end
end
end
describe "tumblr-boilerplate" do
before do
# https://github.com/davesantos/tumblr-boilerplate/master/tumblr.html
subject.html = open(File.join(FIXTURE_PATH, "themes", "tumblr-boilerplate.html")).read
end
it "should contain exacty one Posts block" do
matches = subject.tree.select do |n|
n[0] == :Block && n[1] == "Posts"
end
matches.size.should eql 1
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/spec/tumblargh_spec.rb | spec/tumblargh_spec.rb | require 'spec_helper'
describe Tumblargh do
describe "specifying the source blog/data" do
it "should work with local blog data from a file" do
json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
blog = Tumblargh.send(:create_blog, json_path)
blog.should be_an_instance_of Tumblargh::Resource::Blog
blog.title.should eql "Tumblr Staff"
end
it "should work when passing in a hash" do
json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
json = ActiveSupport::JSON.decode(open(json_path).read)
blog = Tumblargh.send(:create_blog, json)
blog.should be_an_instance_of Tumblargh::Resource::Blog
blog.title.should eql "Tumblr Staff"
end
it "should work when passing in a Blog object" do
json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
json = ActiveSupport::JSON.decode(open(json_path).read)["response"]
obj = Tumblargh::Resource::Blog.new("#{json["blog"]["name"]}.tumblr.com", json)
blog = Tumblargh.send(:create_blog, obj)
blog.should be_an_instance_of Tumblargh::Resource::Blog
blog.title.should eql "Tumblr Staff"
end
it "should work by simply passing a tumblr domain" do
Tumblargh::API.set_api_key TUMBLR_API_KEY
blog = Tumblargh.send(:create_blog, "staff.tumblr.com")
blog.should be_an_instance_of Tumblargh::Resource::Blog
blog.title.should eql "Tumblr Staff"
Tumblargh::API.set_api_key nil
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/spec/resource_spec.rb | spec/resource_spec.rb | require 'spec_helper'
describe Tumblargh::Resource do
describe "using local data" do
before do
json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
@json = ActiveSupport::JSON.decode(open(json_path).read)["response"]
end
it "should not have to fall back to the API" do
Tumblargh::API.disable!
blog = Tumblargh::Resource::Blog.new("staff.tumblr.com", @json)
lambda { blog.posts }.should_not raise_error
Tumblargh::API.enable!
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/spec/spec_helper.rb | spec/spec_helper.rb | require 'rspec'
require 'open-uri'
# if something??!
# require 'simplecov'
# SimpleCov.start
# end
$: << File.dirname(__FILE__) + '/../lib'
require 'tumblargh'
FIXTURE_PATH = File.join(File.dirname(__FILE__), 'fixtures')
TUMBLR_API_KEY = '8QoLnQy4lP0rn6QHNYSDxmhZo0L6xelNmNosAVj703FNfLBhZQ'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
RSpec.configure do |config|
config.color_enabled = true
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/spec/renderer/blocks_spec.rb | spec/renderer/blocks_spec.rb | require 'spec_helper'
describe Tumblargh::Renderer::Blocks do
def capture_stdout(&block)
original_stdout = $stdout
$stdout = fake = StringIO.new
begin
yield
ensure
$stdout = original_stdout
end
fake.string
end
let(:parser) { Tumblargh::Parser.new }
describe "{block:PermalinkPage}" do
before do
parser.html = <<-eos
{block:PermalinkPage}
ERMAGERD PERMERLINK
{/block:PermalinkPage}
eos
end
it "should render its content when it is a permalink page" do
document = Tumblargh::Renderer::Document.new(parser.tree, nil, :permalink => true)
output = document.render
output.should match(/ERMAGERD PERMERLINK/)
end
it "should NOT render its content when it is a permalink page" do
document = Tumblargh::Renderer::Document.new(parser.tree, nil, :permalink => false)
output = document.render
output.should_not match(/ERMAGERD PERMERLINK/)
end
end
describe "boolean blocks" do
before do
parser.html = <<-eos
{block:IfSomethingOnByDefault}
PASS_ON
{/block:IfSomethingOnByDefault}
{block:IfSomethingOffByDefault}
FAIL_OFF
{/block:IfSomethingOffByDefault}
{block:IfNotSomethingOnByDefault}
FAIL_INVERSE_ON
{/block:IfNotSomethingOnByDefault}
{block:IfNotSomethingOffByDefault}
PASS_INVERSE_OFF
{/block:IfNotSomethingOffByDefault}
eos
end
let(:options) do
{
"if" => {
"somethingonbydefault" => true,
"somethingoffbydefault" => false
}
}
end
let(:output) { Tumblargh::Renderer::Document.new(parser.tree, nil, options).render }
it "should respect the default settings" do
output.should match(/PASS_ON/)
output.should_not match(/FAIL_OFF/)
end
it "inverse (IfNot) blocks should work" do
output.should_not match(/FAIL_INVERSE_ON/)
output.should match(/PASS_INVERSE_OFF/)
end
end
describe "using unsupported blocks" do
before do
parser.html = <<-eos
{block:ThisIsDefinitelyNotABlock}{/block:ThisIsDefinitelyNotABlock}
eos
end
it "should not raise an error" do
expect {
Tumblargh::Renderer::Document.new(parser.tree, nil, {}).render
}.not_to raise_error
end
it "should output a warning" do
out = capture_stdout {
Tumblargh::Renderer::Document.new(parser.tree, nil, {}).render
}
out.should =~ /WARNING: Unsupported block `Tumblargh::Renderer::Blocks::ThisIsDefinitelyNotABlock`/
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/spec/renderer/document_spec.rb | spec/renderer/document_spec.rb | require 'spec_helper'
describe Tumblargh::Renderer::Document do
describe "permalink pages" do
before do
@parser = Tumblargh::Parser.new
@parser.html = ""
@document = Tumblargh::Renderer::Document.new(@parser.tree, nil, :permalink => true)
end
it "the document should know this is a permalink page" do
@document.permalink?.should be_true
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/spec/renderer/blocks/posts_spec.rb | spec/renderer/blocks/posts_spec.rb | require 'spec_helper'
describe Tumblargh::Renderer::Blocks::Posts do
before do
json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
@json = ActiveSupport::JSON.decode(open(json_path).read)["response"].with_indifferent_access
end
it "should render the correct amount of posts" do
theme = "{block:Posts}!{/block:Posts}"
result = Tumblargh.render_html(theme, @json)
result.count("!").should eql @json[:posts].size
end
describe "{TagsAsClasses}" do
let(:post) { Tumblargh::Resource::Post.new({ tags: ["TROLOLOL", "Herp derp"] }, nil) }
subject { Tumblargh::Renderer::Blocks::Posts.new(nil, post) }
it "should give the tags as class names" do
subject.tags_as_classes.should eql "trololol herp_derp"
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/spec/resource/post_spec.rb | spec/resource/post_spec.rb | require 'spec_helper'
describe Tumblargh::Resource::Post do
before do
json_path = File.join(FIXTURE_PATH, "data", "staff.tumblr.com-2012-05-06", "posts.json")
@json = ActiveSupport::JSON.decode(open(json_path).read)["response"]
@blog = Tumblargh::Resource::Blog.new("staff.tumblr.com", @json)
@posts = @blog.posts
end
it "should have an instance of Time for its date attribute" do
@posts.each do |post|
post.date.should be_an_instance_of Time
end
end
it "should always return an array of tags" do
@posts.each do |post|
post.tags.should be_an_instance_of Array
end
end
it "should correctly parse the number of tags" do
@posts.each do |post|
post.tags.size.should eql post.attributes[:tags].size
end
end
it "should have the correct tag names" do
@posts.each do |post|
post.tags.map(&:name).should == post.attributes[:tags]
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/examples/middleman_config.rb | examples/middleman_config.rb | require 'tumblargh'
activate :tumblargh,
api_key: 'API KEY',
blog: 'staff.tumblr.com'
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh.rb | lib/tumblargh.rb | require 'active_support'
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/string/conversions'
require 'active_support/core_ext/time/conversions'
require 'active_support/inflector'
require 'tumblargh/version'
module Tumblargh
autoload :API, 'tumblargh/api'
autoload :Node, 'tumblargh/node'
autoload :Parser, 'tumblargh/parser'
autoload :Renderer, 'tumblargh/renderer'
autoload :Resource, 'tumblargh/resource'
class << self
attr_accessor :config
def render_file(file, blog, options={})
render(:file, file, blog, options)
end
def render_html(string, blog, options={})
render(:html, string, blog, options)
end
private
def render(setter, theme, blog, options)
parser = Parser.new
parser.send("#{setter}=", theme)
blog = create_blog blog
options = parser.options.merge(options)
Renderer::Document.new(parser.tree, blog, options).render
end
def create_blog(blog)
if blog.is_a? Resource::Blog
blog
elsif blog.is_a? Hash
create_blog_from_hash blog
elsif File.exists? blog
json = ActiveSupport::JSON.decode(open(blog).read)
create_blog_from_hash json
else
Resource::Blog.new(blog)
end
end
def create_blog_from_hash(hash)
hash = hash["response"] if hash.key? "response"
Resource::Blog.new("#{hash["blog"]["name"]}.tumblr.com", hash)
end
end
end
if Kernel.const_defined? :Middleman
require "middleman/extensions/tumblargh"
Middleman::Extensions.register(:tumblargh, Middleman::Extensions::Tumblargh)
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/rack/tumblargh.rb | lib/rack/tumblargh.rb | module Rack
class Tumblargh
def initialize(app, options={})
@app = app
@options = options
@options[:blog] = 'staff.tumblr.com' if @options[:blog].nil?
end
attr_reader :options
def call(env)
request = Rack::Request.new(env)
['/tweets.js', %r{/api.*}].each do |route|
if request.path.match route
url = "http://#{@options[:blog]}#{request.path}?#{request.query_string}"
return [301, { "Location" => url }, []]
end
end
status, headers, response = @app.call(env)
if should_parse?(status, headers)
content = response.respond_to?(:body) ? response.body : response
render_opts = { :permalink => permalink?(env['PATH_INFO']) }
headers.delete('Content-Length')
response = Rack::Response.new(
render(content, render_opts),
status,
headers
)
response.finish
response.to_a
else
[status, headers, response]
end
end
private
def permalink?(path)
!! path.match(/^\/post\/\d+/)
end
def should_parse?(status, headers)
status == 200 &&
headers["Content-Type"] &&
headers["Content-Type"].include?("text/html")
end
def render(content, opts)
::Tumblargh::render_html(content.first, options[:blog], opts)
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/middleman/extensions/tumblargh.rb | lib/middleman/extensions/tumblargh.rb | require 'rack/tumblargh'
module Middleman
module Extensions
module Tumblargh
class << self
def registered(app, options={})
::Tumblargh::API::set_api_key(options[:api_key])
app.after_configuration do
unless build?
use ::Rack::Tumblargh, options
end
end
end
alias :included :registered
end
end
end
# So, page proxies don't support globs or regex matching anymore, due to how the
# new Sitemap stuff works (at least as far as I can tell). This is what I came
# up with as a workaround.
module Sitemap
class Store
alias_method :orig_find_resource_by_destination_path, :find_resource_by_destination_path
def find_resource_by_destination_path(request_path)
request_path = "/index.html" if request_path.match(/^\/post\//)
orig_find_resource_by_destination_path(request_path)
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/resource.rb | lib/tumblargh/resource.rb | module Tumblargh
module Resource
autoload :Base, 'tumblargh/resource/base'
autoload :Blog, 'tumblargh/resource/blog'
autoload :Dialogue, 'tumblargh/resource/dialogue'
autoload :Note, 'tumblargh/resource/note'
autoload :Photo, 'tumblargh/resource/photo'
autoload :Post, 'tumblargh/resource/post'
autoload :Tag, 'tumblargh/resource/tag'
autoload :User, 'tumblargh/resource/user'
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/version.rb | lib/tumblargh/version.rb | module Tumblargh
VERSION = '0.2.2'.freeze
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/grammar.rb | lib/tumblargh/grammar.rb | # Autogenerated from a Treetop grammar. Edits may be lost.
module Tumblr
include Treetop::Runtime
def root
@root ||= :root
end
def _nt_root
start_index = index
if node_cache[:root].has_key?(index)
cached = node_cache[:root][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
i1 = index
r2 = _nt_block
if r2
r1 = r2
else
r3 = _nt_tag
if r3
r1 = r3
else
r4 = _nt_orphan
if r4
r1 = r4
else
r5 = _nt_literal
if r5
r1 = r5
else
@index = i1
r1 = nil
end
end
end
end
if r1
s0 << r1
else
break
end
end
r0 = instantiate_node(Tumblargh::Node::Root,input, i0...index, s0)
node_cache[:root][start_index] = r0
r0
end
module Block0
def block_start
elements[0]
end
def block_end
elements[2]
end
end
def _nt_block
start_index = index
if node_cache[:block].has_key?(index)
cached = node_cache[:block][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
r1 = _nt_block_start
s0 << r1
if r1
s2, i2 = [], index
loop do
i3 = index
r4 = _nt_block
if r4
r3 = r4
else
r5 = _nt_tag
if r5
r3 = r5
else
r6 = _nt_orphan
if r6
r3 = r6
else
r7 = _nt_literal
if r7
r3 = r7
else
@index = i3
r3 = nil
end
end
end
end
if r3
s2 << r3
else
break
end
end
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
s0 << r2
if r2
r8 = _nt_block_end
s0 << r8
end
end
if s0.last
r0 = instantiate_node(Tumblargh::Node::Block,input, i0...index, s0)
r0.extend(Block0)
else
@index = i0
r0 = nil
end
node_cache[:block][start_index] = r0
r0
end
module BlockStart0
def block_name
elements[1]
end
end
def _nt_block_start
start_index = index
if node_cache[:block_start].has_key?(index)
cached = node_cache[:block_start][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
if has_terminal?('{block:', false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 7))
@index += 7
else
terminal_parse_failure('{block:')
r1 = nil
end
s0 << r1
if r1
r2 = _nt_block_name
s0 << r2
if r2
r4 = _nt_space
if r4
r3 = r4
else
r3 = instantiate_node(SyntaxNode,input, index...index)
end
s0 << r3
if r3
r6 = _nt_block_arguments
if r6
r5 = r6
else
r5 = instantiate_node(SyntaxNode,input, index...index)
end
s0 << r5
if r5
if has_terminal?('}', false, index)
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure('}')
r7 = nil
end
s0 << r7
if r7
r9 = _nt_space
if r9
r8 = r9
else
r8 = instantiate_node(SyntaxNode,input, index...index)
end
s0 << r8
end
end
end
end
end
if s0.last
r0 = instantiate_node(Tumblargh::Node::BlockStart,input, i0...index, s0)
r0.extend(BlockStart0)
else
@index = i0
r0 = nil
end
node_cache[:block_start][start_index] = r0
r0
end
module BlockEnd0
def block_name
elements[1]
end
end
def _nt_block_end
start_index = index
if node_cache[:block_end].has_key?(index)
cached = node_cache[:block_end][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
if has_terminal?('{/block:', false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 8))
@index += 8
else
terminal_parse_failure('{/block:')
r1 = nil
end
s0 << r1
if r1
r2 = _nt_block_name
s0 << r2
if r2
if has_terminal?('}', false, index)
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure('}')
r3 = nil
end
s0 << r3
if r3
r5 = _nt_space
if r5
r4 = r5
else
r4 = instantiate_node(SyntaxNode,input, index...index)
end
s0 << r4
end
end
end
if s0.last
r0 = instantiate_node(Tumblargh::Node::BlockEnd,input, i0...index, s0)
r0.extend(BlockEnd0)
else
@index = i0
r0 = nil
end
node_cache[:block_end][start_index] = r0
r0
end
def _nt_block_name
start_index = index
if node_cache[:block_name].has_key?(index)
cached = node_cache[:block_name][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?('\G[^\\s}:;]', true, index)
r1 = true
@index += 1
else
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
end
node_cache[:block_name][start_index] = r0
r0
end
def _nt_block_arguments
start_index = index
if node_cache[:block_arguments].has_key?(index)
cached = node_cache[:block_arguments][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
r1 = _nt_block_argument
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
end
node_cache[:block_arguments][start_index] = r0
r0
end
module BlockArgument0
end
module BlockArgument1
end
def _nt_block_argument
start_index = index
if node_cache[:block_argument].has_key?(index)
cached = node_cache[:block_argument][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
i1, s1 = index, []
s2, i2 = [], index
loop do
if has_terminal?('\G[a-zA-Z0-9]', true, index)
r3 = true
@index += 1
else
r3 = nil
end
if r3
s2 << r3
else
break
end
end
if s2.empty?
@index = i2
r2 = nil
else
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
end
s1 << r2
if r2
if has_terminal?('=', false, index)
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure('=')
r4 = nil
end
s1 << r4
if r4
if has_terminal?('"', false, index)
r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure('"')
r5 = nil
end
s1 << r5
if r5
s6, i6 = [], index
loop do
if has_terminal?('\G[a-zA-Z0-9]', true, index)
r7 = true
@index += 1
else
r7 = nil
end
if r7
s6 << r7
else
break
end
end
if s6.empty?
@index = i6
r6 = nil
else
r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
end
s1 << r6
if r6
if has_terminal?('"', false, index)
r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure('"')
r8 = nil
end
s1 << r8
end
end
end
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1.extend(BlockArgument0)
else
@index = i1
r1 = nil
end
s0 << r1
if r1
r10 = _nt_space
if r10
r9 = r10
else
r9 = instantiate_node(SyntaxNode,input, index...index)
end
s0 << r9
end
if s0.last
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(BlockArgument1)
else
@index = i0
r0 = nil
end
node_cache[:block_argument][start_index] = r0
r0
end
module Tag0
def tag_name
elements[1]
end
end
def _nt_tag
start_index = index
if node_cache[:tag].has_key?(index)
cached = node_cache[:tag][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
if has_terminal?('{', false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure('{')
r1 = nil
end
s0 << r1
if r1
r2 = _nt_tag_name
s0 << r2
if r2
if has_terminal?('}', false, index)
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure('}')
r3 = nil
end
s0 << r3
end
end
if s0.last
r0 = instantiate_node(Tumblargh::Node::Tag,input, i0...index, s0)
r0.extend(Tag0)
else
@index = i0
r0 = nil
end
node_cache[:tag][start_index] = r0
r0
end
module TagName0
end
def _nt_tag_name
start_index = index
if node_cache[:tag_name].has_key?(index)
cached = node_cache[:tag_name][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
s1, i1 = [], index
loop do
if has_terminal?('\G[a-zA-Z0-9]', true, index)
r2 = true
@index += 1
else
r2 = nil
end
if r2
s1 << r2
else
break
end
end
if s1.empty?
@index = i1
r1 = nil
else
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
end
s0 << r1
if r1
if has_terminal?(':', false, index)
r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure(':')
r4 = nil
end
if r4
r3 = r4
else
r3 = instantiate_node(SyntaxNode,input, index...index)
end
s0 << r3
if r3
s5, i5 = [], index
loop do
if has_terminal?('\G[^\\n:/{};\\[\\]\\(\\)]', true, index)
r6 = true
@index += 1
else
r6 = nil
end
if r6
s5 << r6
else
break
end
end
r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
s0 << r5
end
end
if s0.last
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(TagName0)
else
@index = i0
r0 = nil
end
node_cache[:tag_name][start_index] = r0
r0
end
module Orphan0
end
def _nt_orphan
start_index = index
if node_cache[:orphan].has_key?(index)
cached = node_cache[:orphan][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
if has_terminal?('{', false, index)
r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure('{')
r1 = nil
end
s0 << r1
if r1
i2 = index
if has_terminal?('/', false, index)
r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure('/')
r3 = nil
end
if r3
r2 = nil
else
@index = i2
r2 = instantiate_node(SyntaxNode,input, index...index)
end
s0 << r2
end
if s0.last
r0 = instantiate_node(Tumblargh::Node::Literal,input, i0...index, s0)
r0.extend(Orphan0)
else
@index = i0
r0 = nil
end
node_cache[:orphan][start_index] = r0
r0
end
def _nt_literal
start_index = index
if node_cache[:literal].has_key?(index)
cached = node_cache[:literal][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?('\G[^{]', true, index)
r1 = true
@index += 1
else
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(Tumblargh::Node::Literal,input, i0...index, s0)
end
node_cache[:literal][start_index] = r0
r0
end
def _nt_space
start_index = index
if node_cache[:space].has_key?(index)
cached = node_cache[:space][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
if has_terminal?('\G[\\s]', true, index)
r1 = true
@index += 1
else
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
end
node_cache[:space][start_index] = r0
r0
end
end
class TumblrParser < Treetop::Runtime::CompiledParser
include Tumblr
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/node.rb | lib/tumblargh/node.rb | module Tumblargh
module Node
autoload :Base, 'tumblargh/node/base'
autoload :Block, 'tumblargh/node/block'
autoload :BlockEnd, 'tumblargh/node/block_end'
autoload :BlockStart, 'tumblargh/node/block_start'
autoload :HtmlStyleTag, 'tumblargh/node/html_style_tag'
autoload :Literal, 'tumblargh/node/literal'
autoload :Root, 'tumblargh/node/root'
autoload :Tag, 'tumblargh/node/tag'
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/parser.rb | lib/tumblargh/parser.rb | require 'treetop'
require 'open-uri'
require 'nokogiri'
module Tumblargh
class ParserError < StandardError
end
class Parser
grammar_file = File.join(File.dirname(__FILE__), 'grammar')
if File.exists?("#{grammar_file}.rb")
require "#{grammar_file}.rb"
else
Treetop.load("#{grammar_file}.treetop")
end
@@parser = TumblrParser.new
def initialize(template=nil)
self.file = template
end
attr_reader :file
def file=(file)
@file = file
@html = nil
@structure = nil
@tree = nil
@config = nil
end
def html=(html)
self.file = nil
@html = html
end
def html
@html ||= open(@file).read
end
def tree
@tree ||= parse
end
def options
@options ||= extract_options
end
def to_s
parse unless @structure
@structure.to_s
end
private
def parse
@structure = @@parser.parse(html)
if @structure.nil?
raise ParserError, @@parser.failure_reason
end
@tree = @structure.to_tree
end
def extract_options
opts = {}.with_indifferent_access
doc = Nokogiri::HTML(html)
doc.css('meta[name*=":"]').each do |meta|
type, variable = meta['name'].downcase.split(':')
variable.gsub!(/\s/, '')
default = meta['content']
default = case type
when "if"
default == "1"
else
default
end
opts[type] ||= {}
opts[type][variable] = default
end
opts
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/api.rb | lib/tumblargh/api.rb | require 'active_support'
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/object/to_query'
require 'active_support/json'
require 'api_cache'
require 'open-uri'
module Tumblargh
module API
API_ROOT = 'http://api.tumblr.com/v2/blog/'
@enabled = true
class << self
attr_accessor :api_key
alias_method :set_api_key, :api_key=
def fetch(path, query={})
raise "API is disabled" unless enabled?
query = query.merge(:api_key => api_key).to_query
url = "#{API_ROOT}#{path}?#{query}"
resp = APICache.get(url) { open(url).read }
ActiveSupport::JSON.decode(resp)['response']
end
def blog(domain)
fetch("#{domain}/info")['blog']
end
def posts(domain, query={})
fetch("#{domain}/posts")['posts']
end
def notes(domain, query)
query.merge!(:notes_info => 'true')
fetch("#{domain}/posts", query)['posts'][0]['notes']
end
def enable!
@enabled = true
end
def disable!
@enabled = false
end
def enabled?
@enabled
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer.rb | lib/tumblargh/renderer.rb | require 'cgi'
require 'tumblargh/renderer/base'
require 'tumblargh/renderer/blocks'
require 'tumblargh/renderer/document'
require 'tumblargh/renderer/literal'
require 'tumblargh/renderer/tag'
module Tumblargh
module Renderer
def self.factory(node, context, options = {})
args = []
base = node.first.to_s
if base == 'Block'
block_name = node[1]
if block_name[0..1] == 'If'
if block_name[2..4] == 'Not'
args << block_name[5..block_name.size]
block_name = 'InverseBoolean'
else
args << block_name[2..block_name.size]
block_name = 'Boolean'
end
elsif n_post = block_name.match(/Post(\d+)/)
block_name = 'NumberedPost'
args << n_post[1].to_i
end
base = "Blocks::#{ block_name }"
end
klass_name = "Tumblargh::Renderer::#{ base }"
begin
klass = klass_name.constantize
klass.new(node, context, options, *args)
rescue NameError => e
puts "WARNING: Unsupported block `#{ klass_name }`"
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/tag.rb | lib/tumblargh/renderer/tag.rb | module Tumblargh
module Renderer
class Tag < Base
def render
# {PhotoURL-500} becomes photo_url(500)
tag, *args = node[1].split('-')
context.send tag.underscore, *args
end
end
class CustomTag < Tag
def method_name
self.class.name.demodulize.sub('Tag', '').downcase
end
def render
context.send(method_name, node[1].split(':').last)
end
end
class ColorTag < CustomTag
end
class ImageTag < CustomTag
end
class FontTag < CustomTag
end
class TextTag < CustomTag
end
class LangTag < CustomTag
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks.rb | lib/tumblargh/renderer/blocks.rb | module Tumblargh
module Renderer
module Blocks
require 'tumblargh/renderer/blocks/base'
class Description < Base
def should_render?
!description.blank?
end
end
class NumberedPost < Base
attr_reader :num
def initialize(node, context, *args)
@num = args[0]
super(node, context)
end
def should_render?
num == context.posts.index(context_post) + 1
end
end
# Common post blocks
class Title < Base
def should_render?
!(title.nil? || title.blank?)
end
end
class Caption < Base
def should_render?
!(caption.nil? || caption.blank?)
end
end
# Base post type
class Post < Base
def should_render?
self.class.name.demodulize.downcase == context.type
end
end
# Source block for Quote posts
class Source < Base
def should_render?
!source.blank?
end
def source
context.source
end
end
class Text < Post
end
class Photo < Post
def should_render?
context_post.type == 'photo' && context_post.photos.size == 1
end
def photo_alt
strip_html(context.caption)
end
end
class Video < Photo
end
class Quote < Post
def quote
context.text
end
end
class Chat < Post
end
class Link < Post
end
# Meta-block for Appearance booleans, like {block:IfSomething}
class Boolean < Base
attr_reader :variable
def initialize(node, context, options = {}, *args)
@variable = args[0]
super(node, context, options)
end
def should_render?
context.boolean(variable.downcase)
end
end
class InverseBoolean < Boolean
def should_render?
! super
end
end
# Rendered on permalink pages. (Useful for displaying the current post's
# title in the page title)
class PostTitle < Base
def should_render?
false
end
def post_title
# TODO: Implementation
end
end
# Identical to {PostTitle}, but will automatically generate a summary
# if a title doesn't exist.
class PostSummary < PostTitle
def post_summary
# TODO: Implementation
end
end
class ContentSource < Base
def should_render?
!source_title.nil?
end
contextual_tag :source_url
contextual_tag :source_title
# TODO: Impl.
def black_logo_url
end
def logo_width
end
def logo_height
end
end
class SourceLogo < Base
# TODO: Impl.
end
class NoSourceLogo < SourceLogo
def should_render?
! super
end
end
class HasTags < Base
def should_render?
!(tags.nil? || tags.blank?)
end
end
# Rendered on index (post) pages.
class IndexPage < Base
def should_render?
! context.permalink?
end
end
# Rendered on post permalink pages.
class PermalinkPage < Base
def should_render?
context.permalink?
end
end
class SearchPage < Base
def should_render?
false
end
end
class NoSearchResults < Base
def should_render?
false
end
end
class TagPage < Base
def should_render?
false
end
end
# Rendered if you have defined any custom pages.
class HasPages < Base
# TODO: Implementation
def should_render?
false
end
end
# Rendered for each custom page.
class Pages < Base
# TODO: Implementation
def should_render?
false
end
# custom page url
def url
end
# custom page name/label
def label
end
end
# Rendered if you have Twitter integration enabled.
class Twitter < Base
# TODO: Implementation
def should_render?
false
end
def twitter_username
end
end
# {block:Likes} {/block:Likes} Rendered if you are sharing your likes.
# {Likes} Standard HTML output of your likes.
# {Likes limit="5"} Standard HTML output of your last 5 likes.
# Maximum: 10
# {Likes width="200"} Standard HTML output of your likes with Audio and Video players scaled to 200-pixels wide.
# Scale images with CSS max-width or similar.
# {Likes summarize="100"} Standard HTML output of your likes with text summarize to 100-characters.
# Maximum: 250
class Likes < Base
# TODO: Implementation
def should_render?
false
end
def likes
end
end
require 'tumblargh/renderer/blocks/answer'
require 'tumblargh/renderer/blocks/audio'
require 'tumblargh/renderer/blocks/chat'
require 'tumblargh/renderer/blocks/dates'
require 'tumblargh/renderer/blocks/navigation'
require 'tumblargh/renderer/blocks/notes'
require 'tumblargh/renderer/blocks/photoset'
require 'tumblargh/renderer/blocks/posts'
require 'tumblargh/renderer/blocks/reblogs'
require 'tumblargh/renderer/blocks/tags'
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/literal.rb | lib/tumblargh/renderer/literal.rb | module Tumblargh
module Renderer
class Literal < Base
def render
node[1]
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/base.rb | lib/tumblargh/renderer/base.rb | module Tumblargh
module Renderer
class Base
class << self
# Define a simple tag on the block.
# Name being tag name, and optionally the attibute/method to call
# on the context. If the second argument is left off, it'll just use the tag name.
def contextual_tag(name, attribute=nil)
class_eval do
define_method name do
context.send(attribute || name)
end
end
end
end
attr_reader :node, :options
attr_accessor :context
alias_method :config, :options # Backwards compatibility with old Document rendere
def initialize(node, context, options = {})
@node = node
@context = context
@options = options.with_indifferent_access
end
def context_post
real_post = context
while not real_post.is_a?(::Tumblargh::Resource::Post)
real_post = real_post.context
end
real_post
end
def escape_html(str)
CGI.escapeHTML(str)
end
def escape_url(url)
CGI.escape(url)
end
def strip_html(str)
str.gsub(/<\/?[^>]*>/, '')
end
def render
end
alias_method :to_s, :render
def method_missing(method, *arguments)
raise "Can't find anything to do with '#{method}'" if context.nil?
context.send(method, *arguments)
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/document.rb | lib/tumblargh/renderer/document.rb | module Tumblargh
module Renderer
class Document < Base
# Are we rendering a permalink page?
def permalink?
options[:permalink] == true
end
# TAGS ----------
contextual_tag :title
contextual_tag :description
def meta_description
strip_html(description)
strip_html(description)
end
def favicon
# TODO
''
end
def rss
"#{context.url}rss"
end
# Appearance options
# http://www.tumblr.com/docs/en/custom_themes#appearance-options
def color(key)
custom_value_for_type :color, key
end
def font(key)
custom_value_for_type :font, key
end
def image(key)
custom_value_for_type :image, key
end
def text(key)
custom_value_for_type :text, key
end
def boolean(key)
custom_value_for_type :if, key
end
def custom_value_for_type(type, key)
config[type][key] rescue raise "No appearance option for #{type}:#{key}"
end
# END TAGS ------
def render
node.map do |n|
renderer = Renderer.factory(n, self)
renderer.render unless renderer.nil?
end.flatten.join('')
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/notes.rb | lib/tumblargh/renderer/blocks/notes.rb | module Tumblargh
module Renderer
module Blocks
# Rendered on permalink pages if this post has notes.
class PostNotes < Base
def should_render?
context.permalink? && note_count > 0
end
def note_count
context_post.note_count || 0
end
def post_notes
buf = ['<ol class="notes">']
# TODO: Support notes with_commentary
buf << context_post.notes.map do |note|
classes = "note without_commentary #{note.type}"
action = case note.type
when 'like'
'liked this'
when 'reblog'
'reblogged this from somewhere?'
end
<<-eos
<li class='#{classes}'>
<a href="#{note.blog_url}" title="" rel="nofollow">
<img src="http://assets.tumblr.com/images/default_avatar_16.gif" class="avatar" alt="">
</a>
<span class="action">
<a href="#{note.blog_url}" title="" rel="nofollow">#{note.blog_name}</a>
#{action}
</span>
<div class="clear"></div>
</li>
eos
end.join("\n")
buf << '</ol>'
buf.join ''
end
end
# Rendered if this post has notes.
# Always wrap note counts in this block so they will be properly hidden on non-post pages.
class NoteCount < Base
def should_render?
note_count > 0
end
def note_count
context_post.note_count || 0
end
def note_count_with_label
count = note_count
"#{ count } note#{ count == 1 ? '' : 's' }"
end
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/answer.rb | lib/tumblargh/renderer/blocks/answer.rb | module Tumblargh
module Renderer
module Blocks
class Answer < Post
contextual_tag :question
contextual_tag :answer
def asker
if asking_name == 'anonymous'
'Anonymous'
else
"<a href='#{asking_url}'>#{asking_name}</a>"
end
end
def asker_portrait_url(size)
end
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/reblogs.rb | lib/tumblargh/renderer/blocks/reblogs.rb | module Tumblargh
module Renderer
module Blocks
# TODO: Impl.
# Rendered if a post was reblogged from another post.
class RebloggedFrom < Base
def should_render?
false
end
def reblog_parent_name
end
def reblog_parent_title
end
def reblog_parent_url
end
def reblog_parent_portrait_url(size)
end
def reblog_root_name
end
def reblog_root_title
end
def reblog_root_portrait_url(size)
end
end
class NotReblog < Base
def should_render?
true
end
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/posts.rb | lib/tumblargh/renderer/blocks/posts.rb | module Tumblargh
module Renderer
module Blocks
# Posts Loop
#
# {block:Posts} is executed once for each post. Some post related tags can
# exist outside of a `type` block, such as {Title} or {Permalink}, so
# they should be defined here
class Posts < Base
contextual_tag :post_id, :id
contextual_tag :post_type, :type
contextual_tag :title
contextual_tag :caption
def permalink
url = context.post_url
url.gsub(/^http:\/\/[^\/]+/, '')
end
def permalink?
context.permalink?
end
def post_notes_url
# http://bikiniatoll.tumblr.com/notes/1377511430/vqS0xw8sm
"/notes/#{context.id}/"
end
def reblog_url
"/reblog/#{context.reblog_key}"
end
# An HTML class-attribute friendly list of the post's tags.
# Example: "humor office new_york_city"
#
# By default, an HTML friendly version of the source domain of imported
# posts will be included. This may not behave as expected with feeds
# like Del.icio.us that send their content URLs as their permalinks.
# Example: "twitter_com", "digg_com", etc.
#
# The class-attribute "reblog" will be included automatically if the
# post was reblogged from another post.
def tags_as_classes
context.tags.map do |tag|
tag.name.titlecase.gsub(/\s+/, '').underscore.downcase
end.join " "
end
def render
if context.is_a? Resource::Post
super
else
posts = permalink? ? [context.posts.first] : context.posts
posts.map do |post|
post.context = self
self.class.new(node, post).render
end.flatten.join('')
end
end
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/photoset.rb | lib/tumblargh/renderer/blocks/photoset.rb | module Tumblargh
module Renderer
module Blocks
class Photoset < Photo
def should_render?
context_post.type == 'photoset' && context_post.photos.size > 1
end
end
# Rendered for each of the Photoset photos
class Photos < Base
def render
if context.is_a? Resource::Photo
super
else
context.photos.map do |photo|
photo.context = self
self.class.new(node, photo).render
end.flatten.join('')
end
end
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/chat.rb | lib/tumblargh/renderer/blocks/chat.rb | module Tumblargh
module Renderer
module Blocks
class Lines < Base
contextual_tag :label
contextual_tag :name
contextual_tag :line, :phrase
# "odd" or "even" for each line of this post.
# TODO Implementation
def alt
end
# A unique identifying integer representing the user of the current line of this post.
# TODO Implementation
def user_number
end
def render
if context.is_a? Resource::Dialogue
super
else
context.dialogue.map do |l|
l.context = self
self.class.new(node, l).render
end.flatten.join('')
end
end
end
class Label < Base
should_render_unless_blank :label
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/base.rb | lib/tumblargh/renderer/blocks/base.rb | module Tumblargh
module Renderer
module Blocks
class Base < Renderer::Base
class << self
attr_accessor :should_render_if
alias_method :should_render_unless_blank, :should_render_if=
alias_method :should_render_unless_empty, :should_render_if=
end
def should_render?
if defined?(@should_render_if)
val = send(@should_render_if)
return !(val || val.nil? || (val.respond_to?(:blank?) ? val.blank? : val.empty?))
end
true
end
def render
return '' unless should_render?
_, type, options, *nodes = node
res = nodes.map do |n|
renderer = Renderer.factory(n, self, options)
renderer.render unless renderer.nil?
end
" #{ res.join('') } "
end
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/navigation.rb | lib/tumblargh/renderer/blocks/navigation.rb | module Tumblargh
module Renderer
module Blocks
# TODO: Impl.
# Rendered if there is a "previous" page (newer posts) to navigate to.
class PreviousPage < Base
def previous_page
end
end
# Rendered if there is a "next" page (older posts) to navigate to.
class NextPage < Base
def next_page
end
end
# Rendered if there is a "previous" or "next" page.
class Pagination < Base
end
# undocumented??
class PermalinkPagination < Base
end
class PreviousPost < Base
def previous_post
end
end
class NextPost < Base
def next_post
end
end
# {block:JumpPagination length="5"} {/block:JumpPagination}
# Rendered for each page greater than the current page minus one-half length up to current page plus one-half length.
class JumpPagination < Base
end
# Rendered when jump page is not the current page.
class JumpPage < Base
def url
end
def page_number
end
end
# Rendered when jump page is the current page.
class CurrentPage < JumpPage
end
# Rendered if Submissions are enabled.
class SubmissionsEnabled < Base
end
# Rendered if Submissions are enabled.
class AskEnabled < Base
def should_render?
true
end
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/dates.rb | lib/tumblargh/renderer/blocks/dates.rb | # require 'action_view/helpers/date_helper'
module Tumblargh
module Renderer
module Blocks
# Rendered for all posts.
# Always wrap dates in this block so they will be properly hidden on non-post pages.
class Date < Base
MAP = {
# Tumblr tag => strftime symbol
:day_of_month => '-d',
:day_of_month_with_zero => :d,
:day_of_week => :A,
:short_day_of_week => :a,
:day_of_week_number => :u,
:day_of_year => '-j',
:week_of_year => '-V',
:month => :B,
:short_month => :b,
:month_number => '-m',
:month_number_with_zero => :m
}
MAP.each_pair do |tag, sym|
define_method tag do
context.date.strftime("%#{sym}")
end
end
def day_of_month_suffix
day_of_month.ordinalize
end
def year
date.year
end
def short_year
year.to_s[2..4]
end
def time_ago
# ActionView::Helpers::DateHelper::time_ago_in_words(date)
"1 day ago"
end
end
# Rendered for posts that are the first to be listed for a given day.
class NewDayDate < Base
end
# Rendered for subsequent posts listed for a given day.
class SameDayDate < Base
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/audio.rb | lib/tumblargh/renderer/blocks/audio.rb | module Tumblargh
module Renderer
module Blocks
class Audio < Post
def audio_player(color=:default)
html = context.player
return html if color == :default
map = { :white => 'FFFFFF', :grey => 'CCCCCC', :black => '000000' }
color = map[color] unless map[color].nil?
html.gsub(/color=[A-Z]{6}/i, "color=#{color}")
end
def audio_player_white
audio_player(:white)
end
def audio_player_grey
audio_player(:grey)
end
def audio_player_black
audio_player(:black)
end
# def raw_audio_url
# context.player.match(/audio_file=([^&]+)/)[1] rescue nil
# end
contextual_tag :raw_audio_url, :audio_url
contextual_tag :play_count, :plays
# TODO
def formatted_play_count
play_count.to_s.reverse.scan(/.{1,3}/).join(',').reverse
end
def play_count_with_label
num = formatted_play_count
"#{num} play#{num == 1 ? '' : 's'}"
end
end
class AlbumArt < Base
should_render_unless_blank :album_art_url
contextual_tag :album_art_url, :album_art
end
class Artist < Base
should_render_unless_blank :artist
contextual_tag :artist
end
class Album < Base
should_render_unless_blank :album
contextual_tag :album
end
class TrackName < Base
should_render_unless_blank :track_name
contextual_tag :track_name
end
class AudioEmbed < Base
end
class AudioPlayer < Base
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/renderer/blocks/tags.rb | lib/tumblargh/renderer/blocks/tags.rb | module Tumblargh
module Renderer
module Blocks
# Rendered for each of a post's tags.
class Tags < Base
def tag
context.name
end
def url_safe_tag
escape_url(tag)
end
def tag_url
"/tagged/#{url_safe}"
end
def tag_url_chrono
"#{tag_url}/chrono"
end
def render
if context.is_a? Resource::Tag
super
else
context.tags.map do |tag|
tag.context = self
self.class.new(node, tag).render
end.flatten.join('')
end
end
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/resource/tag.rb | lib/tumblargh/resource/tag.rb | module Tumblargh
module Resource
class Tag < Base
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/resource/base.rb | lib/tumblargh/resource/base.rb | module Tumblargh
module Resource
class Base
# Needed by renderer for context propagation
attr_accessor :context
def initialize(attrs={})
self.attributes = attrs
end
attr_reader :attributes
def attributes=(attrs)
@attributes = attrs.with_indifferent_access
end
def method_missing(method_symbol, *arguments)
method_name = method_symbol.to_s
if method_name =~ /(=|\?)$/
case $1
when "="
attributes[$`] = arguments.first
when "?"
attributes[$`]
end
else
return attributes[method_name] if attributes.include?(method_name)
# propagating renderer context
return context.send(method_symbol, *arguments) unless context.nil?
end
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/resource/note.rb | lib/tumblargh/resource/note.rb | module Tumblargh
module Resource
class Note < Base
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/resource/post.rb | lib/tumblargh/resource/post.rb | module Tumblargh
module Resource
class Post < Base
def initialize(attrs, blog)
@blog = blog
super(attrs)
end
def type
if @attributes[:type] == 'photo'
photos.size > 1 ? 'photoset' : 'photo'
else
@attributes[:type]
end
end
# Override method_missing so this does not propagate
def title
@attributes[:title]
end
def date
@date ||= @attributes[:date].to_time
end
def photo_url(size=500)
return nil if (photos.nil? || photos.empty?)
photos.first.photo_url size
end
def video(size=500)
return nil if (player.nil? || player.empty?)
size = size.to_i
res = player.select do |p|
p[:width] == size
end
res.empty? ? nil : res.first[:embed_code]
end
def tags
@tags ||= @attributes[:tags].map do |t|
Tag.new({ :name => t })
end
end
def notes
@notes || self.notes = API.notes(@blog.domain, :id => id)
@notes
end
def notes=(ary)
@notes = ary.map { |n| Note.new(n) }
end
def dialogue
@dialogue ||= (@attributes[:dialogue] || []).map { |t| Dialogue.new(t) }
end
def photos
@photos ||= (@attributes[:photos] || []).map { |p| Photo.new(p) }
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/resource/dialogue.rb | lib/tumblargh/resource/dialogue.rb | module Tumblargh
module Resource
class Dialogue < Base
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/resource/blog.rb | lib/tumblargh/resource/blog.rb | module Tumblargh
module Resource
class Blog < Base
attr_accessor :domain
def initialize(domain, attrs=nil)
@domain = domain
self.attributes = attrs.nil? ? fetch : attrs
end
def attributes=(attrs)
attrs = attrs.with_indifferent_access
# We passed in result from /posts, or a local file
if attrs.include?(:posts) && attrs.include?(:blog)
self.posts = attrs[:posts]
attrs.delete(:posts)
self.attributes = attrs[:blog]
else
super(attrs)
end
@attributes
end
def fetch
API.blog(domain)
end
def fetch!
self.attributes = fetch
end
def posts
@posts || self.posts = API.posts(domain)
@posts # Whyyy??? Must I do this?
end
def posts=(ary)
@posts = ary.map { |p| Post.new(p, self) }
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/resource/photo.rb | lib/tumblargh/resource/photo.rb | module Tumblargh
module Resource
class Photo < Base
def photo_url(size=500)
size = size.to_i
res = alt_sizes.select do |p|
p[:width] == size
end
res.empty? ? original_size[:url] : res.first[:url]
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/resource/user.rb | lib/tumblargh/resource/user.rb | module Tumblargh
module Resource
class User < Base
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/node/tag.rb | lib/tumblargh/node/tag.rb | module Tumblargh
module Node
class Tag < Base
def type
return @type if defined?(@type)
n = name.split(':')
if n.size == 2
@type = "#{n.first.camelize.to_sym}Tag"
if @type == 'BlockTag'
raise ParserError, "There's an unclosed block somewhere near `#{name}`"
end
@type
else
super
end
end
def name
elements[1].text_value
end
def to_tree
return [type, name]
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/node/block_end.rb | lib/tumblargh/node/block_end.rb | module Tumblargh
module Node
class BlockEnd < Base
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/node/block_start.rb | lib/tumblargh/node/block_start.rb | module Tumblargh
module Node
class BlockStart < Base
def name
str = elements[1].text_value
"#{str[0].upcase}#{str[1..str.size]}"
end
def options
arguments = elements[3]
return {} if arguments.nil? || arguments.elements.nil?
arguments.elements.inject({}) do |memo, node|
nodes = node.elements.first.elements
k = nodes[0].text_value
v = nodes[3].text_value
memo[k] = v
memo
end
end
def matching_end
"{/block:#{name}}"
end
def to_tree
return [type, name, options]
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/node/literal.rb | lib/tumblargh/node/literal.rb | module Tumblargh
module Node
class Literal < Base
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/node/base.rb | lib/tumblargh/node/base.rb | module Tumblargh
module Node
class Base < Treetop::Runtime::SyntaxNode
def type
@type ||= self.class.name.split('::').last.to_sym
end
def to_tree
[type, text_value]
end
def to_s
text_value
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/node/root.rb | lib/tumblargh/node/root.rb | module Tumblargh
module Node
class Root < Base
def to_tree
elements.map(&:to_tree)
end
def to_s
elements.map(&:to_s).join ''
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
jasonwebster/tumblargh | https://github.com/jasonwebster/tumblargh/blob/1fedef2f9c3f8393a39a8f366a9ad297029ed198/lib/tumblargh/node/block.rb | lib/tumblargh/node/block.rb | module Tumblargh
module Node
class Block < Root
def name
# First node is BlockStart
elements.first.name
end
def options
elements.first.options
end
def to_tree
ary = [type, name, options]
# Second node is a Treetop SyntaxNode which holds
# the rest of the block contents. Extra parse node
# due to grouping in the block grammar
elements[1].elements.each do |e|
if e.respond_to?(:to_tree)
ary << e.to_tree
else
raise ParserError, "Unknown node type '#{e.class.name}' in Block '#{name}'"
end
end
ary
end
end
end
end
| ruby | MIT | 1fedef2f9c3f8393a39a8f366a9ad297029ed198 | 2026-01-04T17:51:25.077970Z | false |
janlelis/unibits | https://github.com/janlelis/unibits/blob/3acb115c05c3ae6db2594d6a432168fcfabb13a7/spec/unibits_spec.rb | spec/unibits_spec.rb | require_relative "../lib/unibits/kernel_method"
require "minitest/autorun"
describe Unibits do
it "will not work for unsupported encodings" do
proc{
Unibits.of("string".encode("UTF-32"))
}.must_raise ArgumentError
end
describe 'Encodings' do
let(:string){ "🌫 Idiosyncrätic ℜսᖯʏ" }
it "works with UTF-8" do
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "ℜ"
result.must_match "U+211C"
result.must_match /E2.*84.*9C/m
result.must_match /11100010.*10000100.*10011100/m
end
it "works with UTF-16LE" do
result = Paint.unpaint(Unibits.visualize(string.encode('UTF-16LE')))
result.must_match "ℜ"
result.must_match "U+211C"
result.must_match /1C.*21/m
result.must_match /00011100.*00100001/m
end
it "works with UTF-16BE" do
result = Paint.unpaint(Unibits.visualize(string.encode('UTF-16BE')))
result.must_match "ℜ"
result.must_match "U+211C"
result.must_match /21.*1C/m
result.must_match /00100001.*00011100/m
end
it "works with UTF-32LE" do
result = Paint.unpaint(Unibits.visualize(string.encode('UTF-32LE')))
result.must_match "ℜ"
result.must_match "U+211C"
result.must_match /1C.*21.*00.*00/m
result.must_match /00011100.*00100001.*00000000.*00000000/m
end
it "works with UTF-32BE" do
result = Paint.unpaint(Unibits.visualize(string.encode('UTF-32BE')))
result.must_match "ℜ"
result.must_match "U+211C"
result.must_match /00.*00.*21.*1C/m
result.must_match /00000000.*00000000.*00100001.*00011100/m
end
it "works with BINARY" do
result = Paint.unpaint(Unibits.visualize(string.dup.force_encoding('BINARY')))
# testing for the UTF-8 encoded "ℜ"
result.must_match "\\xE2"
result.must_match "\\x84"
result.must_match "\\x9C"
result.must_match /11100010.*10000100.*10011100/m
end
it "works with ASCII" do
result = Paint.unpaint(Unibits.visualize("ASCII string".force_encoding('ASCII')))
result.must_match "C"
result.must_match "43"
result.must_match "01000011"
end
it "works with GB1988" do
result = Paint.unpaint(Unibits.visualize("ASCII string".force_encoding('GB1988')))
result.must_match "C"
result.must_match "43"
result.must_match "01000011"
end
it "works with 'ISO-8859-X' encodings" do
string = "\xBC Idiosyncr\xE4tic\n\x91".force_encoding("ISO-8859-1")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "BC" # ¼
result.must_match "E4" # ä
result.must_match "␊" # \n
result.must_match "PU1" # C1 name for \x91
end
it "works with 'Windows-125X' encodings" do
string = "\xBC Idiosyncr\xE4tic\n\x81".force_encoding("Windows-1252")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "BC" # ¼
result.must_match "E4" # ä
result.must_match "␊" # \n
result.must_match "n/a" # \x81 is not assigned
end
it "works with 'IBMX' encodings" do
string = "\xFE Idiosyncr\x84tic\n".force_encoding("IBM437")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "FE" # ■
result.must_match "84" # ä
result.must_match "␊" # \n
end
it "works with 'CP85X' encodings" do
string = "\xFE Idiosyncr\x84tic\n".force_encoding("CP850")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "FE" # ■
result.must_match "84" # ä
result.must_match "␊" # \n
end
it "works with 'macX' encodings" do
string = "\xBD Idiosyncr\x8Atic \x11 \xF0\n".force_encoding("macRoman")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "BD" # Ω
result.must_match "8A" # ä
result.must_match "Logo" # \xF0
result.must_match "⌘" # \x11
result.must_match "␊" # \n
end
it "works with 'TIS-620/Windows-874' encodings" do
string = "\xA4 Idiosyncratic\n".force_encoding("TIS-620")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "A4" # ค
result.must_match "␊" # \n
end
it "works with 'KOI8-X' encodings" do
string = "\xE9\xE4\xE9\xEF\xF3\xF9\xEE\xE3\xF2\xE1\xF4\xE9\xE3\n".force_encoding("KOI8-R")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "F9" # Ы
result.must_match "␊" # \n
end
describe "invalid UTF-8 encodings" do
it "- unexpected continuation byte (1/2)" do
string = "abc\x80efg"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match "unexp.c."
result.must_match /e.*f.*g/m
end
it "- unexpected continuation byte (2/2)" do
string = "🌫\x81efg"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match "unexp.c."
result.must_match /e.*f.*g/m
end
it "- not enough continuation bytes" do
string = "\xF0\x9F\x8CABC"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match "n.e.con."
result.must_match /A.*B.*C/m
end
it "- overlong padding (1/2)" do
string = "\xE0\x81\x81ABC"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match /overlong.*overlong.*overlong/m
result.must_match /A.*B.*C/m
end
it "- overlong padding (2/2)" do
string = "\xC0\x80no double null"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match /overlong.*overlong/m
end
it "- too large codepoint (1/2)" do
string = "\xF5\x8F\xBF\xBFABC"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match /toolarge.*toolarge.*toolarge.*toolarge/m
result.must_match /A.*B.*C/m
end
it "- too large codepoint (2/2)" do
string = "\xF4\xAF\xBF\xBFABC"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match /toolarge.*toolarge.*toolarge.*toolarge/m
result.must_match /A.*B.*C/m
end
it "- too large byte" do
string = "\xFF"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match "toolarge"
end
it "- has surrogate (1/2)" do
string = "\xED\xA0\x80ABC"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match "sur.gate"
result.must_match /A.*B.*C/m
end
it "- has surrogate (2/2)" do
string = "\xED\xBF\xBFABC"
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match "sur.gate"
result.must_match /A.*B.*C/m
end
end
describe "invalid UTF-16 encodings" do
unless RUBY_ENGINE === "truffleruby"
it "- incomplete number of bytes (1/2)" do
string = "a".b.force_encoding("UTF-16LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "incompl."
result.must_match "�"
end
it "- incomplete number of bytes (2/2)" do
string = "🌫".b[0..-2].force_encoding("UTF-16LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "incompl."
result.must_match "�"
end
end
it "- only lower half surrogate" do
string = "\x3C\xD8\x2Ba".force_encoding("UTF-16LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "hlf.srg."
result.must_match "�"
end
it "- only higher half surrogate" do
string = "\x3Ca\x2B\xDF".force_encoding("UTF-16LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "hlf.srg."
result.must_match "�"
end
end
describe "invalid UTF-32 encodings" do
# please note, currently, too large codepoints and encoded utf16 surrogates are treated as valid encodings
unless RUBY_ENGINE === "truffleruby"
it "- incomplete number of bytes (1/3)" do
string = "a".b.force_encoding("UTF-32LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "incompl."
result.must_match "�"
end
it "- incomplete number of bytes (2/3)" do
string = "🌫".b[0..-2].force_encoding("UTF-32LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "incompl."
result.must_match "�"
end
it "- incomplete number of bytes (3/3)" do
string = "🌫".b[0..-2].force_encoding("UTF-32LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "incompl."
result.must_match "�"
end
end
it "- too large codepoint (1/2)" do
string = "\x00\x00\x11\x00".force_encoding("UTF-32LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match "toolarge"
end
it "- too large codepoint (2/2)" do
string = "\x00\x00\x00\x01".force_encoding("UTF-32LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match "toolarge"
end
it "- has surrogate" do
string = "\x00\xD8\x00\x00".force_encoding("UTF-32LE")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match "sur.gate"
end
end
describe "invalid ASCII encodings" do
it "- contains bytes with 8th bit set" do
string = "abc\x80efg".force_encoding("ASCII")
result = Paint.unpaint(Unibits.visualize(string))
result.must_match "�"
result.must_match /e.*f.*g/m
end
end
end
describe "wide_ambiguous: option" do
it "- default is 1" do
string = "⚀······"
result = Unibits.stats(string)
result.wont_match "13"
end
it "- default is 2" do
string = "⚀······"
result = Unibits.stats(string, wide_ambiguous: true)
result.must_match "13"
end
end
describe "width: option" do
it "sets a custom column width" do
string = "bla" * 99
result = Paint.unpaint(Unibits.visualize(string, width: 50))
(result[/^.*$/].size <= 50).must_equal true
end
end
describe "bugs / edge cases" do
it "should render ASCII space (U+20) as one byte [gh #1]" do
string = "\u{1f32b} abc"
result = Paint.unpaint(Unibits.visualize(string))
result.wont_match /20.*20.*5B/m
result.must_match /F0.*9F.*8C.*AB.*20.*61.*62.*63/m
end
end
end
| ruby | MIT | 3acb115c05c3ae6db2594d6a432168fcfabb13a7 | 2026-01-04T17:51:19.558495Z | false |
janlelis/unibits | https://github.com/janlelis/unibits/blob/3acb115c05c3ae6db2594d6a432168fcfabb13a7/lib/unibits.rb | lib/unibits.rb | require_relative "unibits/version"
require "io/console"
require "paint"
require "unicode/display_width"
require "characteristics"
require "symbolify"
module Unibits
SUPPORTED_ENCODINGS = Encoding.name_list.grep(
Regexp.union(
/^UTF-8$/,
/^UTF8-/,
/^UTF-...E$/,
/^ASCII-8BIT$/,
/^US-ASCII$/,
/^ISO-8859-/,
/^Windows-125/,
/^IBM/,
/^CP85/,
/^mac/,
/^TIS-620$/,
/^Windows-874$/,
/^KOI8/,
/^GB1988$/,
)
).sort.freeze
COLORS = {
invalid: "#FF0000",
control: "#0000FF",
blank: "#33AADD",
format: "#FF00FF",
mark: "#228822",
unassigned: "#FF5500",
ignorable: "#FFAA00",
}
DEFAULT_TERMINAL_WIDTH = 80
def self.of(string, encoding: nil, convert: nil, stats: true, wide_ambiguous: false, width: nil)
string = convert_to_encoding_or_raise(string, encoding, convert)
puts stats(string, wide_ambiguous: wide_ambiguous) if stats
puts visualize(string, wide_ambiguous: wide_ambiguous, width: width)
end
def self.convert_to_encoding_or_raise(string, encoding, convert)
raise ArgumentError, "no data given to unibits" if !string || string.empty?
string = string.dup.force_encoding(encoding) if encoding
string = string.encode(convert) if convert
case string.encoding.name
when *SUPPORTED_ENCODINGS
string
when 'UTF-16', 'UTF-32'
raise ArgumentError, "unibits only supports #{string.encoding.name} with specified endianess, please use #{string.encoding.name}LE or #{string.encoding.name}BE"
else
raise ArgumentError, "unibits does not support strings of encoding #{string.encoding}"
end
end
def self.stats(string, wide_ambiguous: false)
valid = string.valid_encoding?
bytes = string.bytesize rescue "?"
codepoints = string.size rescue "?"
glyphs = string.scan(Regexp.compile('\X'.encode(string.encoding))).size rescue "?"
width = Unicode::DisplayWidth.of(string, wide_ambiguous ? 2 : 1) rescue "?"
"\n #{valid ? '' : Paint["Invalid ", :bold, :red]}#{Paint[string.encoding.name, :bold]} (#{bytes}/#{codepoints}/#{glyphs}/#{width})"
end
def self.visualize(string, wide_ambiguous: false, width: nil)
cols = width || determine_terminal_cols
encoding_name = string.encoding.name
type = Characteristics.type_from_encoding_name(encoding_name)
cp_buffer = [" "]
enc_buffer = [" "]
hex_buffer = [" "]
bin_buffer = [" "]
separator = [" "]
current_encoding_error = nil
puts
string.each_char{ |char|
char_info = Characteristics.create_for_type(char, type)
if RUBY_VERSION >= "2.4.1" ||
RUBY_VERSION < "2.4.0" && RUBY_VERSION >= "2.3.4" ||
RUBY_VERSION < "2.3.0" && RUBY_VERSION >= "2.2.7" ||
char_info.encoding.name[0, 6] != "UTF-32" ||
!char_info.valid?
# bug is fixed or not relevant
else
double_check_utf32_validness!(char, char_info)
end
current_color = determine_char_color(char_info)
current_encoding_error = nil if char_info.valid?
char.each_byte.with_index{ |byte, byteindex|
if Paint.unpaint(hex_buffer[-1]).bytesize > cols - 12
cp_buffer << " "
enc_buffer << " "
hex_buffer << " "
bin_buffer << " "
separator << " "
end
if byteindex == 0
if char_info.valid?
codepoint = "U+%04X" % char.ord
else
case encoding_name
when "US-ASCII"
codepoint = "invalid"
when "UTF-8", /^UTF8/
# this tries to detect what is wrong with this utf-8 encoded string
# sorry for this mess
case char.unpack("B*")[0]
when /^110.{5}$/
current_encoding_error = [:nec, 1, 1]
codepoint = "n.e.con."
when /^1110(.{4})$/
if $1 == "1101"
current_encoding_error = [:nec, 2, 2, :maybe_surrogate]
else
current_encoding_error = [:nec, 2, 2]
end
codepoint = "n.e.con."
when /^11110(.{3})$/
case $1
when "100"
current_encoding_error = [:nec, 3, 3, :leading_at_max]
when "101", "110", "111"
current_encoding_error = [:nec, 3, 3, :too_large]
else
current_encoding_error = [:nec, 3, 3]
end
codepoint = "n.e.con."
when /^11111.{3}$/
codepoint = "toolarge"
when /^10(.{2}).{4}$/
# uglyhack to fixup that it is not n.e.c, but something different
if current_encoding_error && current_encoding_error[0] == :nec
if current_encoding_error[3] == :leading_at_max
if $1 != "00"
current_encoding_error[3] = :too_large
else
current_encoding_error[3] = nil
end
elsif current_encoding_error[3] == :maybe_surrogate
if $1[0] == "1"
current_encoding_error[3] = :surrogate
else
current_encoding_error[3] = nil
end
end
if current_encoding_error[1] > 1
current_encoding_error[1] -= 1
codepoint = "n.e.con."
else
case current_encoding_error[3]
when :too_large
actual_error = "toolarge"
when :surrogate
actual_error = "sur.gate"
else
actual_error = "overlong"
end
current_cp_buffer_index = -1
(current_encoding_error[2]).times{
if index = cp_buffer[current_cp_buffer_index].rindex("n.e.con.")
cp_buffer[current_cp_buffer_index][index..-1] = cp_buffer[current_cp_buffer_index][index..-1].sub("n.e.con.", actual_error)
else
current_cp_buffer_index -= 1
index = cp_buffer[current_cp_buffer_index].rindex("n.e.con.")
cp_buffer[current_cp_buffer_index][index..-1] = cp_buffer[current_cp_buffer_index][index..-1].sub("n.e.con.", actual_error)
end
current_encoding_error = [:overlong]
codepoint = actual_error
}
end
else
current_encoding_error = [:unexp]
codepoint = "unexp.c."
end
else
current_encoding_error = [:invallid]
codepoint = "invalid"
end
when 'UTF-16LE', 'UTF-16BE'
if char.bytesize.odd?
codepoint = "incompl."
elsif char.b[encoding_name == 'UTF-16LE' ? 1 : 0].unpack("B*")[0][0, 5] == "11011"
codepoint = "hlf.srg."
else
codepoint = "invalid"
end
when 'UTF-32LE', 'UTF-32BE'
if char.bytesize % 4 != 0
codepoint = "incompl."
elsif char.b.unpack("C*")[encoding_name == 'UTF-32LE' ? 2 : 1] > 16 ||
char.b.unpack("C*")[encoding_name == 'UTF-32LE' ? 3 : 0] > 0
codepoint = "toolarge"
else
codepoint = "sur.gate"
end
end
end
cp_buffer[-1] << Paint[ codepoint.ljust(10), current_color, :bold ]
symbolified_char = Symbolify.symbolify(char, char_info)
if char_info.unicode?
padding = 10 - Unicode::DisplayWidth.of(symbolified_char, wide_ambiguous ? 2 : 1)
else
padding = 10 - symbolified_char.size
end
enc_buffer[-1] << Paint[ symbolified_char, current_color ]
enc_buffer[-1] << " " * padding if padding > 0
else
cp_buffer[-1] << " " * 10
enc_buffer[-1] << " " * 10
end
hex_buffer[-1] << Paint[ ("%02X" % byte).ljust(10, " "), current_color ]
bin_buffer[-1] << highlight_bits(byte, char, char_info, current_color, byteindex)
bin_buffer[-1] << " "
}
}
if type == :unicode
enc_buffer.zip(cp_buffer, hex_buffer, bin_buffer, separator).flatten.join("\n")
else
enc_buffer.zip(hex_buffer, bin_buffer, separator).flatten.join("\n")
end
end
def self.determine_terminal_cols
STDIN.winsize[1] || ENV['COLUMNS'] || DEFAULT_TERMINAL_WIDTH
rescue Errno::ENOTTY, Errno::EBADF
return ENV['COLUMNS'] || DEFAULT_TERMINAL_WIDTH
end
def self.determine_char_color(char_info)
if !char_info.valid?
COLORS[:invalid]
elsif !char_info.assigned?
if char_info.unicode? && char_info.ignorable?
COLORS[:ignorable]
else
COLORS[:unassigned]
end
elsif char_info.blank?
COLORS[:blank]
elsif char_info.control?
COLORS[:control]
elsif char_info.format?
COLORS[:format]
elsif char_info.unicode? && char_info.category[0] == "M"
COLORS[:mark]
else
random_color
end
end
def self.random_color
"%.2x%.2x%.2x" % [rand(90) + 60, rand(90) + 60, rand(90) + 60]
end
def self.highlight_bits(byte, char, char_info, current_color, byteindex)
bin_byte_complete = byte.to_s(2).rjust(8, "0")
if !char_info.valid?
bin_byte_1 = bin_byte_complete
bin_byte_2 = ""
else
case char_info.encoding.name
when 'US-ASCII'
bin_byte_1 = bin_byte_complete[0...1]
bin_byte_2 = bin_byte_complete[1...8]
when 'ASCII-8BIT'
bin_byte_1 = ""
bin_byte_2 = bin_byte_complete
when 'UTF-8', /^UTF8/
if byteindex == 0
if bin_byte_complete =~ /^(0|1{2,4}0)([01]+)$/
bin_byte_1 = $1
bin_byte_2 = $2
else
bin_byte_1 = ""
bin_byte_2 = bin_byte_complete
end
else
bin_byte_1 = bin_byte_complete[0...2]
bin_byte_2 = bin_byte_complete[2...8]
end
when 'UTF-16LE'
if char.ord <= 0xFFFF || byteindex == 0 || byteindex == 2
bin_byte_1 = ""
bin_byte_2 = bin_byte_complete
else
bin_byte_complete =~ /^(11011[01])([01]+)$/
bin_byte_1 = $1
bin_byte_2 = $2
end
when 'UTF-16BE'
if char.ord <= 0xFFFF || byteindex == 1 || byteindex == 3
bin_byte_1 = ""
bin_byte_2 = bin_byte_complete
else
bin_byte_complete =~ /^(11011[01])([01]+)$/
bin_byte_1 = $1
bin_byte_2 = $2
end
else
bin_byte_1 = ""
bin_byte_2 = bin_byte_complete
end
end
res = ""
res << Paint[ bin_byte_1, current_color ] unless !bin_byte_1 || bin_byte_1.empty?
res << Paint[ bin_byte_2, current_color, :underline ] unless !bin_byte_2 || bin_byte_2.empty?
res
end
def self.double_check_utf32_validness!(char, char_info)
byte_values = char.b.unpack("C*")
le = char_info.encoding.name == 'UTF-32LE'
if byte_values[le ? 2 : 1] > 16 ||
byte_values[le ? 3 : 0] > 0 ||
byte_values[le ? 1 : 2] >= 216 && byte_values[le ? 1 : 2] <= 223
char_info.instance_variable_set(:@is_valid, false)
end
end
end
| ruby | MIT | 3acb115c05c3ae6db2594d6a432168fcfabb13a7 | 2026-01-04T17:51:19.558495Z | false |
janlelis/unibits | https://github.com/janlelis/unibits/blob/3acb115c05c3ae6db2594d6a432168fcfabb13a7/lib/unibits/version.rb | lib/unibits/version.rb | # frozen_string_literal: true
module Unibits
VERSION = "2.14.0"
UNICODE_VERSION = "17.0.0"
end
| ruby | MIT | 3acb115c05c3ae6db2594d6a432168fcfabb13a7 | 2026-01-04T17:51:19.558495Z | false |
janlelis/unibits | https://github.com/janlelis/unibits/blob/3acb115c05c3ae6db2594d6a432168fcfabb13a7/lib/unibits/kernel_method.rb | lib/unibits/kernel_method.rb | require_relative '../unibits'
module Kernel
private
def unibits(string, **kwargs)
Unibits.of(string, **kwargs)
end
end
| ruby | MIT | 3acb115c05c3ae6db2594d6a432168fcfabb13a7 | 2026-01-04T17:51:19.558495Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/spec/spec_helper.rb | spec/spec_helper.rb | require 'rubiks_cube'
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/spec/rubiks_cube/solution_spec.rb | spec/rubiks_cube/solution_spec.rb | require 'spec_helper'
describe RubiksCube::Solution do
class TestSolution < RubiksCube::Solution
def initialize(cube, solution)
@solution = solution
super cube
end
def solution; @solution; end
end
subject { TestSolution.new(double('Cube', state: 'nope'), solution) }
describe '#length' do
context 'when the solution is a single array' do
let(:solution) { %w(a b c) }
it 'returns the length of the solution' do
expect(subject.length).to eq 3
end
end
context 'when the solution contains multiple arrays' do
let(:solution) { [%w(a b), %w(c d), [%w(e f)]] }
it 'returns the length of the solution' do
expect(subject.length).to eq 6
end
end
context 'when the solution is a string' do
let(:solution) { "a b c d" }
it 'returns the length of the solution' do
expect(subject.length).to eq 4
end
end
end
end
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/spec/rubiks_cube/two_cycle_solution_spec.rb | spec/rubiks_cube/two_cycle_solution_spec.rb | require 'spec_helper'
describe RubiksCube::TwoCycleSolution do
subject { described_class.new cube }
let(:cube) { RubiksCube::Cube.new state }
let(:state) { nil }
describe '#solution' do
shared_examples_for 'a cube that can be solved' do
it 'solves the cube' do
subject.solution
expect(subject).to be_solved
end
end
it 'does not modify the original cube state' do
original_cube_state = cube.l.state
subject.solution
expect(cube.state).to eq original_cube_state
end
context 'when edges need to be swapped' do
let(:state) {
'UF UL UB UR FL FR BR BL DF DR DB DL UFL UBR URF ULB DLF DFR DRB DBL'
}
it_should_behave_like 'a cube that can be solved'
end
context 'when corners need to be swapped' do
let(:state) {
'UL UR UB UF FL FR BR BL DF DR DB DL UBR URF UFL ULB DLF DFR DRB DBL'
}
it_should_behave_like 'a cube that can be solved'
end
context 'when two edges have incorrect orientation' do
before { cube.perform! RubiksCube::Algorithms::Orientation::Edge }
it_should_behave_like 'a cube that can be solved'
end
context 'when two corners have incorrect orientation' do
before { cube.perform! RubiksCube::Algorithms::Orientation::Corner }
it_should_behave_like 'a cube that can be solved'
end
[
"U2 L' F2 U' B D' R' F2 U F' R L2 F2 L' B L R2 B' D R L' U D' R2 F'",
"L U2 R' B2 U D R' U R' B2 L F R2 L' B' R' U2 L2 R2 U F' L' U' L U'",
"F' U2 D2 F2 R' D2 B L2 F L2 D2 F U2 F B L U' D' R' F D F' L2 F' B2",
"R2 U' D2 B L2 U' R D2 L2 U2 F2 D' B' L B' D L' B2 L' F' L' B2 F2 U' L2",
"L2 R D' U2 R L' B2 U' L2 D2 B2 D' R2 L' B' U2 B R2 F2 R' D' F2 D L U",
].each do |scramble|
context "with scramble (#{scramble})" do
before { cube.perform! scramble }
it_should_behave_like 'a cube that can be solved'
end
end
it 'returns the setup, algorithm, and undo moves' do
cube.perform!([
RubiksCube::Algorithms::Permutation::Edge,
RubiksCube::Algorithms::Permutation::Corner,
RubiksCube::Algorithms::Orientation::Edge,
].join(' '))
expect(subject.solution).to eq([
"", RubiksCube::Algorithms::Permutation::Edge, "",
"M2 D L2", RubiksCube::Algorithms::Permutation::Edge, "L2 D' M2",
"R2 D' R2", RubiksCube::Algorithms::Permutation::Corner, "R2 D R2",
"", RubiksCube::Algorithms::Permutation::Corner, "",
"R B", RubiksCube::Algorithms::Orientation::Edge, "B' R'",
"", RubiksCube::Algorithms::Orientation::Edge, ""
])
end
end
end
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/spec/rubiks_cube/bicycle_solution_spec.rb | spec/rubiks_cube/bicycle_solution_spec.rb | require 'spec_helper'
module RubiksCube
describe BicycleSolution do
it 'is an alias for TwoCycleSolution' do
cube = double('RubiksCube::Cube')
allow(TwoCycleSolution).to receive(:new)
BicycleSolution.new(cube)
expect(TwoCycleSolution).to have_received(:new).with(cube)
end
end
end
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/spec/rubiks_cube/sticker_state_transform_spec.rb | spec/rubiks_cube/sticker_state_transform_spec.rb | require 'spec_helper'
describe RubiksCube::StickerStateTransform do
subject { described_class.new state }
let(:state) { nil }
describe '#to_cube' do
context 'when initialized with sticker state' do
let(:state) {[
"g b b b w b o g b \
o w b o o g r r w r y y o y r r g o r w o y r w",
"gw bg o yggowywyywrbbyrg "
].join(' ')}
it 'transforms to cube state' do
expect(subject.to_cube).to eq(
"BD RF RB UF DF DR RU LB BU DL LU LF FUR FRD BLD ULB BDR FDL UFL BRU"
)
end
end
end
end
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/spec/rubiks_cube/cubie_spec.rb | spec/rubiks_cube/cubie_spec.rb | require 'spec_helper'
describe RubiksCube::Cubie do
subject { described_class.new state }
let(:state) { 'UF' }
it 'is initialized with a state' do
expect(subject.state).to eq state
end
describe '==' do
context 'when the state equals the state of the other' do
it 'returns true' do
expect(subject == described_class.new(state)).to be true
end
end
context 'when the state does not equal the state of the other' do
it 'returns false' do
expect(subject == described_class.new('UB')).to be false
end
end
end
describe '#to_s' do
it 'converts the cubie to a string' do
expect(subject.to_s).to eq state
end
end
describe '#rotate!' do
context 'with an edge piece' do
let(:state) { 'UF' }
it 'flips the cubie' do
expect(subject.rotate!.state).to eq 'FU'
expect(subject.rotate!.state).to eq state
end
end
context 'with a corner piece' do
let(:state) { 'URF' }
it 'rotates the cubie once couter clockwise' do
expect(subject.rotate!.state).to eq 'RFU'
expect(subject.rotate!.state).to eq 'FUR'
expect(subject.rotate!.state).to eq state
end
end
end
describe '#rotate' do
it "returns a new cubie that's been rotated" do
expect(subject.rotate).to eq described_class.new(state).rotate!
end
it 'does not modify the cubie' do
original_state = subject.state.dup
subject.rotate
expect(subject.state).to eq original_state
end
end
end
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/spec/rubiks_cube/algorithms_spec.rb | spec/rubiks_cube/algorithms_spec.rb | require 'spec_helper'
describe RubiksCube::Algorithms do
subject { described_class }
describe '.reverse' do
it 'reverses the algorithm' do
expect(subject.reverse "F' B L2 U' R").to eq "R' U L2 B' F"
end
end
end
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/spec/rubiks_cube/cube_spec.rb | spec/rubiks_cube/cube_spec.rb | require 'spec_helper'
describe RubiksCube::Cube do
subject { described_class.new state }
let(:state) { nil }
describe '#initialize' do
context 'when a state is provided' do
let(:state) { 'some state' }
it 'is initialized with the state' do
expect(subject.state).to eq state
end
end
context 'when no state is provided' do
let(:state) { nil }
it 'is initialized with the solved state' do
expect(subject.state).to eq RubiksCube::Cube::SOLVED_STATE.join ' '
end
end
end
describe '#state=' do
it 'changes the state of the cube' do
expect { subject.state = 'a b c' }.to change { subject.state }
end
end
describe '==' do
it 'returns true when two cubes have the same state' do
expect(subject).to eq described_class.new(state)
end
it 'returns false when two cubes do not have the same state' do
expect(subject).to_not eq described_class.new(state).d
end
end
describe '#edges' do
it 'returns all the edges' do
expect(subject.edges).to eq(
subject.state.split[0..11].map { |cubie| RubiksCube::Cubie.new cubie }
)
end
end
describe '#corners' do
it 'returns all the corners' do
expect(subject.corners).to eq(
subject.state.split[12..-1].map { |cubie| RubiksCube::Cubie.new cubie }
)
end
end
describe '#incorrect_edge_permutation_locations' do
context 'with unpermuted edges' do
let(:state) {
'UF UL UB UR FL FR BR BL DF DL DB DR UFL URF UBR ULB DLF DFR DRB DBL'
}
it 'returns the location of all unpermuted edges' do
expect(
subject.incorrect_edge_permutation_locations
).to eq [1, 3, 9, 11]
end
end
context 'with permuted edges' do
it 'returns an empty array' do
expect(subject.incorrect_edge_permutation_locations).to eq []
end
end
end
describe '#incorrect_corner_permutation_locations' do
context 'with unpermuted corners' do
let(:state){
'UF UR UB UL FL FR BR BL DF DR DB DL ULB UBR URF UFL DLF DFR DRB DBL'
}
it 'returns the locations of all unpermuted corners' do
expect(
subject.incorrect_corner_permutation_locations
).to eq [0, 1, 2, 3]
end
end
context 'with permuted corners' do
it 'returns an empty array' do
expect(subject.incorrect_corner_permutation_locations).to eq []
end
end
end
describe '#incorrect_edge_orientation_locations' do
context 'with edges that are not oriented' do
let(:state) {
'FU UR BU UL FL RF RB LB FD DR DB DL UFL URF UBR ULB DLF DFR DRB DBL'
}
it 'returns the locations of all unoriented edges' do
expect(
subject.incorrect_edge_orientation_locations
).to eq [0, 2, 5, 6, 7, 8]
end
end
context 'with oriented edges' do
it 'returns an empty array' do
expect(subject.incorrect_edge_orientation_locations).to eq []
end
end
end
describe '#incorrect_corner_orientation_locations' do
context 'with corners that are not oriented' do
let(:state) {
'UF UR UB UL FL FR BR BL DF DR DB DL FLU FUR UBR ULB DLF DFR DRB DBL'
}
it 'returns the locations of all unoriented corners' do
expect(subject.incorrect_corner_orientation_locations).to eq [0, 1]
end
end
context 'with oriented corners' do
it 'returns an empty array' do
expect(subject.incorrect_corner_orientation_locations).to eq []
end
end
end
describe '#permuted_location_for' do
RubiksCube::Cube::SOLVED_STATE.each_with_index do |cubie, location|
it "returns the correct location for the '#{cubie}' cubie" do
# Both corner and edge index begins at zero
location -= 12 if location >= 12
cubie = RubiksCube::Cubie.new cubie
expect(subject.permuted_location_for cubie).to eq location
end
end
context 'when the cubie has been rotated' do
let(:cubie) { subject.corners.first }
before { cubie.rotate! }
it 'still finds the correct location' do
expect(subject.permuted_location_for cubie).to eq 0
end
it 'does not rotate the cubie' do
original_state = cubie.state
subject.permuted_location_for cubie
expect(cubie.state).to eq original_state
end
end
end
describe '#solved?' do
it 'returns true when cube is solved' do
expect(subject).to be_solved
end
it 'returns false when cube is not solved' do
subject.l
expect(subject).to_not be_solved
end
end
describe '#edge_permuted?' do
it 'returns true when the cubie is permuted' do
subject.u
permuted_edge = subject.edges[4]
unpermuted_edge = subject.edges[0]
expect(subject.edge_permuted? unpermuted_edge).to be false
expect(subject.edge_permuted? permuted_edge).to be true
end
end
describe '#corner_permuted?' do
it 'returns true when the cubie is permuted' do
subject.f
permuted_corner = subject.corners[2]
unpermuted_corner = subject.corners[1]
expect(subject.corner_permuted? unpermuted_corner).to be false
expect(subject.corner_permuted? permuted_corner).to be true
end
end
describe '#has_correct_edge_permutation?' do
context 'when the edges are permuted, but corners are not' do
let(:state) {
'UF UR UB UL FL FR BR BL DF DR DB DL ULB UBR URF UFL DBL DRB DFR DLF'
}
it 'returns true' do
expect(subject).to have_correct_edge_permutation
end
end
context 'when the edges are not permuted, but corners are' do
let(:state) {
'UL UF UB UR FL FR BR BL DF DR DB DL UFL URF UBR ULB DLF DFR DRB DBL'
}
it 'returns false' do
expect(subject).to_not have_correct_edge_permutation
end
end
end
describe '#has_correct_corner_permutation?' do
context 'when the corners are permuted, but the edges are not' do
let(:state) {
'UL UF UB UR FL FR BR BL DF DR DB DL UFL URF UBR ULB DLF DFR DRB DBL'
}
it 'returns true' do
expect(subject).to have_correct_corner_permutation
end
end
context 'when the corners are not permuted, but the edges are permuted' do
let(:state) {
'UF UR UB UL FL FR BR BL DF DR DB DL ULB UBR URF UFL DBL DRB DFR DLF'
}
it 'returns false' do
expect(subject).to_not have_correct_corner_permutation
end
end
end
describe '#has_correct_edge_orientation?' do
context 'when the edges are oriented, but the corners are not' do
let(:state) {
'UF UR UB UL FL FR BR BL DF DR DB DL LUF RFU UBR ULB DLF DFR DRB DBL'
}
it 'returns true' do
expect(subject).to have_correct_edge_orientation
end
end
context 'when the edges are not oriented, but the corners are' do
let(:state) {
'FU UR BU UL FL FR BR BL DF DR DB DL UFL URF UBR ULB DLF DFR DRB DBL'
}
it 'returns false' do
expect(subject).to_not have_correct_edge_orientation
end
end
end
describe '#has_correct_corner_orientation?' do
context 'when the corners are oriented, but the edges are not' do
let(:state) {
'FU UR BU UL FL FR BR BL DF DR DB DL UFL URF UBR ULB DLF DFR DRB DBL'
}
it 'returns true' do
expect(subject).to have_correct_corner_orientation
end
end
context 'when the corners are not oriented, but the edges are' do
let(:state) {
'UF UR UB UL FL FR BR BL DF DR DB DL LUF RFU UBR ULB DLF DFR DRB DBL'
}
it 'returns false' do
expect(subject).to_not have_correct_corner_orientation
end
end
end
describe '#perform!' do
it 'performs the algorithm on the cube' do
subject.perform! "U2 D' L R F B"
expect(subject.state).to eq(
described_class.new.u.u.d.d.d.l.r.f.b.state
)
end
it 'returns the algorithm that was performed' do
algorithm = "F2 U' L"
expect(subject.perform! algorithm).to eq algorithm
end
end
describe 'face turns' do
shared_examples_for 'a face turn' do
it "rotates the face 90 degrees clockwise" do
subject.public_send direction
expect(subject.state).to eq expected_state
end
it 'is chainable' do
expect(subject.public_send direction).to eq subject
end
end
describe '#r' do
let(:direction) { 'r' }
let(:expected_state) {
'UF FR UB UL FL DR UR BL DF BR DB DL UFL FRD FUR ULB DLF BDR BRU DBL'
}
it_should_behave_like 'a face turn'
end
describe '#l' do
let(:direction) { 'l' }
let(:expected_state) {
'UF UR UB BL UL FR BR DL DF DR DB FL BUL URF UBR BLD FLU DFR DRB FDL'
}
it_should_behave_like 'a face turn'
end
describe '#u' do
let(:direction) { 'u' }
let(:expected_state) {
'UR UB UL UF FL FR BR BL DF DR DB DL URF UBR ULB UFL DLF DFR DRB DBL'
}
it_should_behave_like 'a face turn'
end
describe '#d' do
let(:direction) { 'd' }
let(:expected_state) {
'UF UR UB UL FL FR BR BL DL DF DR DB UFL URF UBR ULB DBL DLF DFR DRB'
}
it_should_behave_like 'a face turn'
end
describe '#f' do
let(:direction) { 'f' }
let(:expected_state) {
'LF UR UB UL FD FU BR BL RF DR DB DL LFD LUF UBR ULB RDF RFU DRB DBL'
}
it_should_behave_like 'a face turn'
end
describe '#b' do
let(:direction) { 'b' }
let(:expected_state) {
'UF UR RB UL FL FR BD BU DF DR LB DL UFL URF RBD RUB DLF DFR LDB LBU'
}
it_should_behave_like 'a face turn'
end
describe '#m' do
let(:direction) { 'm' }
let(:expected_state) {
'BU UR BD UL FL FR BR BL FU DR FD DL UFL URF UBR ULB DLF DFR DRB DBL'
}
it_should_behave_like 'a face turn'
end
end
end
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/lib/rubiks_cube.rb | lib/rubiks_cube.rb | require 'rubiks_cube/version'
require 'rubiks_cube/sticker_state_transform'
require 'rubiks_cube/cube'
require 'rubiks_cube/cubie'
require 'rubiks_cube/algorithms'
require 'rubiks_cube/solution'
require 'rubiks_cube/two_cycle_solution'
require 'rubiks_cube/bicycle_solution'
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
chrishunt/rubiks-cube | https://github.com/chrishunt/rubiks-cube/blob/3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0/lib/rubiks_cube/version.rb | lib/rubiks_cube/version.rb | module RubiksCube
VERSION = '1.3.0'
end
| ruby | MIT | 3b276ac7dbc8c2afd02d351316d4eb6b1e0d14e0 | 2026-01-04T17:51:24.361634Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.