@@ 35,8 35,8 @@ module Dhall
end
end
- def self.load(source, transform_keys: :to_s)
- new.load(source, transform_keys: transform_keys)
+ def self.load(source, transform_keys: :to_s, timeout: 10)
+ new.load(source, transform_keys: transform_keys, timeout: timeout)
end
def self.dump(obj)
@@ 49,17 49,17 @@ module Dhall
@verifier.verify(default, "default value")
end
- def load_async(source, op="load_async", transform_keys: :to_s)
+ def load_async(source, op="load_async", transform_keys: :to_s, timeout: 10)
return Promise.resolve(@default) if source.nil?
return Promise.resolve(source) unless source.is_a?(String)
- Dhall.load(source).then do |expr|
+ Dhall.load(source, timeout: timeout).then do |expr|
decode(expr, op, transform_keys: transform_keys)
end
end
- def load(source, transform_keys: :to_s)
- load_async(source, "load", transform_keys: transform_keys).sync
+ def load(source, transform_keys: :to_s, timeout: 10)
+ load_async(source, "load", transform_keys: transform_keys, timeout: timeout).sync
end
module ToRuby