lib/capistrano/template/helpers/dsl.rb in capistrano-template-0.0.4 vs lib/capistrano/template/helpers/dsl.rb in capistrano-template-0.0.5
- old
+ new
@@ -1,16 +1,16 @@
module Capistrano
module Template
module Helpers
module DSL
- def template(from, to = nil, mode = 0640)
+ def template(from, to = nil, mode = 0640, locals: {})
fail ::ArgumentError, "template #{from} not found Paths: #{template_paths_lookup.paths_for_file(from).join(':')}" unless template_exists?(from)
to ||= "#{release_path}/#{File.basename(from, '.erb')}"
to = remote_path_for(to, true)
- template = _template_factory.call(template_file(from), self, fetch(:templating_digster))
+ template = _template_factory.call(template_file(from), self, fetch(:templating_digster), locals)
_uploader_factory.call(to, self,
digest: template.digest,
digest_cmd: fetch(:templating_digest_cmd),
mode_test_cmd: fetch(:templating_mode_test_cmd),
@@ -51,10 +51,10 @@
includes_filename ? File.join(remote_path, filename) : remote_path
end
def _template_factory
- ->(from, context, digester) {TemplateDigester.new(Renderer.new(from, context), digester) }
+ ->(from, context, digester, locals) {TemplateDigester.new(Renderer.new(from, context, locals: locals), digester) }
end
def method_missing(method_name, *args)
if self.class.respond_to? method_name
self.class.send(method_name, *args)