Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9345760
no_duplicate.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
866 B
Subscribers
None
no_duplicate.rb
View Options
#!/usr/bin/env ruby
`git clone https://github.com/puppetlabs/puppetlabs-stdlib stdlib`
extlib_functions
=
[]
Dir
.
glob
(
'lib/puppet/parser/functions/*.rb'
)
.
each
do
|
path
|
extlib_functions
<<
path
.
split
(
'/'
)
[-
1
].
split
(
'.'
)
[
0
]
end
stdlib_functions
=
[]
Dir
.
glob
(
'stdlib/lib/puppet/parser/functions/*.rb'
)
.
each
do
|
path
|
stdlib_functions
<<
path
.
split
(
'/'
)
[-
1
].
split
(
'.'
)
[
0
]
end
puts
'Stdlib functions:'
puts
stdlib_functions
puts
''
puts
'Extlib functions:'
puts
extlib_functions
puts
''
duplicate_functions
=
stdlib_functions
&
extlib_functions
puts
'Duplicate functions:'
puts
duplicate_functions
puts
''
if
!
duplicate_functions
.
length
.
empty?
puts
'Duplicate function(s) found! Please have unique function names between'
puts
'stdlib and extlib'
puts
'Test failed'
exit
1
else
puts
'No duplicate functions found'
puts
'Test passed'
exit
0
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Fri, Jul 4, 3:30 PM (1 w, 14 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3350776
Attached To
rSPEXTL puppet-extlib
Event Timeline
Log In to Comment