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.
Podcast - Generate a (static) podcast website from a folder of MP3s w/ jekyll
Hello, Pat Hawks hacked together at yesterday’ HackUIowa a new tool (in ruby). Let’s welcome - podcast - that lets you generate a (static) podcast website from a folder of MP3 files with jekyll and friends. See Herky Hack for a first sample (live) podcast. Happy publishing your radio talk shows with jekyll and friends. Cheers. Prost.#jekyllrb #podcast #mp3 #audio #id3 PS: Did you know? Octopod is another (free, open source) extension for publishing podcast episodes with jekyll.
Rails: Active Storage Removing Attachment
Now that we can add a cover picture attachment to our application the next thing we need to do is the ability to remove it. We’ll need to do a few things to get this setup.
Cibyl, a lightweight curly-bracket language which compiles to Ruby and Crystal
Cibyl allows to develop Ruby and Crystal applications with a C-like syntax : [more inside]
An OpenCL backend for TensorStream
After some time I finally have an alpha version of an OpenCL backend for the TensorStream machine learning library that I have been working on for quite some time. Though my goal for TensorStream was to have a pure ruby implementation of TensorFlow, I always intended it to allow for high performance implementations by allowing various backends to be defined. [more inside]
Glim - A new faster jekyll website compiler clone / alternative (in ruby)
Hello, Jekyll not fast enough? Why not build a compatible faster clone / alternative from scratch / zero (in ruby)? Sounds crazy? Allan Odgaard (of TextMate fame) has just done it and with about 3 000 lines of ruby code offers even more features than jekyll itself :-) e.g. built-in tags and categories for collections, lazy evaluation and parallized builds, better defaults, and much more. Find out more at the Glim website compiler source project repo. Cheers. Prost. PS: By the way - did you know? Slide Show (S9) is another jekyll-compatible clone :-) that lets you build presentations / talk slides in markdown (kramdown, really) and jekyll themes e.g. reveal.js, shower.js, bespoke.js, s6, etc.
How To Delegate Methods in Ruby
In this article you’ll learn about delegation in Ruby using 3 different methods. Method delegation allows you to pass method calls into another object so you can implement design patterns.
Phusion: Passenger 5.3.5 released
Version 5.3.5 of the Passenger app server fixes an issue with Ubuntu 18.04 package installation, and improves usability of crash reports:
How to share containers across multiple projects using Docker Compose
Learn how to share containers (e.g. a database) across multiple projects using Docker Compose and networks https://www.chrisblunt.com/rails-on-docker-share-containers-across-multiple-projects/
Video: Intro to Rails Code Audits
Want to learn how to audit your Rails code base? Here’s a video introduction to Ruby on Rails code audits. [more inside]
Exceptional Creatures: Net::OpenTimeout
Net::OpenTimeout is raised when a connection cannot be created within a specified amount of time. Getting this error a few times can be a sign of a healthy application, although you may want to add some error handling. Meet Net::OpenTimeout at Exceptional Creatures
Changelogs: To write or to generate?
Part III of our series on changelogs focuses on processes and tools. How can we, especially in larger open source projects with countless contributors, ensure a mostly complete changelog? How much automation is possible and how much is useful? This article tries to answer all of these questions and gives valuable tips for overloaded open source maintainers.
5 Ruby Tips You Probably Don’t Know
In this article we’re going to explore the following topics:
The Magic of Class-level Instance Variables
Remember our crazy adventure in which we injected functionality to a class by changing the way Ruby creates objects? This week, we’re turning that into a Wrappable module to learn all about class-level instance variables. 🧙🏼♀️
rspec-benchmark v0.4.0 with complexity matchers!
The newest rspec-benchmark adds computational complexity matchers such as perform_linear or perform_loagarithmic to help you establish the asymptotic behaviour of your code in a test suite. It will also allow you to generate a range of test inputs for your benchmark using in_range matcher. Enjoy!
London Ruby Unconference is this Saturday!
The London Ruby Unconference is a free event for Rubyists from the UK and abroad. The London Ruby community meets every year in the first Saturday of October to share their enthusiasm for Ruby and learn from each other in more than 16 sessions suggested by the attendees. Get your free ticket here! and join us with your colleagues and friends!
SimpleAMS: Modern Ruby Serializers
Hello, I have been building a gem lately (=last 1 year) to replace the original ActiveModel Serializers. It’s called SimpleAMS. The idea is to embrace POROs and provide a very flexible interface. Using some basic benchmarks it seems it’s a bit slower than jsonapi-rb. Although there are a couple of things left to do (including optimizations), we have it in production and integrated it in various projects. If you are starting a new project please consider using it :)
Why the CSV standard library is broken (Part III) - CSV Record as Array? Hash? etc.
Hello, I’ve written a new (and third) episode on why the CSV standard library is broken, broken, broken (and how to fix it). Let’s have a look at how to handle csv records - How about returning an array? hash? struct? row? etc. Or how about adding new “low-level” parsers for supporting more dialects and formats or for faster code with c-extensions? Questions and comments welcome. Cheers. Prost. PS: If you want to see other (more) CSV formats / dialects pre-configured and supported “out-of-the-box” in the new csv reader, please tell. PPS: Why care about CSV? Did you know - data is the new gold :-) and CSV is the world’s most popular (No. 1) data format.
Rails Parts
When we restarted developing an application from scratch, we stumbled upon a great way to split the files in your Rails app into different parts. Read about how to use Rails in parts.
Kafka vs Mosquitto - which tool is better for communication between microservices?
In this post, we’re going to make a comparison between two popular tools - Kafka and Mosquitto to see which one is better for communication between microservices.
Datatables Basics
Datatables in Rails that implements pagination, search, sorting by column. Read more here Integrate Datatables without using any pagination gems in Rails Includes a link to a sample Rails project.
The Problems With Validating ActiveRecord Models and Why State Validation Is a Bad Id
In the typical Rails application, you can find the most of the validations in the ActiveRecord models, which is nothing surprising - ActiveRecord models are used for multiple things. Whether it is a good thing, or a bad thing (in most cases it’s the latter) deserves a separate book or at least blog post-series as it’s not a simple problem, there is one specific thing that can cause a lot of issues that are difficult to solve and go beyond design decisions and ease of maintenance of the application, something that impacts the behavior of the model - the validations. [more inside]