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
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Clean Ruby with cleaner privates (DCI)
Understanding the context of code in a team repo is hard and it’s harder when the solution to figuring how code works is, “I Don’t Know, just Git Blame and talk to the person who wrote it.” That works until the person to blame is either yourself or unavailable. Read more
Encapsulating Business Transactions With Transflow
A short introduction to a new gem I wrote: Encapsulating Business Transactions With Transflow
What the hash?
Recently I came across a piece of ruby code that got me a bit puzzled, so I explored the edge cases of Hash.new method.
Polymorphic Associations With Active Record
Active Record Associations are one of the most important features of Rails. Polymorphic association is part of these associations. With polymorphic association, a model can belong to more than one other model, on a single association. Why do we need associations between models? To read full article visit, RailsCarma Blog
Paypal Express Checkout
I have upgraded railscast source code for Paypal Express Checkout using Ruby 2.2.2, Rails 4.2.3 and ActiveMerchant 1.52.0, here is the source code:
Battling with the 'Known Unknowns' to keep inline with SRP
One never gets tired of some grandiose considerations on the fundamental principle of OOP. Here’s the 1st part of an article on SRP the Second part being closely related to an article that has been submitted here today about Interactors… There’s no coïncidences :-)
Redirecting HTTP requests using the IP address of a client in your Apache Config
Maybe you’ve got some Ruby or even Rails webservice running for different clients. Given that you need to serve some different resources to different customers under the same URL, redirecting requests based on IP address ranges can by quite handy. Read this article to find out how you can do that with Apache 2.4.
Introducing Interactors to represent getting stuff done.
This post introduces interactors, also know as usecases or service objects. See how your domain code can be separated from your framework. http://insights.workshop14.io/2015/08/16/introducing-interactors-to-represent-getting-stuff-done.html
mrh/mrhyde - static site quick starter script wizard - jekyll command tool
Hello, I’ve put together the mrhyde-tools gem that includes a command line tool that lets you run static site quick starter wizard scripts. For example, use $ mrhyde new starter or $ mrh n starter to download and install (unzip/unpack) a theme archive and configure a static site ready-to-use. For more quick starter wizard scripts see the Mr. Hyde’s Scripts library. For more themes see the Dr. Jekyll’s Themes directory. Cheers.
Faster TDD in Rails with Bundler's 'require: false'
This post explains why the Rails default behaviour of requiring all your gems automatically will lead to a slow TDD feedback cycle. Learn how to speed this up by avoiding loading gems unnecessarily, and also why using Spring may not be a good approach. Read more
Extracting SEO data the easy way
Do you need to extract data from web pages as input for other Ruby programs? It turns out the Nokogiri gem scrapes html fast. You’ll use it to extract SEO data in this short tutorial.
Announcing Rails Rumble 2015!
I’m really happy to announce Rails Rumble 2015. Hope to see you in a few months!
Use a fake DB adapter to avoid connection errors with rails assets precompile
If you are using docker for your rails deploys you might have run into the issue of compiling your assets before you database container is available. The usual solution is to precompile the assets on your local machine and track them within you version control system. There is, however, an alternative: use a fake DB adapter during asset compilation. Read more
Handling Bugs in your Cucumber Test Suite
Cucumber is quite a cool tool to build a test suite. Maybe you know the situation: You are the developer of some ruby library and support JRUBY and MRI-Ruby on Windows and Linux. You might have gotten into a pretty pickle adding a new feature whose tests only fails if you run them with JRuby. If the reason for this failure is a bug in the platform, you may need to work around this bug. This article describes a technique, how you can do that with cucumber.
IDs, Please!
Or the easiest way to get all the info you can get on a person from his social account link
Write One-Liner RSpec Tests In Rails With Shoulda-Matchers
Learn how to write robust, shorter and less complicated tests with shoulda-matchers, one-liners that provide an easy way to simplify Test::Unit and RSpec tests.
RubySeeds -- an opionated repository of core_exts
RubySeeds is a repository (not a gem!) for storing easily copied and frequently useful extensions to Ruby’s core classes.
drj/drjekyll - the missing static site theme package manager - jekyll command tool
Hello, I’ve put together the drjekyll gem that includes a command line tool that lets you manage static site theme packages. For example, use $ drjekyll list or $ drj ls to list all 100+ themes. To download and unzip a theme archive use the “installation code”, for example, use $ drjekyll new starter or $ drj new starter to dowload and unzip the Planet Jekyll’s Starter (Minimal) theme and so on. For more see the drj/drjekyll project site. Cheers.
We have Markov noodles for dinner
A story about Markov chains, how they work and why I decided to write a new gem for generating text.
InlineTranslation
I’m happy to announce the first iteration release of InlineTranslation, a ruby gem which wraps the Bing translator (same as used on Facebook / Twitter), and provides a quick and easy way to allow users to read user-generated content in other languages.
Updated Case When section in I Love Ruby
Grab the book here
How to Process Large Data Sets with Ruby
The need for data migrations in mature systems is real. At times, requests for these migrations can appear at random. One minute, a system is behaving as specified, happily fulfilling requests, and then bam! All the user objects suddenly need an extremely crucial attribute. Find out how to do such a data migration in a fast and efficient way.