diff --git a/.fixtures.yml b/.fixtures.yml index 10f7191..12646cb 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,9 +1,8 @@ fixtures: repositories: facts: 'https://github.com/puppetlabs/puppetlabs-facts.git' provision: 'https://github.com/puppetlabs/provision.git' puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git' - translate: 'https://github.com/puppetlabs/puppetlabs-translate.git' symlinks: concat: '#{source_dir}' diff --git a/locales/config.yaml b/locales/config.yaml deleted file mode 100644 index b97d80b..0000000 --- a/locales/config.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# This is the project-specific configuration file for setting up -# fast_gettext for your project. -gettext: - # This is used for the name of the .pot and .po files; they will be - # called .pot? - project_name: puppetlabs-concat - # This is used in comments in the .pot and .po files to indicate what - # project the files belong to and should bea little more desctiptive than - # - package_name: puppetlabs-concat - # The locale that the default messages in the .pot file are in - default_locale: en - # The email used for sending bug reports. - bugs_address: docs@puppet.com - # The holder of the copyright. - copyright_holder: Puppet, Inc. - # This determines which comments in code should be eligible for translation. - # Any comments that start with this string will be externalized. (Leave - # empty to include all.) - comments_tag: TRANSLATOR - # Patterns for +Dir.glob+ used to find all files that might contain - # translatable content, relative to the project root directory - source_files: - - './lib/**/*.rb' - diff --git a/locales/ja/puppetlabs-concat.po b/locales/ja/puppetlabs-concat.po deleted file mode 100644 index 72c69f5..0000000 --- a/locales/ja/puppetlabs-concat.po +++ /dev/null @@ -1,110 +0,0 @@ -# #-#-#-#-# puppetlabs-concat.pot (puppetlabs-concat 5.1.0-17-g0f37d63) #-#-#-#-# -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2018 Puppet, Inc. -# This file is distributed under the same license as the puppetlabs-concat package. -# FIRST AUTHOR , 2018. -# -# #-#-#-#-# puppetlabs-concat_metadata.pot (PACKAGE VERSION) #-#-#-#-# -# -# Translators: -# Kojima Ai , 2018 -# 下宮 祐子 , 2018 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-11-30T14:59:51+00:00\n" -"PO-Revision-Date: 2018-12-15 00:41+0000\n" -"Last-Translator: 下宮 祐子 , 2018\n" -"Language-Team: Japanese (Japan) (https://www.transifex.com/puppet/teams/41915/ja_JP/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja_JP\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Translate Toolkit 2.0.0\n" - -#. ./manifests/fragment.pp:27 -msgid "" -"%{_resource}['%{_title}']: 'order' cannot contain '/', ':', or '\n" -"'." -msgstr "" -"%{_resource}['%{_title}']: 'order'には、'/'、':'、'\n" -"'を含めることはできません。" - -#. ./manifests/fragment.pp:33 -msgid "" -"%{_resource}['%{_title}']: Can't use 'source' and 'content' at the same " -"time." -msgstr "%{_resource}['%{_title}']: 'source'と'content'は同時に使用できません。" - -#: ../lib/puppet/type/concat_file.rb:52 -msgid "File paths must be fully qualified, not '%{_value}'" -msgstr "ファイルパスは'%{_value}'ではなく、完全修飾でなければなりません" - -#: ../lib/puppet/type/concat_file.rb:96 -msgid "Backup must be a Boolean or String" -msgstr "バックアップはブール値または文字列でなければなりません" - -#: ../lib/puppet/type/concat_file.rb:114 -msgid "Validate_cmd must be a String" -msgstr "Validate_cmdは文字列でなければなりません" - -#: ../lib/puppet/type/concat_file.rb:150 -msgid "Selrange must be a String" -msgstr "Selrangeは文字列でなければなりません" - -#: ../lib/puppet/type/concat_file.rb:157 -msgid "Selrole must be a String" -msgstr "Selroleは文字列でなければなりません" - -#: ../lib/puppet/type/concat_file.rb:164 -msgid "Seltype must be a String" -msgstr "Seltypeは文字列でなければなりません" - -#: ../lib/puppet/type/concat_file.rb:171 -msgid "Seluser must be a String" -msgstr "Seluserは文字列でなければなりません" - -#: ../lib/puppet/type/concat_file.rb:306 -msgid "Could not retrieve source(s) %{_array}" -msgstr "ソース%{_array}を取得できませんでした" - -#: ../lib/puppet/type/concat_fragment.rb:29 -msgid "Target must be a String" -msgstr "ターゲットは文字列でなければなりません" - -#: ../lib/puppet/type/concat_fragment.rb:39 -msgid "Content must be a String" -msgstr "コンテンツは文字列でなければなりません" - -#: ../lib/puppet/type/concat_fragment.rb:50 -msgid "Content must be a String or Array" -msgstr "コンテンツは文字列または配列でなければなりません" - -#: ../lib/puppet/type/concat_fragment.rb:62 -msgid "$order is not a string or integer." -msgstr "$orderは文字列ではなく整数でもありません。" - -#: ../lib/puppet/type/concat_fragment.rb:63 -msgid "Order cannot contain '/', ':', or '\\n'." -msgstr "オーダには、'/'、':'、'\\n'を含めることはできません。" - -#: ../lib/puppet/type/concat_fragment.rb:87 -msgid "No 'target' or 'tag' set" -msgstr "'target'または'tag'が設定されていません" - -#: ../lib/puppet/type/concat_fragment.rb:90 -msgid "Set either 'source' or 'content'" -msgstr "'source'または'content'を設定してください" - -#: ../lib/puppet/type/concat_fragment.rb:93 -msgid "Can't use 'source' and 'content' at the same time" -msgstr "'source'と'content'は同時に使用できません" - -#. metadata.json -#: .summary -msgid "Construct files from multiple fragments." -msgstr "複数のフラグメントからファイルを構築します。" diff --git a/locales/puppetlabs-concat.pot b/locales/puppetlabs-concat.pot deleted file mode 100644 index bd64e49..0000000 --- a/locales/puppetlabs-concat.pot +++ /dev/null @@ -1,127 +0,0 @@ -# #-#-#-#-# puppetlabs-concat.pot (puppetlabs-concat 5.1.0-17-g0f37d63) #-#-#-#-# -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2018 Puppet, Inc. -# This file is distributed under the same license as the puppetlabs-concat package. -# FIRST AUTHOR , 2018. -# -# #-#-#-#-# puppetlabs-concat_metadata.pot (PACKAGE VERSION) #-#-#-#-# -# -#, fuzzy -msgid "" -msgstr "" -"#-#-#-#-# puppet.pot (PACKAGE VERSION) #-#-#-#-#\n" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-11-30 15:33:30 +0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Translate Toolkit 2.0.0\n" -"#-#-#-#-# puppetlabs-concat.pot (puppetlabs-concat 5.1.0-17-g0f37d63) #-#-" -"#-#-#\n" -"Project-Id-Version: puppetlabs-concat 5.1.0-17-g0f37d63\n" -"\n" -"Report-Msgid-Bugs-To: docs@puppet.com\n" -"POT-Creation-Date: 2018-11-30 15:33+0000\n" -"PO-Revision-Date: 2018-11-30 15:33+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -"#-#-#-#-# puppetlabs-concat_metadata.pot (PACKAGE VERSION) #-#-#-#-#\n" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To:\n" -"POT-Creation-Date: 2018-11-30T14:59:51+00:00\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Translate Toolkit 2.0.0\n" - -#. ./manifests/fragment.pp:27 -msgid "" -"%{_resource}['%{_title}']: 'order' cannot contain '/', ':', or '\n" -"'." -msgstr "" - -#. ./manifests/fragment.pp:33 -msgid "" -"%{_resource}['%{_title}']: Can't use 'source' and 'content' at the same time." -msgstr "" - -#: ../lib/puppet/type/concat_file.rb:52 -msgid "File paths must be fully qualified, not '%{_value}'" -msgstr "" - -#: ../lib/puppet/type/concat_file.rb:96 -msgid "Backup must be a Boolean or String" -msgstr "" - -#: ../lib/puppet/type/concat_file.rb:114 -msgid "Validate_cmd must be a String" -msgstr "" - -#: ../lib/puppet/type/concat_file.rb:150 -msgid "Selrange must be a String" -msgstr "" - -#: ../lib/puppet/type/concat_file.rb:157 -msgid "Selrole must be a String" -msgstr "" - -#: ../lib/puppet/type/concat_file.rb:164 -msgid "Seltype must be a String" -msgstr "" - -#: ../lib/puppet/type/concat_file.rb:171 -msgid "Seluser must be a String" -msgstr "" - -#: ../lib/puppet/type/concat_file.rb:306 -msgid "Could not retrieve source(s) %{_array}" -msgstr "" - -#: ../lib/puppet/type/concat_fragment.rb:29 -msgid "Target must be a String" -msgstr "" - -#: ../lib/puppet/type/concat_fragment.rb:39 -msgid "Content must be a String" -msgstr "" - -#: ../lib/puppet/type/concat_fragment.rb:50 -msgid "Content must be a String or Array" -msgstr "" - -#: ../lib/puppet/type/concat_fragment.rb:62 -msgid "$order is not a string or integer." -msgstr "" - -#: ../lib/puppet/type/concat_fragment.rb:63 -msgid "Order cannot contain '/', ':', or '\\n'." -msgstr "" - -#: ../lib/puppet/type/concat_fragment.rb:87 -msgid "No 'target' or 'tag' set" -msgstr "" - -#: ../lib/puppet/type/concat_fragment.rb:90 -msgid "Set either 'source' or 'content'" -msgstr "" - -#: ../lib/puppet/type/concat_fragment.rb:93 -msgid "Can't use 'source' and 'content' at the same time" -msgstr "" - -#. metadata.json -#: .summary -msgid "Construct files from multiple fragments." -msgstr "" diff --git a/manifests/fragment.pp b/manifests/fragment.pp index a9c0f0f..b1957b6 100644 --- a/manifests/fragment.pp +++ b/manifests/fragment.pp @@ -1,61 +1,57 @@ # @summary # Manages a fragment of text to be compiled into a file. # # @param content # Supplies the content of the fragment. Note: You must supply either a content parameter or a source parameter. # Allows a String or a Deferred function which returns a String. # # @param order # Reorders your fragments within the destination file. Fragments that share the same order number are ordered by name. The string # option is recommended. # # @param source # Specifies a file to read into the content of the fragment. Note: You must supply either a content parameter or a source parameter. # Valid options: a string or an array, containing one or more Puppet URLs. # # @param target # Specifies the destination file of the fragment. Valid options: a string containing the path or title of the parent concat resource. # define concat::fragment ( String $target, Optional[Any] $content = undef, Optional[Variant[String, Array]] $source = undef, Variant[String, Integer] $order = '10', ) { $resource = 'Concat::Fragment' if ($order =~ String and $order =~ /[:\n\/]/) { - # lint:ignore:140chars - fail(translate("%{_resource}['%{_title}']: 'order' cannot contain '/', ':', or '\\n'.", { '_resource' => $resource, '_title' => $title })) - # lint:endignore + fail("${resource}['${title}']: 'order' cannot contain '/', ':', or '\\n'.") } if ! ($content or $source) { crit('No content, source or symlink specified') } elsif ($content and $source) { - # lint:ignore:140chars - fail(translate("%{_resource}['%{_title}']: Can't use 'source' and 'content' at the same time.", { '_resource' => $resource, '_title' => $title })) - # lint:endignore + fail("${resource}['${title}']: Can't use 'source' and 'content' at the same time.") } # $serverversion is empty on 'puppet apply' runs. Just use clientversion. $_serverversion = getvar('serverversion') ? { undef => $clientversion, default => $serverversion, } if versioncmp($clientversion, '6.0') >= 0 and versioncmp($_serverversion, '6.0') >= 0 { assert_type(Optional[Variant[String, Deferred]], $content) } else { assert_type(Optional[String], $content) } $safe_target_name = regsubst($target, '[\\\\/:~\n\s\+\*\(\)@]', '_', 'GM') concat_fragment { $name: target => $target, tag => $safe_target_name, order => $order, content => $content, source => $source, } } diff --git a/metadata.json b/metadata.json index 4f09eb3..0d8dab0 100644 --- a/metadata.json +++ b/metadata.json @@ -1,113 +1,109 @@ { "name": "puppetlabs-concat", "version": "7.0.0", "author": "puppetlabs", "summary": "Construct files from multiple fragments.", "license": "Apache-2.0", "source": "https://github.com/puppetlabs/puppetlabs-concat", "project_page": "https://github.com/puppetlabs/puppetlabs-concat", "issues_url": "https://tickets.puppetlabs.com/browse/MODULES", "dependencies": [ { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.13.1 < 8.0.0" - }, - { - "name": "puppetlabs/translate", - "version_requirement": ">= 1.0.0 < 3.0.0" } ], "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "6", "7", "8" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "6", "7", "8" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "SLES", "operatingsystemrelease": [ "12", "15" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "8", "9", "10" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "14.04", "16.04", "18.04", "20.04" ] }, { "operatingsystem": "Solaris", "operatingsystemrelease": [ "10", "11" ] }, { "operatingsystem": "Windows", "operatingsystemrelease": [ "2008 R2", "2012", "2012 R2", "2016", "2012 R2 Core", "7", "8.1", "10" ] }, { "operatingsystem": "AIX", "operatingsystemrelease": [ "5.3", "6.1", "7.1" ] } ], "requirements": [ { "name": "puppet", "version_requirement": ">= 6.0.0 < 8.0.0" } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", "template-ref": "heads/main-0-g2bf2de6", "pdk-version": "1.18.1" }