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.
Building SQL Expressions with Sequel
It’s great to build SQL queries in Ruby. However, it’s not great when you have to drop to raw SQL as soon as you need to write a more complex SQL expression. At Citrusbyte we use Sequel, which has an extensive SQL expression API that allows us to build even the most advanced SQL expressions in Ruby. In this article I talk more about it and compare it with Active Record.
pry-auto_benching.rb
pry-auto_benching.rb is a Pry plugin that automatically benchmarks input entered into Pry, it is also available on RubyGems. Please check it out and let me know what you think.
Include extra information in API responses - Fast JsonAPI Gem part 2.
How to include extra elements, like related links and pagination meta in the server response? [more inside]
What Is MJIT in Ruby 2.6 & How Does It Work?
Did you know that Ruby 2.6 will have a JIT (Just-in-Time Compiler)? In this new article you’ll discover the technical details, how Ruby’s implementation works & how good it’s at getting the job done! https://www.rubyguides.com/2018/11/ruby-mjit/
Outdated browser detection with Browserslist
Detecting outdated browser in one way on both Ruby-backend and Node.js-frontend https://dev.to/amplifr/outdated-browser-detection-with-browserslist-10co
Good News! You No Longer Need to Generate Documentation Manually
We just released a solution we use in our projects regarding automating documentation generation from tests [more inside]
Purify code with data integrity: defaults and not-nulls
How not-null constraint and default values help to write better code https://dev.to/amplifr/purify-code-with-data-integrity-part-1-defaults-and-not-nulls-492p
Extract tables from PDF files
Iguvium is a way to get structured table data from PDF pages. The only external dependency is GhostScript, which makes this gem suitable even for free Heroku installations.
Reducing Enumerable - An Illustrated Adventure (Novel Version)
Translating the RubyConf talk “Reducing Enumerable - An Illustrated Adventure” into a series of six posts, this format is easier to read through than just glancing at the slide deck. Part one starts here: https://medium.com/@baweaver/reducing-enumerable-part-one-the-journey-begins-ddc1d4108490
How to write professional commits efficiently?
Writing good commit messages can be tricky and time-consuming. 🤔 Here I share my solution (how to handle that problem and write commit messages efficiently)[https://driggl.com/blog/a/how-to-write-professional-commits-efficiently]! Join to the discussion if you know other solutions for that!🗨️ [more inside]
Ruby memory, ActiveRecord and Draper a performance story
A story about digging to find we have a huge memory consumption while parsing and processing CSV. We will see that the issue was not in CSV parsing but in dependencies and the way they were used. https://medium.com/appaloosa-store-engineering/ruby-memory-activerecord-and-draper-64f06abeeb34
Kinit will make your Rails application better by adhering to good practices.
Kinit -– A gem to make sure sanity of your Gemfile is always in check.
How fast is Ruby 2.5, 2.6 and 2.6 –jit in generating Prawn PDFs
I tried to find out if the new Ruby 2.6 JIT (from preview3) can help the performance when generating invoices using InvoicePrinter and Prawn. Here is the benchmark.
Announcing the release of WebpackerCli
Announcing the release of WebpackerCli. Bringing the convenience of Rails’ Webpacker to any web framework… even those in other languages.
Convert html snippet into a png file
https://github.com/igorkasyanchuk/omg_image new gem which allows creating previews for your HTML snippets. Actually, there are many ways how to use it: from nice previews to charts and email attachments. [more inside]
Image Placeholder for your development environment
Some time ago I was working together with Szymon on one of our clients web application. We used copy of products catalog coming from production server on our development machines. What we were lacking were product photos, causing application layout to look poorly and making any CSS job hard. We tried to find a smart solution for that case.
Mastering data structures in Ruby — Singly linked lists
This is the first post of a series I made on how to create essential data structures from scratch. So far the series covers singly linked lists, doubly linked lists, circular linked lists, stacks, queues, hash tables, sets, and binary trees (and there more coming soon!). Each data structure is covered in a brief post that explains in a casual tone the core aspects of each data structure. I hope you enjoy them!
Taking Stimulus.js (front-end framework by Basecamp) for a ride
I am trying Stimulus.js lately in Rails and I think it fits nicely the server-rendered HTML + Turbolinks use case. This is my first look on Stimulus.js.
9 New Features In Ruby 2.6
A new Ruby version is almost here! What new & exciting features does it come with? Find out in this new article: https://www.rubyguides.com/2018/11/ruby-2-6-new-features/
Six Great Reasons to Build Service Architectures in Ruby with Eventide
Eventide makes service development as approachable as Rails made web development in 2006, and seeks to democratize this as-yet esoteric subject that, at the moment, tends to be calcified under a thick layer of popular myths and fads. https://medium.com/eventide-project/six-great-reasons-to-build-service-architectures-in-ruby-with-eventide-2f823bd51402
finite_machine is back!
The finite_machine gem is back with improved APIs, faster execution times (2x more events fired per second), smaller memory footprint (2x fewer object allocations) and thread safety! Good place to start is at the FiniteMachine website.