puppet-lint cleanup

This commit is contained in:
James Fryman 2012-11-09 11:08:24 -06:00
parent 747dcc6fc7
commit 88acc52393
12 changed files with 11 additions and 15 deletions

View file

@ -22,4 +22,3 @@
* Build a new package with puppet-module or the rake build task if it exists * Build a new package with puppet-module or the rake build task if it exists
* Publish the new package to the forge * Publish the new package to the forge
* Bonus points for an announcement to puppet-users. * Bonus points for an announcement to puppet-users.

View file

@ -4,7 +4,7 @@
module Puppet::Parser::Functions module Puppet::Parser::Functions
newfunction(:abs, :type => :rvalue, :doc => <<-EOS newfunction(:abs, :type => :rvalue, :doc => <<-EOS
Returns the absolute value of a number, for example -34.56 becomes Returns the absolute value of a number, for example -34.56 becomes
34.56. Takes a single integer and float value as an argument. 34.56. Takes a single integer and float value as an argument.
EOS EOS
) do |arguments| ) do |arguments|

View file

@ -4,7 +4,7 @@
module Puppet::Parser::Functions module Puppet::Parser::Functions
newfunction(:chomp, :type => :rvalue, :doc => <<-'EOS' newfunction(:chomp, :type => :rvalue, :doc => <<-'EOS'
Removes the record separator from the end of a string or an array of Removes the record separator from the end of a string or an array of
strings, for example `hello\n` becomes `hello`. strings, for example `hello\n` becomes `hello`.
Requires a single string or array as an input. Requires a single string or array as an input.
EOS EOS

View file

@ -4,9 +4,9 @@
module Puppet::Parser::Functions module Puppet::Parser::Functions
newfunction(:chop, :type => :rvalue, :doc => <<-'EOS' newfunction(:chop, :type => :rvalue, :doc => <<-'EOS'
Returns a new string with the last character removed. If the string ends Returns a new string with the last character removed. If the string ends
with `\r\n`, both characters are removed. Applying chop to an empty with `\r\n`, both characters are removed. Applying chop to an empty
string returns an empty string. If you wish to merely remove record string returns an empty string. If you wish to merely remove record
separators then you should use the `chomp` function. separators then you should use the `chomp` function.
Requires a string or array of strings as input. Requires a string or array of strings as input.
EOS EOS

View file

@ -15,7 +15,7 @@ Returns true if the string passed to this function is a valid IP address.
"given #{arguments.size} for 1") "given #{arguments.size} for 1")
end end
begin begin
ip = IPAddr.new(arguments[0]) ip = IPAddr.new(arguments[0])
rescue ArgumentError rescue ArgumentError
return false return false

View file

@ -4,7 +4,7 @@
module Puppet::Parser::Functions module Puppet::Parser::Functions
newfunction(:parseyaml, :type => :rvalue, :doc => <<-EOS newfunction(:parseyaml, :type => :rvalue, :doc => <<-EOS
This function accepts YAML as a string and converts it into the correct This function accepts YAML as a string and converts it into the correct
Puppet structure. Puppet structure.
EOS EOS
) do |arguments| ) do |arguments|

View file

@ -14,9 +14,9 @@ Returns a new string where runs of the same character that occur in this set are
end end
item = arguments[0] item = arguments[0]
squeezeval = arguments[1] squeezeval = arguments[1]
if item.is_a?(Array) then if item.is_a?(Array) then
if squeezeval then if squeezeval then
item.collect { |i| i.squeeze(squeezeval) } item.collect { |i| i.squeeze(squeezeval) }
else else

View file

@ -4,7 +4,7 @@
module Puppet::Parser::Functions module Puppet::Parser::Functions
newfunction(:str2bool, :type => :rvalue, :doc => <<-EOS newfunction(:str2bool, :type => :rvalue, :doc => <<-EOS
This converts a string to a boolean. This attempt to convert strings that This converts a string to a boolean. This attempt to convert strings that
contain things like: y, 1, t, true to 'true' and strings that contain things contain things like: y, 1, t, true to 'true' and strings that contain things
like: 0, f, n, false, no to 'false'. like: 0, f, n, false, no to 'false'.
EOS EOS

View file

@ -8,4 +8,3 @@ class Class
self.class_eval { private(*saved_private_instance_methods) } self.class_eval { private(*saved_private_instance_methods) }
end end
end end

View file

@ -19,7 +19,7 @@ describe "the fqdn_rotate function" do
end end
it "should rotate a string to give the same results for one host" do it "should rotate a string to give the same results for one host" do
scope.expects(:lookupvar).with("::fqdn").returns("127.0.0.1").twice scope.expects(:lookupvar).with("::fqdn").returns("127.0.0.1").twice
scope.function_fqdn_rotate(["abcdefg"]).should eql(scope.function_fqdn_rotate(["abcdefg"])) scope.function_fqdn_rotate(["abcdefg"]).should eql(scope.function_fqdn_rotate(["abcdefg"]))
end end

View file

@ -41,4 +41,3 @@ describe Puppet::Parser::Functions.function(:validate_hash) do
end end
end end

View file

@ -58,4 +58,3 @@ describe Puppet::Parser::Functions.function(:validate_string) do
end end
end end
end end