From a68614db67ad4ec5a289b9e34e6f88182d71aa2e Mon Sep 17 00:00:00 2001 From: Jesse Reynolds Date: Wed, 11 Jul 2018 11:16:00 +0930 Subject: [PATCH 1/2] exclude this type from `puppet module generate` --- lib/puppet/type/transport.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/puppet/type/transport.rb b/lib/puppet/type/transport.rb index 2f592bf..8917476 100644 --- a/lib/puppet/type/transport.rb +++ b/lib/puppet/type/transport.rb @@ -21,6 +21,19 @@ end defaultto({}) end + + # NOTE: Should match the behavior of the default titlepattern which is to set + # the `name` parameter. Intentionally uses a lambda to disqualify this + # type from compilation by `puppet generate types` so that the + # metaparameter definition below still works. + # + # FIXME: This is some epic hacky bullshit that will extract a price from + # someone in the future If you're reading this comment, find a way + # to kill this. Good luck and godspeed. + def self.title_patterns + [[/(.*)/m, [[:name, lambda {|x| x}]]]] + end + end unless Puppet::Type.metaparams.include? :transport From b81e75fdd4ae95cb4ee4f2c577d5dd73dc32c78f Mon Sep 17 00:00:00 2001 From: Jesse Reynolds Date: Wed, 11 Jul 2018 12:55:33 +0930 Subject: [PATCH 2/2] fix grammar in comment --- lib/puppet/type/transport.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/type/transport.rb b/lib/puppet/type/transport.rb index 8917476..767311b 100644 --- a/lib/puppet/type/transport.rb +++ b/lib/puppet/type/transport.rb @@ -28,7 +28,7 @@ # metaparameter definition below still works. # # FIXME: This is some epic hacky bullshit that will extract a price from - # someone in the future If you're reading this comment, find a way + # someone in the future. If you're reading this comment, find a way # to kill this. Good luck and godspeed. def self.title_patterns [[/(.*)/m, [[:name, lambda {|x| x}]]]]