From bbd42740dff00aba11f09f6a917090e09c476f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 17 Jan 2018 03:15:00 +0100 Subject: [PATCH] Add stubs for methods with file acces Trying to load a location from a file will fail because `File` is not yet ported to windows. --- src/time/location/loader.cr | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/time/location/loader.cr b/src/time/location/loader.cr index b7d85be1338a..af4b2747f934 100644 --- a/src/time/location/loader.cr +++ b/src/time/location/loader.cr @@ -23,6 +23,9 @@ class Time::Location # :nodoc: def self.load_from_dir_or_zip(name : String, source : String) + {% if flag?(:win32) %} + raise NotImplementedError.new("Time::Location.load_from_dir_or_zip") + {% else %} if source.ends_with?(".zip") open_file_cached(name, source) do |file| read_zip_file(name, file) do |io| @@ -35,6 +38,7 @@ class Time::Location read_zoneinfo(name, file) end end + {% end %} end private def self.open_file_cached(name : String, path : String) @@ -57,6 +61,9 @@ class Time::Location # :nodoc: def self.find_zoneinfo_file(name : String, sources : Enumerable(String)) + {% if flag?(:win32) %} + raise NotImplementedError.new("Time::Location.find_zoneinfo_file") + {% else %} sources.each do |source| if source.ends_with?(".zip") return source if File.exists?(source) @@ -65,6 +72,7 @@ class Time::Location return source if File.exists?(path) end end + {% end %} end # Parse "zoneinfo" time zone file.