lib/review/template.rb in review-2.3.0 vs lib/review/template.rb in review-2.4.0

- old
+ new

@@ -2,20 +2,19 @@ require 'review/extentions' module ReVIEW class Template include ERB::Util - TEMPLATE_DIR = File.join(File.dirname(__FILE__), "../../templates") + TEMPLATE_DIR = File.join(File.dirname(__FILE__), '../../templates') def self.load(filename, mode = 1) self.new(filename, mode) end def initialize(filename = nil, mode = nil) - if filename - content = File.read(filename) - @erb = ERB.new(content, nil, mode) - end + return unless filename + content = File.read(filename) + @erb = ERB.new(content, nil, mode) end def result(bind_data = nil) @erb.result(bind_data) end