Skip to content

Commit 158f179

Browse files
author
iglov
committed
move require from func; fix RuboCop 'Line is too long' issue
1 parent 6cd15c6 commit 158f179

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/puppet/functions/stdlib/ip_in_range.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# stdlib::ip_in_range('10.10.10.53', '10.10.10.0/24') => true
55
Puppet::Functions.create_function(:'stdlib::ip_in_range') do
66
# @param [String] ipaddress The IP address to check
7-
# @param [Variant[String, Array]] range One CIDR or an array of CIDRs defining the range(s) to check against
7+
# @param [Variant[String, Array]] range One CIDR or an array of CIDRs
8+
# defining the range(s) to check against
89
#
910
# @return [Boolean] True or False
1011
dispatch :ip_in_range do
@@ -13,9 +14,9 @@
1314
return_type 'Boolean'
1415
end
1516

16-
def ip_in_range(ipaddress, range)
17-
require 'ipaddr'
17+
require 'ipaddr'
1818

19+
def ip_in_range(ipaddress, range)
1920
ip = IPAddr.new(ipaddress)
2021

2122
if range.is_a? Array

0 commit comments

Comments
 (0)