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.

Unicode Character Widths

Q: How do you determine how many terminal columns a string will take? A: It is not possible, because it is not standardized for every character! But you can achieve good results with EastAsianWidth.txt, Unicode’s general categories and other data. [more inside]

A Customized Approach to HTTP Proxy Caching in Ruby

AcornCache is a Ruby HTTP proxy caching library that is lightweight, configurable and can be easily integrated with any Rack-based web application. AcornCache allows you to improve page load times and lighten the load on your server by allowing you to implement an in-memory cache shared by every client requesting a resource on your server. Please visit https://github.com/acorncache/acorn-cache for further information.

Ruby Spaceship => Operator

Adhering to the law of trichotomy, the <=> operator (sometimes called the “Spaceship Operator”) works by comparing two elements and returning a -1, 0, or 1. While the original mathematical criteria applies to only real numbers, many programming languages implement the law of trichotomy as a general comparison between equivalent types. Ruby’s <=> operator can be a bit confusing but when understood, is very powerful.

Loading older posts