lib/deas/template.rb in deas-0.26.0 vs lib/deas/template.rb in deas-0.27.0
- old
+ new
@@ -74,12 +74,12 @@
class Partial < Template
def initialize(sinatra_call, name, locals = nil)
options = { :locals => (locals || {}) }
- name = begin
- basename = File.basename(name.to_s)
- name.to_s.sub(/#{basename}\Z/, "_#{basename}")
+ name = name.to_s.tap do |n|
+ basename = File.basename(n)
+ n.sub!(/#{basename}\Z/, "_#{basename}") unless basename[0] == '_'[0]
end
super sinatra_call, name, options
end
end