Show HN: Two line ruby quine
Thought you might like this. This Ruby program makes an exact copy of itself.
c = "File.open('new.rb', 'w') {|f| f.write('c = ' + c.inspect + '\neval c') }"
eval c
c = "File.open('new.rb', 'w') {|f| f.write('c = ' + c.inspect + '\neval c') }"
eval c
3 comments
[ 3.2 ms ] story [ 18.4 ms ] threadc = "puts('c = ' + c.inspect + '\neval c')" eval c