lib/asciidoctor/load.rb in asciidoctor-2.0.13 vs lib/asciidoctor/load.rb in asciidoctor-2.0.14
- old
+ new
@@ -51,10 +51,11 @@
else
raise ::ArgumentError, %(illegal type for attributes option: #{attrs.class.ancestors.join ' < '})
end
if ::File === input
- options[:input_mtime] = input.mtime
+ # File#mtime on JRuby for Windows doesn't honor TZ environment variable; see https://github.com/jruby/jruby/issues/6659
+ options[:input_mtime] = RUBY_ENGINE == 'jruby' ? (::Time.at input.mtime.to_i) : input.mtime
# NOTE defer setting infile and indir until we get a better sense of their purpose
# TODO cli checks if input path can be read and is file, but might want to add check to API too
attrs['docfile'] = input_path = ::File.absolute_path input.path
attrs['docdir'] = ::File.dirname input_path
attrs['docname'] = Helpers.basename input_path, (attrs['docfilesuffix'] = Helpers.extname input_path)