All Projects → duelinmarkers → metaprogramming_introduction

duelinmarkers / metaprogramming_introduction

Licence: other
An article introducing Ruby metaprogramming fundamentals, in source code form.

Programming Languages

ruby
36898 projects - #4 most used programming language
A Ruby Metaprogramming Introduction is an article in Ruby source code form.

Read and run metaprogramming_introduction.rb. 

  ruby metaprogramming_introduction.rb

or if you want to make it output-heavy

  spec -f specdoc metaprogramming_introduction.rb

(The reading is the point. The running is only there to either reassure you
that what I tell you is true, or show you that it's not, in which case I hope
you'll let me know what version of Ruby you're running and other platformey
goodies.)

A version of this was originally published on the Practical Ruby blog. A while
back though I started updating it to be more useful and translating it to use
Rspec instead of the funny little Test::Unit extension (since Rspec reads just
as well but is more likely to be familiar to a reader).

Once it's all good and clever and readable I may put it out as a nicely
readable blog post again, but for now it'll just live here in Git. Chances are
it reads better in your editor of choice than on a web page anyway.

The originally published version can be viewed on GitHub at this URL:

http://github.com/duelinmarkers/metaprogramming_introduction/tree/9cd27dd8571b4428ef791ffa53646f4dd799b573




--------
Copyright John D. Hume 2008
Released under a Creative Commons Attribution-Share Alike 3.0 license
http://creativecommons.org/licenses/by-sa/3.0/
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].