RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Submit a post

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

A quick tour of metaprogramming

If you pry into the beating heart of any Rails application, any testing framework, any beautiful DSL, you’ll find it filled with metaprogramming: code that writes code. In fact, a lot of the features Ruby devs use would be impossible without it. Yet many of us prefer to avoid metaprogramming in our own code. This is a brief tour of metaprogramming for Rubyists.

Put your tests to good use, Refactor with confidence

Testing your code well is hard, and it can be easy to neglect. You’ll be glad you didn’t though when you have to change the implementation of a feature without your users noticing anything, except maybe a performance bump. Let’s go through how we can use and modify existing tests to allow a change in code that you can be confident will work when you get to production.

Loading older posts