Skip to content

Commit a972e06

Browse files
author
Sharif Nassar
committed
Remove trailing whitespace
1 parent 5b85e7c commit a972e06

11 files changed

Lines changed: 29 additions & 29 deletions

File tree

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ delete_undef_values
225225
Deletes all instances of the undef value from an array or hash.
226226

227227
*Examples:*
228-
228+
229229
$hash = delete_undef_values({a=>'A', b=>'', c=>undef, d => false})
230230

231231
Would return: {a => 'A', b => '', d => false}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Puppet::Parser::Functions
2-
2+
33
newfunction(:base64, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
44
55
Base64 encode or decode a string based on the command and the string submitted
@@ -10,28 +10,28 @@ module Puppet::Parser::Functions
1010
$decodestring = base64('decode','dGhlc3RyaW5n')
1111
1212
ENDHEREDOC
13-
13+
1414
require 'base64'
15-
15+
1616
raise Puppet::ParseError, ("base64(): Wrong number of arguments (#{args.length}; must be = 2)") unless args.length == 2
1717

1818
actions = ['encode','decode']
1919

2020
unless actions.include?(args[0])
2121
raise Puppet::ParseError, ("base64(): the first argument must be one of 'encode' or 'decode'")
2222
end
23-
23+
2424
unless args[1].is_a?(String)
2525
raise Puppet::ParseError, ("base64(): the second argument must be a string to base64")
2626
end
27-
27+
2828
case args[0]
2929
when 'encode'
3030
result = Base64.encode64(args[1])
3131
when 'decode'
3232
result = Base64.decode64(args[1])
3333
end
34-
34+
3535
return result
3636
end
3737
end

lib/puppet/parser/functions/delete_undef_values.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ module Puppet::Parser::Functions
33
Returns a copy of input hash or array with all undefs deleted.
44
55
*Examples:*
6-
6+
77
$hash = delete_undef_values({a=>'A', b=>'', c=>undef, d => false})
88
99
Would return: {a => 'A', b => '', d => false}
1010
1111
$array = delete_undef_values(['A','',undef,false])
1212
1313
Would return: ['A','',false]
14-
14+
1515
EOS
1616
) do |args|
1717

1818
raise(Puppet::ParseError,
1919
"delete_undef_values(): Wrong number of arguments given " +
2020
"(#{args.size})") if args.size < 1
21-
22-
unless args[0].is_a? Array or args[0].is_a? Hash
21+
22+
unless args[0].is_a? Array or args[0].is_a? Hash
2323
raise(Puppet::ParseError,
2424
"delete_undef_values(): expected an array or hash, got #{args[0]} type #{args[0].class} ")
2525
end
26-
result = args[0].dup
26+
result = args[0].dup
2727
if result.is_a?(Hash)
2828
result.delete_if {|key, val| val.equal? :undef}
2929
elsif result.is_a?(Array)

lib/puppet/parser/functions/delete_values.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module Puppet::Parser::Functions
1919

2020
if not hash.is_a?(Hash)
2121
raise(TypeError, "delete_values(): First argument must be a Hash. " + \
22-
"Given an argument of class #{hash.class}.")
22+
"Given an argument of class #{hash.class}.")
2323
end
2424
hash.dup.delete_if { |key, val| item == val }
2525
end

lib/puppet/parser/functions/range.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module Puppet::Parser::Functions
2828
2929
Will return: ["host01", "host02", ..., "host09", "host10"]
3030
31-
Passing a third argument will cause the generated range to step by that
31+
Passing a third argument will cause the generated range to step by that
3232
interval, e.g.
3333
3434
range("0", "9", "2")

lib/puppet/parser/functions/str2bool.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Puppet::Parser::Functions
1414
"given (#{arguments.size} for 1)") if arguments.size < 1
1515

1616
string = arguments[0]
17-
17+
1818
# If string is already Boolean, return it
1919
if !!string == string
2020
return string

spec/unit/puppet/parser/functions/delete_at_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
result.should(eq(['a','c']))
1818
end
1919

20-
it "should not change origin array passed as argument" do
20+
it "should not change origin array passed as argument" do
2121
origin_array = ['a','b','c','d']
2222
result = scope.function_delete_at([origin_array, 1])
2323
origin_array.should(eq(['a','b','c','d']))
24-
end
24+
end
2525
end

spec/unit/puppet/parser/functions/delete_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
result.should(eq({ 'a' => 1, 'c' => 3 }))
3636
end
3737

38-
it "should not change origin array passed as argument" do
38+
it "should not change origin array passed as argument" do
3939
origin_array = ['a','b','c','d']
4040
result = scope.function_delete([origin_array, 'b'])
4141
origin_array.should(eq(['a','b','c','d']))
@@ -47,8 +47,8 @@
4747
origin_string.should(eq('foobarbabarz'))
4848
end
4949

50-
it "should not change origin hash passed as argument" do
51-
origin_hash = { 'a' => 1, 'b' => 2, 'c' => 3 }
50+
it "should not change origin hash passed as argument" do
51+
origin_hash = { 'a' => 1, 'b' => 2, 'c' => 3 }
5252
result = scope.function_delete([origin_hash, 'b'])
5353
origin_hash.should(eq({ 'a' => 1, 'b' => 2, 'c' => 3 }))
5454
end

spec/unit/puppet/parser/functions/delete_undef_values_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
result.should(eq({'a'=>'A','c'=>'C','d'=>'undef'}))
2828
end
2929

30-
it "should not change origin array passed as argument" do
30+
it "should not change origin array passed as argument" do
3131
origin_array = ['a',:undef,'c','undef']
3232
result = scope.function_delete_undef_values([origin_array])
3333
origin_array.should(eq(['a',:undef,'c','undef']))
34-
end
34+
end
3535

36-
it "should not change origin hash passed as argument" do
37-
origin_hash = { 'a' => 1, 'b' => :undef, 'c' => 'undef' }
36+
it "should not change origin hash passed as argument" do
37+
origin_hash = { 'a' => 1, 'b' => :undef, 'c' => 'undef' }
3838
result = scope.function_delete_undef_values([origin_hash])
3939
origin_hash.should(eq({ 'a' => 1, 'b' => :undef, 'c' => 'undef' }))
40-
end
40+
end
4141
end

spec/unit/puppet/parser/functions/delete_values_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
result.should(eq({ 'a'=>'A', 'B'=>'C' }))
2828
end
2929

30-
it "should not change origin hash passed as argument" do
31-
origin_hash = { 'a' => 1, 'b' => 2, 'c' => 3 }
30+
it "should not change origin hash passed as argument" do
31+
origin_hash = { 'a' => 1, 'b' => 2, 'c' => 3 }
3232
result = scope.function_delete_values([origin_hash, 2])
3333
origin_hash.should(eq({ 'a' => 1, 'b' => 2, 'c' => 3 }))
34-
end
34+
end
3535

3636
end

0 commit comments

Comments
 (0)