Class: FileParser
- Inherits:
-
Object
- Object
- FileParser
- Defined in:
- lib/rstub/file_parser.rb
Overview
FileParser goes through a file and writes the contents of it to a target file, but it ignores anything between the delimiters # STUB and # ENDSTUB.
Instance Method Summary collapse
Instance Method Details
#stub(target_file, file) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/rstub/file_parser.rb', line 4 def stub(target_file, file) File.open(file, 'r') do |readable_file| File.open(target_file, 'w') do |target| write_text(target, readable_file) end end end |