summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/private.rb
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2014-12-19 12:25:21 +0100
committerTravis Fields <travis@puppetlabs.com>2015-03-05 10:59:31 -0800
commit56d815bcfc5f57d8dff974fd8bba192c6b141f89 (patch)
treed64a5cf7d5223e6bcba82248108ca32dd10ecadf /lib/puppet/parser/functions/private.rb
parent706b9e8205f1ff205226ef53e7d9b58de5cb6e54 (diff)
downloadpuppet-stdlib-56d815bcfc5f57d8dff974fd8bba192c6b141f89.tar.gz
puppet-stdlib-56d815bcfc5f57d8dff974fd8bba192c6b141f89.tar.bz2
Rename private() to assert_private()
As mentioned in #270, private is a reserved keyword in the future parser which is to be released with Puppet 4. As it stands, this function is not useable with the future parser so it needs to renamed. This is a breaking change.
Diffstat (limited to 'lib/puppet/parser/functions/private.rb')
-rw-r--r--lib/puppet/parser/functions/private.rb29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/puppet/parser/functions/private.rb b/lib/puppet/parser/functions/private.rb
deleted file mode 100644
index 60210d3..0000000
--- a/lib/puppet/parser/functions/private.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# private.rb
-#
-
-module Puppet::Parser::Functions
- newfunction(:private, :doc => <<-'EOS'
- Sets the current class or definition as private.
- Calling the class or definition from outside the current module will fail.
- EOS
- ) do |args|
-
- raise(Puppet::ParseError, "private(): Wrong number of arguments "+
- "given (#{args.size}}) for 0 or 1)") if args.size > 1
-
- scope = self
- if scope.lookupvar('module_name') != scope.lookupvar('caller_module_name')
- message = nil
- if args[0] and args[0].is_a? String
- message = args[0]
- else
- manifest_name = scope.source.name
- manifest_type = scope.source.type
- message = (manifest_type.to_s == 'hostclass') ? 'Class' : 'Definition'
- message += " #{manifest_name} is private"
- end
- raise(Puppet::ParseError, message)
- end
- end
-end