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.
Testing async ActionMailer jobs with ActiveJob in Minitest
If you send mails via ActiveJob and use Minitest, here’s a bit of code that helps you test it:
Administrate Gem Added to Rails Composer
The nice new Administrate gem from Thoughtbot is now an option in Rails Composer when you build a starter application. Chris Oliver shows what the gem can do in a GoRails screencast.
Three Ways to Redefine a Private Method
Learn the different ways to redefine a private method and evaluate the impact of each approach.
Create maintainable queries in Ruby with query object and criterias
Leaving query logic in a single class lead to god objects hard to maintain, I explain a maintainable alternative with query objects and criterias The examples use mongodb but can be implemented with Active Record too.
Minitest-ok 0.1.0
Minitest-ok 0.1.0 released. Using Minitest::Ok, you can write: Read more
Understanding Rack Middleware
Rack middleware is a simple and yet powerful way to plug custom reusable code into not just Rails but virtually any Ruby web application. But wrapping your head around Rack middleware and the way it works can be a daunting task at first. Let’s write some plain ruby to better grasp what’s going on behind the scenes.
Basics of Protected Methods in Ruby 2.2.3
Learn the Basics of Protected Methods in Ruby 2.2.3 using simple examples.
sermepa_web_tpv gem updated to new hmac 256 signature
I’ve just released a new update of the Spanish payment gateway sermepa_web_tpv. It implements the new signature system based on hmac 256
Rack::TestApp, intuitive testing helper for Rack
Rack::TestApp 1.0.0 released. It is intuitive helper library to test Rack application. See README for details.
Method transplanting in Ruby
Method transplanting is an elegant solution to keeping classes clean. This solution will work perfectly when a transplanted method has no dependencies on other methods from the original module considering unbound/bound do not track them. Read more
Architecting Rails Apps as Microservices
Monolith or Microservices? Designing your Rails app to work well with Microservices involves providing clear interfaces across the different boundaries of functionality in your app. Once the boundaries have been defined, how do you communicate across them? HTTP, queues? What if a service is down? These are some of the topics I cover in this article.
The Class That Never Ends: A Ruby Horror Story
Here is a controller file from the Ruby Central CFP app. You may observe that the class definition ended too early due to a honest rebase mistake. However, everything is still working correctly, and tests are passing. Can you tell why?
Implement Futures in Ruby
Benjamin Tan Wei Hao wrote an article on how to implement futures in Ruby. It’s really good and teaches a bit about concurrency, etc.
Separate model logic from view
In this post i describe why i think it’s good to separate model logic from view.
Quantum Computing with Ruby
Using a special interlacing hash, we can do some experiments with quantum superposition and of course the famous cat from Mr. Schrödinger. Read more
The Lazy Developer's Guide to Life Without the Mouse, Cursor and Useless Keys
Dare I broach the topic of the Vim vs Emacs holy war? I’ve tried both editors, but ultimately Vim stole my heart and, in doing so, turned my life into hell. It’s such a pleasure to use; nothing else compares to it. Suddenly, I hate typing with any application that doesn’t use the HJKL keys to move the cursor, and I find myself becoming frustrated whenever I need to use the mouse! So what changes can I implement to ease my pain and make my life easier, you ask?
Setting a default image when using Cloudinary and CarrierWave in Rails
Cloudinary lets you specify a default_image parameter when using the cl_image_tag, along with all of your transformations, to provide a fallback image if one has not been uploaded. If, however, you are using CarrierWave, you’ll likely want to define your transformations and the fallback image just once in your Uploader class, but this is not well documented - here’s how to do it. Read more
Brakeman Pro 1.0 Now Available
Brakeman Pro, the commercial version of the open source Brakeman static analysis security tool for Ruby on Rails, has just been released. It provides a streamlined desktop GUI interface to manage scans and investigate warnings as well as a drop-in command-line replacement for Brakeman.
Representable 2.4: How Functional Programming Speeds Up Rendering And Parsing.
Representable is a gem to render and parse documents, e.g. for REST APIs. In the 2.4 release blog post you learn how we used functional programming pipelines to simplify the code and improve performance by factor 3.
rails_db - major release, please check notes
- please check an updated version of my gem (version 0.8) Read more
Send emails with Mandrill and Rails
Mandrill by MailChimp is an online service that sends transactional emails. We have used it to send emails in our Ruby on Rails apps for some time now, and we’ll show how to do that here.
Hacking Your Gems for Debugging
Ever wish you could drop a few puts or binding.pry calls in to a gem so you could understand what’s going on inside? In this post I share some useful tooling for altering your local gems for the purposes of debugging. Read More: Hacking Your Gems for Debugging
Spying on running Ruby processes
Did you know that it’s possible to log all method calls as they occur in a running process in real time? How about injecting code to be executed inside of a running process? You can - via the magic of the rbtrace gem. http://blog.honeybadger.io/spying-on-running-ruby-processes/
Ruby Static Site News - Jekyll v3.0.1 Released, Meet Hyde, Nanoc v4.0 'n' More
Hello, Via @Vienna.html some static site news bytes (follow along for more ;-). New Releases: Read more
Is your app deRailing?
An introductory article on Trailblazer, its benefits, how it can help to better organize bigger apps, with some code samples and everything. Read more