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.
BridgetownConf 2022 Talks Now Online
The first ever BridgetownConf, recently held online as a Zoom conference, was a success. Now all of the videos are available here on the BridgetownConf website, with content suitable for newbies to the framework all the way to more advanced examples. Enjoy!
New ArtQ Gem - Query Blockchain Contracts / Services for Art Collection (Meta) Data
Hello, building on the new ethlite gem that lets you call (read-only) blockchain contract services I put together ArtQ - a new command-line tool (and gem) that lets you query (pixel) art collections “off-blockchain” such as Moonbirds or “on-blockchain” such as The Saudis via JSON-RPC (in your termial / shell). See the artq gem page for more. It’s the early days ;-) - download for artwork layers upcoming. SOON!
Advanced Route Constraints with Rails
Examples and info on creating route constraints for those times when you’d like a little more control over your routes. [more inside]
Rubber Duck Dev Show Episode 66 | Top Down or Bottom Up Testing
Rubber Duck Dev Show Episode 66 is released! In this episode, we discuss the practice of testing top-down first (UI / Full Stack) or bottom-up first (Unit). We also cover usage and issues with “soft” deleting data in your application: https://www.rubberduckdevshow.com/episodes/66-top-down-or-bottom-up-testing/
RubyConf Mini 2022 Recap
Did you miss RubyConf Mini and are you wondering what happened? Were you were there and want a hit of nostalgia about that thing from DAYS ago? I’ve got you covered with my recap. [more inside]
Clamp strings, symbols, array or hashes
The clamped gem allows to filter values by a provided whitelist. For example, "apple".clamped(%w[apple banana]) # "apple". If apple is not part of the array, nil is returned. This is e.g. useful to filter values provided by user input. [more inside]
sportdb gem - New Datasets for the World Cup 2022 in Qatar in Football.TXT
Hello, the World Cup 2022 kicks off today (in Qatar). Any open data or web service json api out there for the football match schedule? To get you started w/ ruby and the sportdb gem(s) I started adding new datasets for the World Cup 2022 in the (structured) Football.TXT format (e.g. /2022–qatar/cup.txt, etc.) that you can read into any SQL database (and than export to JSON, for example). Anyways, it’s the early days. If you know any ruby scripts or open data or json apis for the world cup, please tell / share.
Generate Password Protected PDFs in Ruby on Rails
Setting up Rails & Docker for a consistent developer experience
My approach for setting up Docker & Rails, so it’s easy for any developers to join in on the project: https://codewithrails.com/rails-docker
How to create a gem in Ruby on Rails?
Developers can create some incredible applications using Ruby on Rails best gems. Using Ruby gems is a standard practice in developing web applications in Ruby on Rails. Using the gems listed here, along with other Ruby gems, it is possible to create a customized Rails app that fits the needs of any company, and allows for fast software development, to get fast time-to-market, and stay competitive. A Gem in the Ruby programming language is a software package where Ruby applications or libraries can be deployed in a uniform format. For Ruby on Rails gems, an interface is a command-line tool called a gem that can install and manage a library. A gem embeds the Ruby programming languages runtime loader, which helps to find and load installed gems from unified libraries folders. RubyGems is a package manager for Rails which includes a standard format for distributing Ruby programs and libraries (in the form of a self-contained framework known as gem), a tool to manage the installation of the gems, and a server for shipping them. Read: How to create a gem in Ruby on Rails?
Ruby on Rails vs Django - The Back-end battle!
When it comes to developing Web applications, there are literally dozens of frameworks available for almost any programming language, but two of the best known and trusted are Django in Python and Rails in Ruby. Ruby on Rails has the best examples for building web applications, showing its dominance over a vibrant web community, while the Ruby programming language is similar to a complete solution, where applications are found across the backend, the M.L., and the web. Python-based is ranked among the best programming languages, and is known to emphasise the clarity and readability of code, while Ruby on Rails is known for attributes like flexibility and freedom, as well as for its easy-to-understand syntax. Django is among the most popular Python-based frameworks among experts in the language. Read More on RoR vs Django
refine and using Methods in Ruby
The Module#refine method allows you to register a monkey-patch for a specific class that can be applied whenever we want by calling the Module#using method… SEE MORE
rlp (Recursive Length Prefix) gem for data encoding reborn as rlp-lite (redux)
Hello, if anyone tries to request data from the ethereum (open) blockchain (service / database) with ruby sooner or later you might want to understand the magic and put together a to-the-metal “raw” json-rpc request with a recursive length prefix (RLP) encoded-data package. Good news - there’s a rlp gem with 1+ millions downloads; bad news - last update in 2016 and the (ruby) source code is officially archived / read-only). Anyways, using the “best of the both worlds”, that is, the “inline” rlp encoder/decoder from the eth gem and the rlp gem itself I put together a new rlp-lite gem. It’s the early days ;-). You are welcome to join in and try the new kid on the block. What are your (eth) options (in ruby) that you use? Please tell / share / discuss.
What'S New With Ruby On Rails 7
With 7.0s release, many new, game-changing features are coming to the table, making Rails as powerful as it is ever been. If your application is running Rails 6.1 or earlier versions, upgrading to the latest features in Ruby on Rails 7.0 will provide increased security, cost-effective maintenance and development, as well as improved application performance and UX. Read in detail
How we got struck by 5–year–old implementation
Recently we discovered that we were wrong on computing lock key for acquiring advisory locks. It was already covered as an update to article about building read models, but we thought that telling the whole story behind the issue could be interesting for you. [more inside]
Yes, You Can - Write Your Own Crypto Hash Functions / Digests In Ruby - SHA3, Keccak
Hello, if anyone is crypto (blockchain) programming in ruby - sooner or later you will need a Keccak and/or SHA3 (crypto) hash function / digest class - some popular options are gems with c-extensions - so with great surprise I found this week “less popular” hidden (crypto) gems in “plain-old” ruby and zero-dependencies on c-extensions. The two options are Keccak256 by Evan Taylor and SHA3 (“Pure Ruby”) originally by Christian Neukirchen et al and “gemified” by Shannon Skipper. Thanks! Anyways, I have started to use the “hidden (crypto) gems” in the ethlite gem that lets you call (blockchain) contract (services) via JSON-RPC and all works out great so far. What are your (crypto hash or eth) options (in ruby)? Please tell / share / discuss.
Calling Sonic Pi From Ruby
Are you looking for an elegant solution to pipe output from your Ruby code to Sonic Pi? This isn’t it. But it does work. [more inside]
Deep dive into Semantic Versioning | Hanami Mastery #33
Semantic versioning is a useful approach to version your projects or gems - let’s deep dive into it together! [more inside]