Guest User

Untitled

a guest
Jun 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Dir.glob('spec/**/*.rb') do |f|
  2. content = File.read f
  3. next unless content.include? 'xhr'
  4.  
  5. content.gsub! /xhr :(get|post|delete|patch), :([a-z_]*), (.*)/, '\1 :\2, \3 # xhr'
  6. File.write(f, content)
  7. `/Users/naekeompyuteo/.rbenv/shims/rubocop --auto-correct #{f}`
  8.  
  9. content = File.read f
  10. content.gsub! ' # xhr', ', xhr: true'
  11. File.write(f, content)
  12. end
Add Comment
Please, Sign In to add comment