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.
(Keep On) WebMockin' in the Real World
The previous post in this series introduced WebMock with a simple example application and showed the basics of how to use it to stub external API calls in your code. But real distributed applications aren’t always so simple. This post shows practical techniques for tuning your stubs and handling edge cases to get the most out of the tool and test your code more thoroughly.
How to set a default queue name for all jobs in Rails?
I’m working on a gem for sharing common Rails code between my apps. I just added there a first job and hit a problem - the job from the gem was using default queue which doesn’t exist. Here’s how I changed all jobs to use a specific queue without using queue_as or extending ApplicationJob.
Preparing Clean and Customized JSON response for Rails API
To know about best practices on overriding as_json and to_json of object to prepare proper json responses, read my post on parthtalks Blog Post or on Medium at Medium article link. I will be writing about advanced rendering with active model serializers in next article. For more posts visit my blog at http://parthtalks.weebly.com and let me know about what you think about my articles.
Go Full Stack Rails - The Frontent part 1
This is part 3 of a series of blog posts where I walk the reader through building a real full-stack application with Rails and ES6, from beginning to end. “The Backend” part 1 and part 2 are also available online. [more inside]
Monitor processes memory in your browser
instrumentation is a Ruby gem that lets you monitor any process memory usage and visualize it on your browser. It looks like this: [more inside]
Awesome Jekyll - Add Your Articles, Guides, Tips & Tricks, Goodies ‘n’ More
Hello, Just a reminder: I’ve started an awesome collection about - surprise, surprise - all things Jekyll. Find the list @ /planetjekyll/awesome-jekyll on GitHub. Anything missing? Articles Guides, Tips & Tricks, Tools, ‘n’ more. Your contributions more than welcome. Cheers.
Telegram::Bot 0.9 is out
Integrate Telegram bot into your Rails app or build standalone one.
Now your bots will be more stable, because you can write tests faster with built-in rspec matchers. And don’t worry about network errors: with async: true API requests will be made with worker within job queue and your messages or Botan.io statistics will definitely get delivered! See repo
Present Your 360° Panorama Images With JavaScript
More and more often you can see a cool 360° panorama. Today, I will play with two libraries that present images as 360° panorama views. I will test two libraries, first is Panorama Viewer by Pete R. which is the simplest I could find, and Three.js which is most complex one I could find. Both are free and easy to start with. Also, let’s do it in Rails!
[Screencast] Database Index Optimization and Migration Maintenance
Adding indexes to your databases can increase the SQL search performance on your tables. As your application grows, migration files can become out of hand, use squasher to squish them down to a single file. https://www.driftingruby.com/episodes/database-index-optimization-and-migration-maintenance
How to write an MVC-framework in Ruby
What if we wrote a web application similar to a typical rails-application? I.e. it will have MVC, routing, migrations, some configs, all in all, everything like it’s supposed to be. But all this will be a very-very simplified version of our favorite framework Rails. There will be no generators and interactive console, beautiful layouts and messing with assets. -
Better File Uploads with Shrine: Metadata
This is the 5th article in the series of posts about the Shrine file attachment library. In this post I talk about how Shrine extracts and saves file metadata during upload. Read all about it here.
tty-file initial release!
The tty-file provides higher level utilities for manipulating files and directories. This is initial release so please be gentle when using. Please report any issues or suggestions here.
HexaPDF Performance Benchmark
My pure Ruby PDF library HexaPDF contains a CLI application for working with PDFs. In this post I look at how this application performs in comparison to other such applications.
A simple usage of the cells gem
Loading data via a before_filter in your ApplicationController is still the de-factor standard for displaying data across your application. Here is an alternative approach using the cells gem.
Quick Rails Performance Wins
I did a blog post with some input from colleagues about our top 10 quickest performance wins we’ve seen in the wild. The list isn’t exhaustive, just meant to be quick, but it still has some good reminders for things that definitely can affect performance. Hope you like it! [more inside]
manpages - man pages for ruby
I love man pages. And I am a bit disappointed that most command line tools written in ruby don’t offer one. Maybe it’s because of the poor support of rubygems for it. To help fix this, I developed the manpages gem. It scans for man pages in your gem during the installation phase and links them to a folder that the man command can find. Please give it a try.
factbook gem updated - scripts for the world factbook - 250+ country profiles
Hello, I’ve updated the factbook gem that lets you read (public domain) counrtry profile pages (from the CIA World Factbook) and turns the HTML into structured data (e.g. JSON or a nested ruby hash). Build yourself an Almanac in 30 lines of ruby, for example, or find out what countries have the most oil reserves or most cell phones or internet hosts and so on. Happy exploring the world w/ ruby. Cheers.
‘Learn Ruby on Rails’ Book for Rails 5.0
My Learn Ruby on Rails book, which is free and has been called “the best Rails book for beginners,” is now up to date for Rails 5.0. This is a book that provides more depth and explanation than other Rails books, making it easier for beginners to get started.
Run services in the background
Something about Service pattern in Rails. How to run our services in the background and how to be lazy. Read more on our blog!
Hello, Minima! Theme - Get Started w/ GitHub Pages in 60 Seconds (Update V2)
Hello, I’ve updated the Hello, Minima! getting started in 60 seconds guide - using the latest and greatest Jekyll 3.3 version w/ Minima 2.0 (now running live on GitHub Pages). What’s news? Now just two steps to get started (add a _config.yml and an index.md). That’s it. No more step 3 required (that is, importing a style sheet) it will now get included automatically. See the Henry’s Hello, Minima! repo for the article and live demo. Cheers.
Using private attr_accessors is wrong
I’m working on an existing Rails application and there’s one pattern I see repeating often that I’m puzzled with. It’s especially common in service objects. Here’s couple of reasons you should not use private attr_accessors.
How BDD and Continuous Delivery Help Developers Maintain Flow
In this post I explore how BDD and CI/CD help us stay in the zone, where we do our best work.
Making Ruby Hash#dig even more awesome. Introducing Hash#dig_and_collect
In this blog post I will introduce Hash#dig_and_collect , a simple utility method that is built on top of Hash#dig to help you navigate nested hashes mixed up with arrays. [more inside]
Ruby Plus Podcast Episode 17
Episode 17 now available.