Method: Transpec::BaseRewriter#rewrite_file!
- Defined in:
- lib/transpec/base_rewriter.rb
#rewrite_file!(file_path) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/transpec/base_rewriter.rb', line 8 def rewrite_file!(file_path) source = File.read(file_path) rewritten_source = rewrite(source, file_path) return if source == rewritten_source File.write(file_path, rewritten_source) end |