Code from the "Keeping Ruby Reasonable" RubyConf presentation
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
capture_the_flag
greetings
README.md

README.md

Reasonable Ruby

This little repository contains some of the code samples that I used in my presentation at RubyConf 2011 titled "Keeping Ruby Reasonable". You can find the slides for the presentation here, and the video of the presentation is available from Confreaks here.

Contents

Greetings

This is a simple example of the potential danger of Ruby's first-class environments. Since every closure in Ruby captures all elements of its environment, and since the captured environment is live and mutable, it is possible to "rewrite" parts of a program if you have a handle to a closure.

Capture the Flag

This is a simple little game to demonstrate the difference between Proc objects and Method objects in Ruby. Both can be used to extract first-class environments, but only those extracted from Proc objects can be used to modify the defining scope.