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.
3 ways to use Regexp capture groups with back-references in Ruby
Taking advantage of capture groups to manipulate Strings in Ruby [more inside]
Rubber Duck Dev Show Episode 6 | Handling Exceptions
Hear two Rubyists discuss how to handle exceptions: https://www.rubberduckdevshow.com/episodes/6-handling-exceptions/
Real-time stress: AnyCable, k6, WebSockets, and Yabeda
Introducing a k6 plugin to load test WebSockets and trying to ruin a real-time application under a load and compare the results for different WebSocket servers: Action Cable, AnyCable, and AnyCable Pro. https://evilmartians.com/chronicles/real-time-stress-anycable-k6-websockets-and-yabeda
Web Scraping Made Easy With Ruby
Explore web scraping basics with Nokogiri Gem [more inside]
[Screencast] esbuild for Rails
Use esbuild to bundle your JavaScript, then deliver it via the asset pipeline in Rails. This gem provides an installer to get you going with esbuild in a new Rails application. https://www.driftingruby.com/episodes/esbuild-for-rails
[Screencast] Importmaps in Rails 7
Import maps let you import JavaScript modules using logical names that map to versioned/digested files – directly from the browser. This will be a default in the upcoming Rails 7. https://www.driftingruby.com/episodes/importmaps-in-rails-7
Blockheads - Let's Build 8x8 Pixel Art Avatars from the Historic (2013!) Video Game
Hello, Inspired by Blockheads - The Guide to 70 Boy Skins (Anno 2013) I’ve put together an article titled Blockheads (Anno 2013) - Let’s Build 8x8 Pixel Art Avatars from Scratch. Yes, in Ruby - see the blockheads.rb script. Yes, you can! Now generate your own 8x8 blockheads and use your own designs. Bonus for adding the missing beard building blocks / attributes.
Oktest.rb 1.1.0 released -- JSON Matcher implemented
Oktest.rb 1.1.0 released, a new-style testing library for Ruby. In this release, JSON Matcher (like JSON Schema) implemented which will help you to test JSON data very well. See README for details.
JWT expiry validation with Varnish
How we validate JWT expiry fields before it reaches our Rails backend - https://defv.medium.com/jwt-expiry-validation-with-varnish-ddad35722a3d
Hotwire::Livereload v0.1
Automatically reload Hotwire Turbo when “view” files are modified. https://github.com/kirillplatonov/hotwire-livereload
How to unescape XML/HTML character entities ?
Unescape entities like A
or <
from a Ruby String : https://format-express.dev/blog/how-to-unescape-xml-character-entities
Move over Rake, Thor is the new King
Yes, Rake is certainly the heavyweight in this arena. But it is also clunky and has some oddities, and limitations that are frustrating to work around in day to day usage. Tools are always improving and we shouldn’t stick with something just because we always have. [more inside]
How I Write Code: Pen & Paper
Even though I love programming, I try not to sit in front of a computer screen too much. I do not find staring at a screen all day beneficial, not for my physical health, nor for my mental health. In the last few years, I’ve started a habit of sketching my programming ideas using pen and paper. I’m not talking here about todo lists, or making diagrams. I’m talking about actually writing code using pen and paper. Let me explain.
Released ruby-masscan 0.1.0
This is the first release of ruby-masscan, a Ruby interface to masscan. Masscan is an “Internet-scale” port scanner and is capable of scanning whole class A subnets very quickly. ruby-masscan supports automating the masscan
command from Ruby and parses masscan’s binary, list, and JSON output files.
hexdump 1.0.0 released!
hexdump.rb 1.0.0 has been released! This major release adds lots of hexdump features, such as ability to decode typed data (uint16, int32, float64, etc), zero-padding, skipping the first N bytes or only reading N bytes, index offsets, omitting repeating rows, better UTF character encoding support, column/chars grouping, ANSI styling/highlighting, and micro-optimizations that allow it to process 1Mb of data per second. Not only is hexdump 1.0.0 Ruby’s most advanced hexdump library, it also competes feature-wise with other language’s hexdump libraries. Checkout the Examples to see more!
command_kit 0.2.0 released!
command_kit 0.2.0 adds support for ANSI background colors, FreeBSD/OpenBSD/NetBSD OS detection, Linux distro detection, xdg-open
/open
support for opening a file in it’s preferred or registered application, package manager detection and integration, and sudo
detection and integration.
command_kit is a Ruby toolkit for building clean, correct, and robust CLI commands as plain-old Ruby classes.
Rubber Duck Dev Show Episode 5 | Object Oriented vs. Functional Programming
Hear two rubyists compare and contrast Object Oriented vs. Functional Programming. Most examples compare Ruby with Elixir: https://www.rubberduckdevshow.com/episodes/5-object-oriented-vs-functional-programming/
bundler-audit 0.9.0 released!
bundler-audit 0.9.0 has been released. This release adds support for JUnit output (--format junit
), a new --config
option, improvements to the bundle:audit
rake tasks, and a compatibility fix for psych >= 4.0.0 and the upcoming Ruby 3.1.0 release. Update today!
Using Hotwire with Rails
Hotwire is a way to build modern web applications without much JavaScript by sending HTML over the wire. In this article, Renata Marques introduces us to Hotwire and walks us through a simple example. https://www.honeybadger.io/blog/hotwire-rails/
RJGit 5.12.0.0 released
The RJGit library for manipulating git repositories on JRuby was updated to include the latest JGit version (5.12.0.202106070339-r).