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.

Building a Public API in Rails 3

Just wrote up a detailed tutorial about building a public JSON/XML API on the Miso Engineering blog using Rails 3, OAuth, and the RABL gem for creating the response templates. Figured since we just built our fully fledged Public API with several available third-party applications available, that we should document some of our experiences. Let us know what you think and if there are any other related topics you’d like us to post about.

Cleanly add logging to your method calls with metaprogramming

If you’re running your Ruby scripts on a cron job, it’s important to log the output in case something goes wrong. Recording the output is as simple as appending “> somefile.txt” to your cron job. But can you avoid cluttering your code with lots of “puts” statements? Using a bit of metaprogramming, you can write a module that adds logging to whatever methods you specify. In this blog post, I’ll show you how.

I stopped taking this article seriously the moment I saw “define_method” in the…
Really? What would you use instead? Eval doesn’t seem like a good option. …
Look into how Rails implements alias_method_chain. http://metautonomo.us/2011/0…
Paul - what I’m doing is basically what that article shows, except that the nam…
Loading older posts