Skip to content

Instantly share code, notes, and snippets.

@benweint
Created April 4, 2013 21:59
Show Gist options
  • Save benweint/5314771 to your computer and use it in GitHub Desktop.
Save benweint/5314771 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
text = "</script></head>\n"
outpath = 'text.txt'
File.open(outpath, 'w') { |f| f.write(text) }
text_read = File.read(outpath)
puts "text == text_read => #{(text == text_read).inspect}"
puts "text.index('</head>') => #{text.index('</head>')}"
puts "text_read.index('</head>') => #{text_read.index('</head>')}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment