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.
CryptoPunks GUI by Glimmer DSL for Tk
This is a Graphical User Interface for the famous Cryptopunks Ruby gem, built with Glimmer DSL for Tk. [more inside]
How Polywork uses Hotwire & Turbo Native to build quickly
The Polywork team joined us on the Remote Ruby podcast to talk about their experience building apps with Hotwire, how it’s helped their development process, and how it works building Turbo Native apps. Listen to the Remote Ruby podcast with Polywork
Ruby's Got You Covered
Ruby’s coverage module includes many options that can answer different questions about your code. This article explores the modes that the module provides.
Manga2PDF GUI by Glimmer DSL for LibUI
Manga2PDF is a simple Ruby app to download manga and merge the images into a single pdf file. Available in both CLI and GUI. The GUI is written with Glimmer DSL for LibUI. [more inside]
Glimmer DSL for SWT Doubles in Gem Downloads in The Last 3 Months
It was only 3 months ago when I announced that it has been a year since the glimmer-dsl-swt gem was split from glimmer, and it had already gotten 39k downloads. Shockingly enough, 3 months later, the number more doubled! It is 82k now! [more inside]
cryptopunks gem v2.0, The Shell Edition - What’s New? New Commands Incl. Generate, ..
Hello, The cryptopunks gem and command line tool v2.0 is now out!
What’s new? New punk commands include generate (or gen or g), list
(or ls or l), query (or q) and tile (or t). Try: $ punk -h # or punk help
resulting in […]. PS: Halloween is upcoming. Try some super-rare never-before-seen
demons or vampires. Example: $ punk generate demon heart_shades or $ punk generate vampire_female wild_hair
Explaining Ruby Fibers
Fibers have long been a neglected corner of the Ruby core API, have never really seemed to deliver on their promise of lightweight concurrency, and remain relatively little explored. In this article I’ll explain how fibers work from the point of view of a concurrent Ruby application written using Polyphony. I’ll give an overview of fibers as concurrency constructs, and discuss how Polyphony harnesses Ruby fibers in order to provide an idiomatic and performant solution for writing highly-concurrent Ruby apps. Read on…
The secret of stunning OSS contributions!
I’ve just shared what I believe is a secret to get stunning Open-Source contributions! Check it out! [more inside]
Optimistic Locking in Rails REST APIs
Implement optimistic locking in Rails APIs to avoid potentially critical issues. [more inside]
Git Bisect: travel through time and bugs
No matter how thorough your test coverage is, you can’t test everything. So when you introduce a bug in your application, knowing how to use git bisect will help you zero in on your regression’s origin.
Upgrade to Stimulus 3, say bye to IE11, and celebrate 🎉
Upgrading to Stimulus 3 requires targeting your JS code to ES6 which means no IE support any more. The post suggests a few precautions so that you can celebrate this, too. [more inside]
Rubber Duck Dev Show Episode 16 | When Should You Comment Your Code
Hear two rubyists discuss when you should comment your code: https://www.rubberduckdevshow.com/episodes/16-when-should-you-comment-your-code/
Business logic in Rails with operators
Having a thousand lines long controllers and/or models is not the right way to have sustainable applications or developers’ sanity. Let’s look at my solution for business logic in the Rails app. https://petr.codes/blog/rails/business-logic-with-operators/
Supporting fractions in Ruby/Rails
Have you ever needed to store and display fractions in a Rails app? Read about Ruby’s Rational class and how to convert Floats into Unicode fractions.
Befunge GUI by Glimmer (2 for 1: LibUI & SWT)
In light of the recent Beta release of Glimmer DSL for LibUI, I have been looking for applications that could take advantage of its productivity and speed in building desktop GUI with its Ruby DSL. One such application has been Befunge98 GUI, built for a Ruby implementation of the Befunge98 programming language. In fact, I built its GUI twice with two different approaches, one using the up and coming Glimmer DSL for LibUI on CRuby relying on a multi-canvas-grid (LibUI area) approach, and one using the very mature Glimmer DSL for SWT on JRuby by relying on a button-grid approach. [more inside]
I couldn't debug the code because of my name
It turns out that the same problem also affects users of other InteliJ-based IDEs like RubyMine, PyCharm, PhpStorm and GoLand. Fortunately, I was able to fix it. Here’s how I handled it: [more inside]
Rubber Duck Dev Show Episode 15 | When To Use UUIDs
Hear two rubyists discuss when to use UUIDs (and when not to): https://www.rubberduckdevshow.com/episodes/15-when-to-use-uuids/
Ruby Pixel Art Programming Challenge #2 - Cryptopunk Redux - Generative Modern Art
Hello, Let’s try another round in the ruby pixel art (graphics) programming challenge: Ruby Pixel Art Programming Challenge #2 - Cryptopunk Redux - Generative Art Taking Each of the 576 Pixels [from a Punk] from the Original Series and Placing the Pixels Randomly within the Same 24x24 Pixel Grid - Yes, You Can - Let’s Do A Free (Right-Click & Save Image) Edition / Share Your Pixel Art Scripts (in Ruby) ++ Let’s get inspired by the pre-currency (spots painting “Damien Hirst-style”) Cryptopunk Redux collection. The modern art (pixel art) collection blurb reads [..] Share your generative (pixel) art script(s) in ruby (on ruby-talk) or for an alternative join us on r/CryptoPunksDev - a channel mostly about - yes, pixel art programming in ruby. Bonus - for trying circles (“spots”) instead of square pixels / rectangles :-). Cheers. Prost.
This week's Ruby roundup
Here’s the latest issue of Ruby Weekly: https://rubyweekly.com/issues/574
Embracing Infinite Loops with Ruby and Polyphony
Infinite loops are great for expressing long-running concurrent operations. In this article I’ll discuss the use of infinite loops as a major construct when writing concurrent apps in Ruby using Polyphony. I’ll show how infinite loops differ from normal, finite ones; how they can be used to express long-running tasks in a concurrent environment; and how they can be stopped. Read it now!
Get ready for Rails 7.0: How to upgrade your Rails 6.x app from Classic to Zeitwerk
Zeitwerk is the code autoloader and reloader that was integrated with Rails 6. Beginning in Rails 7, it will be the only codeloader option. As a result, upgrading to Zeitwerk will be an important step in getting your application ready for the next version of Rails. In this article, we’ll talk about upgrading your Rails 6 application from classic to zeitwerk mode. [more inside]