lib/sdoc/templatable.rb in sdoc-0.4.1 vs lib/sdoc/templatable.rb in sdoc-0.4.2
- old
+ new
@@ -1,7 +1,6 @@
require 'erb'
-require "sdoc"
module SDoc::Templatable
### Load and render the erb template in the given +templatefile+ within the
### specified +context+ (a Binding object) and return output
### Both +templatefile+ and +outfile+ should be Pathname-like objects.
@@ -16,11 +15,11 @@
raise RDoc::Error, "Error while evaluating %s: %s (at %p)" % [
templatefile.to_s,
err.message,
eval( "_erbout[-50,50]", context )
], err.backtrace
- end
+ end
end
### Load and render the erb template with the given +template_name+ within
### current context. Adds all +local_assigns+ to context
def include_template(template_name, local_assigns = {})
@@ -41,11 +40,10 @@
encoding = output.encoding
output = output.force_encoding('ASCII-8BIT').gsub('<script>', '<script;>').force_encoding(encoding)
else
output = output.gsub('<script>', '<script>')
end
- rescue Exception => e
-
+ rescue Exception
end
unless $dryrun
outfile.dirname.mkpath
outfile.open( 'w', 0644 ) do |file|