Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dir.glob('spec/**/*.rb') do |f|
- content = File.read f
- next unless content.include? 'xhr'
- content.gsub! /xhr :(get|post|delete|patch), :([a-z_]*), (.*)/, '\1 :\2, \3 # xhr'
- File.write(f, content)
- `/Users/naekeompyuteo/.rbenv/shims/rubocop --auto-correct #{f}`
- content = File.read f
- content.gsub! ' # xhr', ', xhr: true'
- File.write(f, content)
- end
Add Comment
Please, Sign In to add comment