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.
iniparser v1.0 - read / parse INI configuration, settings and data files into a hash
Hello, I’ve updated the iniparser gem / library to support “modern” named subsections and now you can even use space as your name / value separator in keys / properties and much more. Read more about ruby’s ini configuration reader. Cheers. Prost PS: The readme includes Frequently Asked Questions (FAQ) and Answers such as Q: Why not use TOML (Tom’s Obvious, Minimal Language)? or Q: Why not use IniFile - the most popular library (10+ million downloads and counting)?
Hash#shift using default values
How the way you define your hash default value can generate side effects in your program? SEE MORE
Testing static sites with Ruby, RSpec, Capybara, and Webkit
Read about testing static sites with Ruby and RSpec (e.g. those generated with Jekyll).
Which is faster, using Mixin Modules or Reopening Classes?
Today I answer the age old Ruby question: Which is faster, using Mixin Modules or Reopening Classes? https://dev.to/schwad/ruby-science-saturday-use-mixin-modules-or-reopen-classes-2i9m
The redo Keyword in Ruby
In this article we’ll focus on the redo keyword. SEE MORE
Lint your Gemfile with gemfilelint
https://github.com/kddeisz/gemfilelint is a utility that you can run against your Gemfile that will check all of your listed sources against known trusted sources and all of your listed gems against the most commonly downloaded gems according to rubygems. This can give you some peace of mind that if you make a spelling mistake you won’t accidentally open yourself up to RCE without knowing it.
Ruby Quiz - Challenge #18 - Up-to-Date? Version Check All Your Libraries
Hello, It’s Friday. Ruby Quiz time! Join us for the third challenge in the new year in 2020! Here we go: Challenge #18 - Up-to-Date? Version Check All Your Libraries Let’s say you have a script that depends on many libraries / gem. How can you make sure the minimum version requirements are fulfilled? … Post your code snippets on the “official” Ruby Quiz Channel, that is, the ruby-talk mailing list. Happy list processing and version checking with Ruby.
Best "Developer Tools" Trick
So, this isn’t Ruby related, but since most of us are work on web applications and use Javascript daily, this will apply to you. I recently stumbled upon this trick the other day and it has changed my approach when debugging/writing Javascript. https://blog.driftingruby.com/best-developer-tool-trick/
Open source Intercom alternative, made on rails 6
I’ve made Chaskiq , an Intercom like platform made in Rails 6, with React and Graphql for it’s API. It’s fully functional with many niceties like Automated Bot tasks, Segments, NewsLetters, Guided Tours and Third party API integrations like Twitter, Slack, Calendly, Pipedrive & Analytics. And many more to come in the next weeks!
Clean your Rails routes: nesting
How resources can help you to avoid custom routes? SEE MORE
Rails 6 Upgrade Tips
Check out my post for some good tips for upgrading to Rails 6 that were not addressed in the Rails upgrade guide. Includes details about supporting multiple databases and more.
Why Dry: An Introduction to dry-rb and Why You Should Use It
Learn all about dry-rb gems and how they can help provide a robust, testable, and scalable way of handling business logic in your Rails applications. Read the post.
Write test for data migrations
Today I heard a funny story at a local Ruby meetup. A guy corrupted data in production by a data migration. Don’t repeat his mistake, use this gem. It’s not super popular, but has been tested over time. Surprisingly, people still use it and seem satisfied. Any contribution is welcomed!
Clean your Rails routes: grouping
In Rails, it’s important to find a way to order and maintain your routes.. SEE MORE
Custom RuboCops to support your code-reviews
Running RuboCop in your CI is a great way to enforce a commonly agreed upon style-guide and best-practices. [more inside]
Rails migration for belongs_to with custom table name
Check out my recent post describes how to specify a belongs to association in Rails migration with a foreign key to custom table name. Spoiler: as the result it has improved Rails docs!
rubynews gem - what's news in the ruby world? browse week by week - 30+ channels
Hello, I’ve put together a new command line tool using the Pluto News machinery that lets you browse ruby news week by week. Let’s welcome the rubynews gem package. Type: $ rubynews to run. Resulting in: Welcome to Ruby News v1.0 (30 Channels, 940 Items) ... A Migration Path to Bundler 2+ ... Happy new year & Sinatra 2.0.8! .... Cheers. Prost. PS: Find the 30 built-in news channels / feeds for easy (re)use in the planet.ini configuration file.
How I MITM'd rubygems.org ... Kinda
An exploration of how I ran a Man in the Middle server against rubygems by using a domain typosquat
Build a WhatsApp chatbot with Ruby, Sinatra and Twilio
In this post we’ll get started building a simple chatbot that can respond to different keywords over WhatsApp, sending back pictures about dogs or cats based on the message you send it. We’ll use Sinatra and the Twilio API for WhatsApp to build ourselves a chatbot.
Net::HTTP is not your API client
Firing off one request is not enough to interact with APIs in production. If you are not willing to add the boilerplate code to add the necessary robustness - please use a library [more inside]