File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 5
5
checkstyle = 'style.xml,.checkstyle'
6
6
pmd = '.pmd,.ruleset,pmd.xml'
7
7
8
- files = Dir [ 'workspace/**/.project' ] . filter { |file_path | file_path =~ /.*?lab0[1234567].*/ }
8
+ files = Dir [ 'workspace/**/.project' ] . select { |file_path | file_path =~ /.*?lab0[1234567].*/ }
9
9
files . each do |file_path |
10
10
text = File . read ( file_path )
11
11
new_contents = text . gsub ( regex1 , '' ) . gsub ( regex2 , '' )
12
12
puts new_contents
13
13
File . write ( file_path , new_contents )
14
14
end
15
15
16
- files_to_delete = Dir [ "workspace/**/{#{ checkstyle } ,#{ pmd } }" ] . filter { |file_path | file_path =~ /.*?lab0[1234567].*/ }
16
+ files_to_delete = Dir [ "workspace/**/{#{ checkstyle } ,#{ pmd } }" ] . select { |file_path | file_path =~ /.*?lab0[1234567].*/ }
17
17
files_to_delete . each do |file_path |
18
18
puts "deleting #{ file_path } "
19
19
File . delete ( file_path )
You can’t perform that action at this time.
0 commit comments