parent
44062561f0
commit
8bb76c865f
|
@ -79,6 +79,8 @@ Metrics/MethodLength:
|
||||||
Severity: error
|
Severity: error
|
||||||
Metrics/ModuleLength:
|
Metrics/ModuleLength:
|
||||||
Max: 240
|
Max: 240
|
||||||
|
Exclude:
|
||||||
|
- lib/jekyll/filters.rb
|
||||||
Metrics/ParameterLists:
|
Metrics/ParameterLists:
|
||||||
Max: 4
|
Max: 4
|
||||||
Metrics/PerceivedComplexity:
|
Metrics/PerceivedComplexity:
|
||||||
|
|
|
@ -356,15 +356,24 @@ module Jekyll
|
||||||
@item_property_cache ||= {}
|
@item_property_cache ||= {}
|
||||||
@item_property_cache[property] ||= {}
|
@item_property_cache[property] ||= {}
|
||||||
@item_property_cache[property][item] ||= begin
|
@item_property_cache[property][item] ||= begin
|
||||||
if item.respond_to?(:to_liquid)
|
property = property.to_s
|
||||||
property.to_s.split(".").reduce(item.to_liquid) do |subvalue, attribute|
|
property = if item.respond_to?(:to_liquid)
|
||||||
parse_sort_input(subvalue[attribute])
|
read_liquid_attribute(item.to_liquid, property)
|
||||||
end
|
|
||||||
elsif item.respond_to?(:data)
|
elsif item.respond_to?(:data)
|
||||||
parse_sort_input(item.data[property.to_s])
|
item.data[property]
|
||||||
else
|
else
|
||||||
parse_sort_input(item[property.to_s])
|
item[property]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
parse_sort_input(property)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def read_liquid_attribute(liquid_data, property)
|
||||||
|
return liquid_data[property] unless property.include?(".")
|
||||||
|
|
||||||
|
property.split(".").reduce(liquid_data) do |data, key|
|
||||||
|
data.respond_to?(:[]) && data[key]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue