Skip to content

Instantly share code, notes, and snippets.

@padi
Forked from chrismytton/README.md
Created July 16, 2013 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save padi/6010787 to your computer and use it in GitHub Desktop.
Save padi/6010787 to your computer and use it in GitHub Desktop.

Literate Ruby

Inspired by Literate CoffeeScript.

$ cat hello.rb.md
Here's a simple program

    puts "Hello, world"
$ ruby litrb.rb < hello.rb.md
Hello, world

Here's a simple program

puts "Hello, world"
eval ARGF.readlines.select { |l| l[/^([ ]{4}|\t)/] }.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment