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
[ 2.3 ms ] story [ 3.5 ms ] threadc = "puts('c = ' + c.inspect + '\neval c')" eval c