Skip to content

Commit

Permalink
Don't exclude the Factory zone in ZoneinfoDataSource.
Browse files Browse the repository at this point in the history
This brings ZoneinfoDataSource into line with RubyDataSource when used
with TZInfo::Data v1.2016.7 and later.

(cherry picked from commit c876e1c)
  • Loading branch information
philr committed Mar 19, 2017
1 parent a18b609 commit 5dedceb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/tzinfo/zoneinfo_data_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,8 @@ def load_timezone_index
# localtime current local timezone (may be a link).
# posix, posixrules and right are directories containing other versions of the zoneinfo files.
# src is a directory containing the tzdata source included on Solaris.
# Factory is the compiled in default timezone.

enum_timezones(nil, ['+VERSION', 'localtime', 'posix', 'posixrules', 'right', 'src', 'Factory']) do |identifier|
enum_timezones(nil, ['+VERSION', 'localtime', 'posix', 'posixrules', 'right', 'src']) do |identifier|
index << identifier
end

Expand Down
4 changes: 2 additions & 2 deletions test/tc_zoneinfo_data_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,11 @@ def get_timezone_filenames(directory)

entries = entries.collect {|file| file[directory.length + File::SEPARATOR.length, file.length - directory.length - File::SEPARATOR.length]}

# Exclude right (with leapseconds) and posix (copy) directories; .tab files; localtime, posixrules and Factory zones
# Exclude right (with leapseconds) and posix (copy) directories; .tab files; localtime and posixrules files.
entries = entries.select do |file|
file !~ /\A(posix|right)\// &&
file !~ /\.tab\z/ &&
!%w(localtime posixrules Factory).include?(file)
!%w(localtime posixrules).include?(file)
end

entries.sort
Expand Down

0 comments on commit 5dedceb

Please sign in to comment.