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.

  Yesterday

Decoupling Ruby: Delegation vs Dependency Injection

We’ve all worked with tightly-coupled code. If a butterfly flaps its wings in China, the unit tests break. Maintaining a system like this is…unpleasant. In this article, Jonathan Miles dives into the origins of tight-coupling. He demonstrates how you can use dependency injection (DI) to decouple code. Then he introduces a novel decoupling technique based on delegation that can be useful when DI is not an option. https://www.honeybadger.io/blog/decoupling-ruby-delegation-dependency-injection/

date-formatter gem - date formatter by example; auto-builds strftime format string

Hello, I’ve put together a new date formatter gem that lets you format dates e.g. “January 02, 2006” using an example as a format string e.g “January 02, 2006” instead of the classic strftime format specifier e.g. “%B %d, %Y”. The date by example adds: String#to_strfime, Date#format, Time#format, DateTime#format, NilClass#format to the built-in classes for easy use. Happy date and time formatting. Cheers. Prost.

Loading older posts