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.
Build a location-aware WhatsApp weather bot with Ruby, Sinatra and Twilio
WhatsApp supports sending and receiving location data via their API. In this post we are going to see how to build a WhatsApp bot that can receive and respond to location messages.
Diggin through hashes and arrays in Ruby
A simple but effective trick for parsing nested hashes and arrays using Ruby [more inside]
Facade Pattern in Rails for Performance and Maintainability
Find out how and why you should use a software design pattern named Facade. https://blog.appsignal.com/2020/03/18/facade-pattern-in-rails-for-performance-and-maintainability.html
Automate Unit Tests Coverage Reports and Dependency Updates
Keep your project dependencies always up to date and maintain a certain level of test coverage. https://medium.com/@wshihadeh/automate-unit-tests-coverage-reports-and-dependency-updates-for-your-repositories-41be1b858eb3#e716-5d36fa1f22d1
Custom Elasticsearch Search Parser
Build your own custom search parser for Elasticsearch Part 1, Part 2.
DRY up your structured plain-text files with ERB
I had a huge Markdown file (used to generate a presentation) that had many repeated elements. It was getting hard to keep those repeated elements consistent. So I slapped a method to output the formatting I need in ERB tags directly within the file, threw an .erb extension on the file name, and used the “erb” command-line tool to render it. You can make managing your plain-text files easier, too, with the details in this blog post!
Host a Secure Private Gem Server
Host a Secure Private Gem Server With LDAP Authentication and Authorization https://medium.com/better-programming/hosting-a-private-gem-server-2288249caf77
TrianglePattern Gem
https://github.com/hendrixfan/triangle I made a Gem to generate colorfull triangle patterns. You can use the resulting SVGs as background image for your Project. [more inside]
How we migrated from Timecop to built-in Rails 5.2 helpers
If you use Timecop to freeze time in your Ruby on Rails application you may not need it anymore. There have been handy helper methods since version 5.2. https://frontdeveloper.pl/2020/03/how-we-migrated-from-timecop-to-built-in-rails-5-2-time-helpers/
Ruby's Bitwise Toolbox: Operators, Applications and Magic Tricks
How often do you think about the bits – the ones and zeroes – that make up your app’s data? If you’re doing web development in Ruby there’s rarely any need to. But what if you want to interact with the operating system or a piece of hardware? What if you’d like to understand network protocols or databases? In that case, a solid understanding of bitwise operators is foundational. In this article José M. Gilgado will introduce you to bitwise operations in Ruby, give practical examples of how they can be useful, and finish big with with some fun math tricks. https://www.honeybadger.io/blog/ruby-bitwise-operators/
tablesmith 0.5.0 released
Yet another console table tool, focused on minimal config. [more inside]
How to properly monkey-patch a Ruby Class in Ruby on Rails?
Sometimes, when we use an existing Ruby Class from a third-part gem, we need to monkey-patch it to fit our project’s needs. Will you use class_eval or Module#prepend ? Hint: Not the first one :) [more inside]
Using Active Storage in Rails 6
A step-by-step guide to setting up Active Storage in a Rails 6 app, encrypting credentials, and uploading files to Amazon S3 in production.
opmlparser gem - read / parse outlines (incl. feed subscription lists) in OPML
Hello, I’ve bundled up a new alternate opmlparser gem that lets you read / parse outlines (incl. feed subscription lists) in the OPML (Outline Processor Markup Language) format in xml. Use OPML.load or OPML.load_file to get back a “plain standard vanilla” hash table or use Outline.parse or Outline.read to get back outline struct(ure)s. Cheers. Prost.