rubocop: revert has_precedence method rename

This commit is contained in:
Anatoliy Yastreb 2016-06-02 21:25:50 +03:00
parent 597e8ee5d5
commit e7677bdf51
1 changed files with 6 additions and 4 deletions

View File

@ -54,7 +54,7 @@ module Jekyll
old_scope = nil old_scope = nil
matching_sets(path, type).each do |set| matching_sets(path, type).each do |set|
if set["values"].key?(setting) && precedence?(old_scope, set["scope"]) if set["values"].key?(setting) && has_precedence?(old_scope, set["scope"])
value = set["values"][setting] value = set["values"][setting]
old_scope = set["scope"] old_scope = set["scope"]
end end
@ -72,7 +72,7 @@ module Jekyll
defaults = {} defaults = {}
old_scope = nil old_scope = nil
matching_sets(path, type).each do |set| matching_sets(path, type).each do |set|
if precedence?(old_scope, set["scope"]) if has_precedence?(old_scope, set["scope"])
defaults = Utils.deep_merge_hashes(defaults, set["values"]) defaults = Utils.deep_merge_hashes(defaults, set["values"])
old_scope = set["scope"] old_scope = set["scope"]
else else
@ -136,7 +136,8 @@ module Jekyll
# new_scope - the new scope hash # new_scope - the new scope hash
# #
# Returns true if the new scope has precedence over the older # Returns true if the new scope has precedence over the older
def precedence?(old_scope, new_scope) # rubocop: disable PredicateName
def has_precedence?(old_scope, new_scope)
return true if old_scope.nil? return true if old_scope.nil?
new_path = sanitize_path(new_scope["path"]) new_path = sanitize_path(new_scope["path"])
@ -144,12 +145,13 @@ module Jekyll
if new_path.length != old_path.length if new_path.length != old_path.length
new_path.length >= old_path.length new_path.length >= old_path.length
elsif new_scope.key? "type" elsif new_scope.key?("type")
true true
else else
!old_scope.key? "type" !old_scope.key? "type"
end end
end end
# rubocop: enable PredicateName
# Collects a list of sets that match the given path and type # Collects a list of sets that match the given path and type
# #