Skip to content

Commit 83b4711

Browse files
archanaserverekohl
authored andcommitted
Fix Style/Next cop
1 parent c235e55 commit 83b4711

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

rename.rb

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,16 @@ def usage
4545

4646
Find.find('.') do |path|
4747
# Change all the paths to the new snake_case name
48-
if /foreman_plugin_template/i.match?(path)
49-
new = path.gsub('foreman_plugin_template', snake)
50-
# Recursively copy the directory and store the original for deletion
51-
# Check for $ because we don't need to copy template/hosts for example
52-
if File.directory?(path) && path =~ /foreman_plugin_template$/i
53-
FileUtils.cp_r(path, new)
54-
old_dirs << path
55-
else
56-
# gsub replaces all instances, so it will work on the new directories
57-
FileUtils.mv(path, new)
58-
end
48+
next unless /foreman_plugin_template/i.match?(path)
49+
new = path.gsub('foreman_plugin_template', snake)
50+
# Recursively copy the directory and store the original for deletion
51+
# Check for $ because we don't need to copy template/hosts for example
52+
if File.directory?(path) && path =~ /foreman_plugin_template$/i
53+
FileUtils.cp_r(path, new)
54+
old_dirs << path
55+
else
56+
# gsub replaces all instances, so it will work on the new directories
57+
FileUtils.mv(path, new)
5958
end
6059
end
6160

0 commit comments

Comments
 (0)