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.
Ruby 2.4.0.preview3 Binding#irb
Ruby 2.4.0.preview3 new method to debug is Binding#irb. It’s a short article about it. http://enderahmetyurt.com/2016/ruby2-4-binding-irb/
Microservice Communication with Queues
A microservice that is never used is useless. Ready Leigh Halliday’s article on Microservice Communication with Queues.
Code Analysis: Minitest
An interesting code exploration session even if you are not a regular Minitest user :) http://www.blackbytes.info/2016/11/code-analysis-minitest/
Code Refactoring Gem – Flay
Keeping your code elegant and no code clones while building up a vast Rails application can be a significant test, notwithstanding for an accomplished developer. Fortunately, there is a gem that make this code refactoring much simpler. Code Refactoring Gem – Flay
A brief look at RSpec's formatting options
How I used RSpec to find weird output polluting the logs and our test suite: http://www.ombulabs.com/blog/rspec/ruby/using-rspecs-documentation-format.html
Nested Objects With Strong Parameters In Rails
This article shows how to permit nested objects in your json requests. https://solidfoundationwebdev.com/blog/posts/nested-objects-with-strong-parameters-in-rails
(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! http://bamboolab.eu/blog/present-your-360-panorama-images-with-java-script
[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. - https://mkdev.me/en/posts/how-to-write-an-mvc-framework-in-ruby
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!