lib/cc/analyzer/formatters/html_formatter.rb in codeclimate-0.85.24 vs lib/cc/analyzer/formatters/html_formatter.rb in codeclimate-0.85.25
- old
+ new
@@ -207,15 +207,11 @@
position_to_line(location["positions"][type])
end
end
def position_to_line(position)
- if position["line"]
- position["line"]
- else
- @source_buffer.decompose_position(position["offset"]).first
- end
+ position["line"] || @source_buffer.decompose_position(position["offset"]).first
end
end
class SourceFile
def initialize(path, filesystem)
@@ -366,10 +362,10 @@
@filesystem = filesystem
end
def render
template = File.read(TEMPLATE_PATH)
- ERB.new(template, nil, "-").result(binding)
+ ERB.new(template, trim_mode: "-").result(binding)
end
def project_name
File.basename(filesystem.root)
end