lib/hound/hound_config.rb in hound-cli-0.1.1 vs lib/hound/hound_config.rb in hound-cli-0.1.2
- old
+ new
@@ -5,19 +5,19 @@
@@content ||= load_content
end
def self.enabled_for?(linter_name)
# disabled if linter_name key does not exist in hound.yml
- return false unless content.has_key?(linter_name)
+ return false unless content.key?(linter_name)
options = options_for(linter_name)
# enabled if linter_name key exists and enabled key is not defined.
return true unless options.keys.select { |k| k.downcase === "enabled" }.any?
# enabled "enabled" or "Enabled" keys are true.
!!options["enabled"] || !!options["Enabled"]
end
def self.options_for(linter_name)
- return content[linter_name] if content.try(:has_key?, linter_name)
+ return content[linter_name] if content.respond_to?(:key?) && content.key?(linter_name)
Hash.new
end
def self.rules_url_for(linter_name)
path_in_repo = options_for(linter_name)["config_file"].to_s