lib/jekyll/utils.rb in jekyll-3.1.6 vs lib/jekyll/utils.rb in jekyll-3.2.0.pre.beta1
- old
+ new
@@ -1,5 +1,6 @@
+
module Jekyll
module Utils
extend self
autoload :Platforms, 'jekyll/utils/platforms'
autoload :Ansi, "jekyll/utils/ansi"
@@ -51,30 +52,17 @@
if target.respond_to?(:default_proc) && overwrite.respond_to?(:default_proc) && target.default_proc.nil?
target.default_proc = overwrite.default_proc
end
- target.each do |key, val|
- target[key] = val.dup if val.frozen? && duplicable?(val)
- end
-
target
end
def mergable?(value)
value.is_a?(Hash) || value.is_a?(Drops::Drop)
end
- def duplicable?(obj)
- case obj
- when nil, false, true, Symbol, Numeric
- false
- else
- true
- end
- end
-
# Read array from the supplied hash favouring the singular key
# and then the plural key, and handling any nil entries.
#
# hash - the hash to read from
# singular_key - the singular key
@@ -137,10 +125,10 @@
# Returns the parsed date if successful, throws a FatalException
# if not
def parse_date(input, msg = "Input could not be parsed.")
Time.parse(input).localtime
rescue ArgumentError
- raise Errors::FatalException.new("Invalid date '#{input}': " + msg)
+ raise Errors::InvalidDateError, "Invalid date '#{input}': #{msg}"
end
# Determines whether a given file has
#
# Returns true if the YAML front matter is present.