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.
Duck typing vs type safety
If you ever thought you don’t need type safety in Ruby because of duck typing, check out my article on this subject which explains what type safety means in Ruby.
Introduction to fragment caching in Rails
This is a short introduction to fragment caching in Rails - how it works, some gotchas and things to remember. The article also shows what Russian-doll caching is. http://blog.ragnarson.com/2016/11/02/introduction-to-fragment-caching-in-rails.html
Purposes & Properties of Value Objects
What is and what makes a good Value Object? Learn how to implement their fundamental purposes and properties. https://blog.dnsimple.com/2016/11/purposes-and-properties-of-value-objects
Parallelising IOS UI tests with Ruby!
This article is about a proof of concept script I built using Ruby and a set of awesome gems to parallelise IOS UI tests across virtual machines: http://teotti.com/parallelising-ios-ui-tests/
rspec-benchmark v0.2.0
The new release of rspec-benchmark fixes issue of propagating errors when using perform_under matcher.
Implementing Twitter Bot with Ruby
When I was 15 years old, I dreamed of being able to develop bots. The story behind was terribly simple, – back then it was way too popular among us (the little nerds) to manage own IRC bots which could do some fancy things like log the discussion or just stay online for a long time. We thought it was kind of outstanding, and it reveals the level of our knowledge. Read more
Building a Well-Polished Ruby Gem
Daniel P. Clark shares his tips for publishing high-quality Ruby gems. Read more here.
openstruct-from_hash
openstruct-from_hash adds a recursive constructor called from_hash to the OpenStruct class. It is a small utility method that I use often, so I decided to share on Github and Rubygems. Cheers.
FizzBuzz In Too Much Detail
I know. FizzBuzz has been done to death. But I want to use it as a familiar base upon which we can explore some of the common tradeoffs involved in writing and maintaining software.
BaseForm - Another simple form objects Rails plugin for ActiveRecord based projects
An alternative way to implement form objects. Check it here.
Matches, Rankings, The Social Network, League of Legends, and Ruby?
Yesterday I posted how people do rankings by popularity all wrong and what is the correct way to start implementing it. To wrap it up, I just posted about how people to ranking by matchings also very wrong. If you ever want to do online gaming, you must know how to rank the players correctly.
Refactoring Swift ViewController the Rails way
Sure knowledge gathered in one technology can help in another
KMS now supports Rails 5
Now it’s possible to use KMS in Rails 5 app - https://github.com/webgradus/kms
Keeping Data Integrity in Check: Conditional Unique Indexes for Soft Delete
Soft delete is a pretty common feature in most of the applications. It may increase complexity of the queries, nevertheless, not deleting anything might be a right default as the data might prove to be useful in the future: for restoring if a record was removed by mistake, to derive some conclusions based on statistics and plenty of other purposes. It may seem like it’s a pretty trivial thing: just adding a column like deleted_at and filtering out records that have this value present. But what happens when you need to do some proper uniqueness validation on both model layer and database level? Let’s take a look what kind of problem can easily be overlooked and how it can be solved with a conditional index. [more inside]
Why isn't server-side JavaScript more popular?
For some reason no one in the Rails community talks about this technique. Either no one is actually using it or no one is admitting that they are. Why is this…? Here’s my attempt at solving this mystery
Ruby on Rails implementation of a (proper) Ranking/Popularity system
We live surrounded rankings everywhere. But for some reasons we developers have just the wrong intuitions on how to calculate “popularity” to sort items in rankings. This is not new, the math has been sorted out since the early 1930’s and I read at least one good post in 2009 about it. So let’s see how to properly calculate popularities in Ruby.
Review: Keep Ruby Weird 2016
Keep Ruby Weird could easily be called “Remember Ruby’s Fun”. It’s a one day, one track conference in Austin that pays homage to the days of why’s (poignant) Guide to Ruby. Born in Austin, whose slogan is “Keep Austin Weird”, the city and conference didn’t disappoint. After parking my car in the hotel garage, I stepped into the elevator, and met with this disaster… Read More
String#concat, Array#concat and String#prepend take multiple arguments in Ruby 2.4
Ruby 2.4 now allows concat and prepend methods to take multiple arguments. [more inside]
Using LetsEncrypt SSL with Sinatra on Heroku
This is a short and straightforward tutorial showing how to use Sinatra on Heroku with an auto-renewing SSL certificate from LetsEncrypt. [more inside]
[Screencast] Rails API - Throttling with Rack::Attack
Save expensive calculation time using Rack::Attack, we will learn how to limit requests coming into our application. This gem not only limits requests, but can be used to blacklist or whitelist users as well. https://www.driftingruby.com/episodes/rails-api-throttling-with-rack-attack
Stubbing External APIs with WebMock
I’ve been testing code that uses third-party APIs for almost as long as I’ve been writing Ruby, but it wasn’t until recently that some particularly heavy integration requirements got me thinking about the right way to go about it. In this post, I describe the approach that I’ve been using to write fast, manageable tests for distributed systems using WebMock.