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
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
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/
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.
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
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?
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
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.
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
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]
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.
Rubber Duck Dev Show Episode 65 is released! In this episode, we discuss whether Ruby on Rails Active Record callbacks are good or evil: https://www.rubberduckdevshow.com/episodes/65-callbacks-good-or-evil/
“ C#, Go, Java, Ruby, Rust, and Swift” The NSA recommends to use one of these languages to prevent memory based attacks. Memory violations cause up to 70% of all security violations regarding to Microsoft and Google researchers. A great day for Ruby! If someone asks you why you use Ruby for your project you can simply point them to this article https://media.defense.gov/2022/Nov/10/2003112742/-1/-1/0/CSI_SOFTWARE_MEMORY_SAFETY.PDF
Service objects and/or
after_commit callbacks are ubiquitous in most real-world Rails applications. Whether it’s a good idea or not (ActiveRecord callbacks - I’m looking at you) is a different story, but one thing that is notoriously overlooked in the application design is reliability. And yes, the service objects are equally bad as
after_commit callbacks in that regard. [more inside]
ActiveWorkflow 0.9.16 has been released. This is a minor release that adds the ability to wipe out workflow state (useful during workflow development) by removing all messages, log records and agent memory with a single button (with confirmation, just in case). Heroku “demo” mode was removed since a free tier seems to be no longer available (you can still deploy to Heroku with your own configuration). Multiple dependencies were updated.