@@ -78,6 +78,26 @@ class ZoneinfoDataSource < DataSource
7878 DEFAULT_ALTERNATE_ISO3166_TAB_SEARCH_PATH = [ '/usr/share/misc/iso3166.tab' , '/usr/share/misc/iso3166' ] . freeze
7979 private_constant :DEFAULT_ALTERNATE_ISO3166_TAB_SEARCH_PATH
8080
81+ # Ignoring particular files:
82+ # +VERSION is included on Mac OS X.
83+ # leapseconds is a list of leap seconds.
84+ # localtime is the current local timezone (may be a link).
85+ # posix, posixrules and right are directories containing other versions of
86+ # the zoneinfo files.
87+ # SECURITY is included in Arch tzdata package.
88+ # src is a directory containing the tzdata source included on Solaris.
89+ # timeconfig is a symlink included on Slackware.
90+ EXCLUDED_FILENAMES = [ '+VERSION' ,
91+ 'leapseconds' ,
92+ 'localtime' ,
93+ 'posix' ,
94+ 'posixrules' ,
95+ 'right' ,
96+ 'SECURITY' ,
97+ 'src' ,
98+ 'timeconfig' ]
99+ private_constant :EXCLUDED_FILENAMES
100+
81101 # Paths to be checked to find the system zoneinfo directory.
82102 #
83103 # @private
@@ -394,15 +414,7 @@ def find_zoneinfo_dir
394414 def load_timezone_identifiers
395415 index = [ ]
396416
397- # Ignoring particular files:
398- # +VERSION is included on Mac OS X.
399- # leapseconds is a list of leap seconds.
400- # localtime is the current local timezone (may be a link).
401- # posix, posixrules and right are directories containing other versions of the zoneinfo files.
402- # src is a directory containing the tzdata source included on Solaris.
403- # timeconfig is a symlink included on Slackware.
404-
405- enum_timezones ( [ ] , [ '+VERSION' , 'leapseconds' , 'localtime' , 'posix' , 'posixrules' , 'right' , 'src' , 'timeconfig' ] ) do |identifier |
417+ enum_timezones ( [ ] , EXCLUDED_FILENAMES ) do |identifier |
406418 index << identifier . join ( '/' ) . freeze
407419 end
408420
0 commit comments