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.
How To Write a Glimmer Timer Desktop App in One Hour
I needed a simple Timer desktop app on my Mac today, so I wrote one in Glimmer (Ruby Desktop Development GUI Library). The initial working prototype took me about one hour, mostly spending my time outside of Glimmer, figuring out how to leverage the Java Sound libraries (since Glimmer works through JRuby). Otherwise, I spent 2-3 hours afterwards on fit and finish (e.g. logo and fonts) and testing/packaging for the Mac and Windows. https://andymaleh.blogspot.com/2020/08/writing-glimmer-timer-sample-app-in.html
New Gem capistrano-precompile-chooser Released!
I have just released a new gem called capistrano-precompile-chooser. It is a Capistrano plugin to precompile your Rails assets locally, remotely, or not at all provided with a very convenient default terminal prompt. https://github.com/westonganger/capistrano-precompile-chooser
A simple pre-commit hook that saves you big time!
Once you set this up, you never have to worry about syntax errors forever. [more inside]
How many Heroku dynos do you need, and which size—An opinionated guide
This guide is everything you need to know about Heroku dynos when running a Rails app. It goes deep into the two questions everyone asks: “Which dyno is right for my app?” and “How many dynos do I need?”. It covers how to get the most value from Heroku, how to avoid app slowdowns, and provides clear guidance on the best way to run your Rails app.
Top Reasons Why Businesses Should Invest in Ruby on Rails Development
Here are 5 reasons Ruby on Rails web development is worth investing. [more inside]
score-formats gem - read / parse and print sports match scores eg 8-4 (4-2)
Hello, I’ve extracted a little stand-alone (no-dependencies) gem called score-formats that lets you read / parse and print sports match scores (incl. half time, full time, extra time, penalties and more) e.g. 6-5 pen. 2-2 a.e.t. 1-1 (1-0) or 8-4 (4-2) or even in German style e.g. i.E. 6:5, n.V. 2:2 (1:1, 1:0). Enjoy the beautiful game (or other sports) with ruby. Cheers. Prost.
Rodauth: A Refreshing Authentication Solution for Ruby
The Rails ecosystem has several popular authentication frameworks (Devise, Sorcery, Clearance, Authlogic), but over time these libraries have accumulated a lot of internal complexity, inconsistencies in design, and haven’t managed to standardize some important functionality (JWT, MFA). Rodauth is a fresh take on authentication in Ruby, built on Roda & Sequel. It has all the essential authentication functionality, additional enterprise-level security features, multifactor authentication (TOTP, SMS codes, recovery codes, WebAuthn), JSON API support, passwordless authentication and more. https://janko.io/rodauth-a-refreshing-authentication-solution-for-ruby/
OR query with multiple conditions on same column using Sequel
https://prathamesh.tech/2020/08/16/sequel-or-with-multiple-conditions-on-same-column/
Understanding Database Transactions in Rails
Few things are scarier than a database slowly losing integrity over weeks or years. For a while, nobody notices anything. Then users start reporting bugs, yet you can’t find any code that’s broken. By the time you realize the problem, it may be happening for so long that your backups are unusable. We can avoid problems like these with skillful use of transactions. In this article, Kingsley Silas introduces us to transactions at the database level, discusses when they should be considered, and shows us how to use them in Rails. https://www.honeybadger.io/blog/database-transactions-rails-activerecord/
render_async 2.1.7 Lets You Retry Requests With Delay
Check out new features in the render_async 2.1.7 version! [more inside]
Pros and Cons of Ruby on Rails for Web Development
Ruby on Rails is a popular web development framework. Here are the pros and cons of Ruby on Rails for web development, helping you to make a better choice. https://www.botreetechnologies.com/blog/pros-and-cons-of-ruby-on-rails-for-web-development
Shellable: Open a REPL within the context of any Ruby object
Imagine you’re building a new Ruby library, and you’d like to provide users with a simple way to experiment with that new library from the inside. Try Shellable.
[video] Learn About Error Tracking in Production
In war, no plan survives contact with the enemy. In tech, no code survives contact with real users. https://www.semicolonandsons.com/episode/error-tracking-and-monitoring [more inside]
activestorage-horcrux gem
An ActiveStorage service option that uploads shares across one or more other storage services using Shamir Secret Sharing (via the tss-rb gem). Use it in your storage.yml file. It is not a mirror, but can be named as a storage service. https://github.com/johncallahan/activestorage-horcrux. A demo application is available at https://github.com/johncallahan/activestorage-horcrux-example
NameQ: Create unique names via numeric suffixes
NameQ is a gem for when you need to name things, but not worry about whether or not those names are already taken.
TermiChunk: Organize chunks of text within terminals
TermiChunk can take large chunks of text that might otherwise run together, and organize them neatly within your terminal output. [more inside]
Invokable 0.7.0 - Compose, Juxtapose and Knit Procs and Proc-like Objects
https://github.com/delonnewman/invokable - Invokable 0.7.0 Introduces a collection of helper methods for composing Procs and Proc-like objects (any object that implements call or to_proc). Classes that mixin the Invokable module now get === and [] for better Proc compatibility.
Gumball: Dispense expensive Ruby objects with ease
Gumball helps fill the space where a singleton is too static, and endless new objects are too dynamic.