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.
RubyMine 2018.3 Released
The new version adds full support for Struct and rails scopes, improves i18n and refactoring features, allows you to work with pull requests right inside the IDE, and adds many other things. [more inside]
Why on earth do Fibers exist?
For a long time, I couldn’t understand what is the purpose of fibers in ruby. I could understand how to use then, but I didn’t understand when or why should I. This blogpost is a result of small research, I’ve do to find my answers.
Database based uniqueness validations for ActiveRecord
Remember the problem with uniqueness validation in ActiveRecord? Yes, it doesn’t guarantee the uniqueness! Check out database_validations gem. You can also read the article on reddit about it. Feel free to contribute!
Consistency between database constraints and ActiveRecord validations
Check out my new gem database_consistency`. You can read my article on reddit for details. Any feedback is very appriciated!
All things Rack
Wetransfer’s Wander, and Red Hat’s Dávid Halász on serving more than 10k connections from a single Ruby process, and smuggling TCP traffic through an HTTP connection, at the Amsterdam Ruby meetup: https://blog.phusion.nl/2018/11/23/all-things-rack-in-amsterdam/
Introducing Modulation - explicit dependency management for Ruby
I’d like to introduce a project I’ve been working on in the last few month, Modulation, a small gem providing an alternative way to manage dependencies in your Ruby applications. For more information, visit the Modulation repository.
AnyCable v0.6.0 released!
Check out the brand new docs website for more: https://docs.anycable.io [more inside]
Mastering data structures in Ruby — AVL Trees.
I just published a new post on the Mastering data structures in Ruby. This time, I show you how to implement AVL trees in Ruby. AVL trees a special kind of self-balancing binary search trees that are great for lookups on large datasets. I hope you enjoy it.
Have you tried Dependabot yet?
I’ve been using Dependabot for a while — it’s like adding a developer to your team. I’m really impressed so I wrote about why.
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.