Rubocop tweaks

This commit is contained in:
Thomas Reynolds 2015-04-26 11:13:29 -07:00
parent 4be3fcfd31
commit c87e2e026e
9 changed files with 22 additions and 26 deletions

View file

@ -252,7 +252,7 @@ module Middleman
Contract Pathname => Pathname
def strip_extensions(p)
p = p.sub_ext('') while ::Tilt[p.to_s] || p.extname === '.html'
p = p.sub_ext('') while ::Tilt[p.to_s] || p.extname == '.html'
Pathname(p.to_s + '.*')
end
@ -262,9 +262,9 @@ module Middleman
# @return [Boolean]
Contract IsA['Middleman::SourceFile'] => Bool
def valid?(file)
globally_valid = @validator.call(file) && !globally_ignored?(file)
return false unless @validator.call(file) && !globally_ignored?(file)
globally_valid && if @only.empty?
if @only.empty?
!@ignored.call(file)
else
@only.any? { |reg| reg.match(file[:relative_path].to_s) }