lib/pdk/template/renderer/v1/renderer.rb in pdk-2.6.1 vs lib/pdk/template/renderer/v1/renderer.rb in pdk-2.7.0
- old
+ new
@@ -19,11 +19,11 @@
# @see PDK::Template::Renderer::AbstractRenderer.render_single_item
def render_single_item(relative_file_path, template_data_hash)
template_file = single_item_path(relative_file_path)
return nil unless PDK::Util::Filesystem.file?(template_file) && PDK::Util::Filesystem.readable?(template_file)
- PDK.logger.debug(_("Rendering '%{template}'...") % { template: template_file })
+ PDK.logger.debug("Rendering '%{template}'..." % { template: template_file })
new_template_file(template_file, template_data_hash).render
end
# Returns the full path for a single item
#
@@ -69,11 +69,11 @@
legacy_template_dir = new_legacy_template_dir(context, template_uri, template_root, options[:module_metadata] || {})
files_in_template(dirs).each do |template_file, template_loc|
template_file = template_file.to_s
- PDK.logger.debug(_("Rendering '%{template}'...") % { template: template_file })
+ PDK.logger.debug("Rendering '%{template}'..." % { template: template_file })
dest_path = template_file.sub(%r{\.erb\Z}, '')
config = legacy_template_dir.config_for(dest_path)
dest_status = if template_loc.start_with?(moduleroot_init)
:init
@@ -87,14 +87,12 @@
dest_status = :delete
else
begin
dest_content = new_template_file(File.join(template_loc, template_file), configs: config, template_dir: legacy_template_dir).render
rescue => error
- error_msg = _(
- "Failed to render template '%{template}'\n" \
- '%{exception}: %{message}',
- ) % { template: template_file, exception: error.class, message: error.message }
+ error_msg = "Failed to render template '%{template}'\n" \
+ '%{exception}: %{message}' % { template: template_file, exception: error.class, message: error.message }
raise PDK::CLI::FatalError, error_msg
end
end
yield dest_path, dest_content, dest_status
@@ -111,10 +109,10 @@
# @api private
def files_in_template(dirs, glob_suffix = ['**', '*'])
temp_paths = []
dirlocs = []
dirs.each do |dir|
- raise ArgumentError, _("The directory '%{dir}' doesn't exist") % { dir: dir } unless PDK::Util::Filesystem.directory?(dir)
+ raise ArgumentError, "The directory '%{dir}' doesn't exist" % { dir: dir } unless PDK::Util::Filesystem.directory?(dir)
temp_paths += PDK::Util::Filesystem.glob(File.join(dir, *glob_suffix), File::FNM_DOTMATCH).select do |template_path|
if PDK::Util::Filesystem.file?(template_path) && !PDK::Util::Filesystem.symlink?(template_path)
dirlocs << dir
end
end