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.
A mock server in Ruby
After the initial release of the mock server many months ago, I have now a stable version available for open use, with improved documentation and some test coverage. The server makes it easy to set up mock data for ReST endpoints to aid the testing of client applications (API consumers). Set up mock once and use across multiple clients that may have been implemented in different codebases and technologies. Can be used for both manual and automation testing. The server is based on Sinatra and backed by sqlite. https://github.com/mvemjsun/mock_server
Adding custom types to your ActiveRecord models with the Attributes API
A brief look at the Attributes API and how to define custom types that can be used in your ActiveRecord models: https://christoph.luppri.ch/articles/2017/01/07/adding-custom-types-to-your-activerecord-models-with-the-attributes-api/
Rails5 and CarrierWave
Step by step guide to implement file uploading with the CarrierWave gem https://medium.com/@mauddev/rails-5-and-carrierwave-53960ec20c4b#.a5cdc4l6r
rails_or gem released!
rails_or is a gem that Support && Add syntax sugar to #or query method in Rails 3, 4, 5. Usage: [more inside]
RealCodez: Gems Missing in Bundle Outdated, Part 3
In the latest screencast, we wrap up a PR that refactors and adds tests to contributor’s PR to fix a bug in Bundler 1.13. See all our screencasts and clips here.
Prototyping tabletop games with Squib
Squib is a Ruby DSL for prototyping tabletop games, used by hobbyist and professional game designers. We’ve just released v0.13, and we have a bunch of new tutorials walking you through it, as well as several of our own big-box and card games. Cheers!
Ruby Exception Handling - Primer for Dealing with Errors in Ruby
Whether you’ve been programming in Ruby for years or you’re a complete beginner, tracking down errors in your Ruby app is easier than you think. We walk through some basic ruby and rails error handling, and various ways you can automatically log and report your exceptions.
Optimal way of processing large files in Ruby
Few ways of processing large files in Ruby: [more inside]
Rails Security Checklist
Rails security checklist is working to become a community-driven resource to help security-minded developers. If you’re interested in this kind of thing please join in: https://github.com/eliotsykes/rails-security-checklist
Language (flash) Card game 'language_cards' released! via @6ftdan
Command line game for learning languages in flash card style is here! Full internationalization and auto-import YAML card sets for adding your own flash cards. Currently implemented is Romaji to Hiragana & Katakana for learning Japanese. See the project at danielpclark/language_cards or simply “gem install language_cards
”. You can contribute to the language files without any Ruby knowledge, but Ruby devs are most welcome!
Coverband 1.5 release, adds code usage density
This feature request has been 3 years in the making… Coverband originally supported production code LOC usage, but with various performance improvements it can finally support production LOC hit count. Find dead code and little used code on production.
Safe monkeypatching
Ruby is the language of monkey patching. It’s almost impossible to avoid it in a huge Rails app. And still, there are good and bad ways to add a monkey patch. [more inside]
Common Rails Idioms that Kill Database Performance
Many of the most common ActiveRecord idioms produce SQL which doesn’t scale well as your dataset gets larger. In this article I discuss three of the worst offenders and offer work-arounds. http://blog.honeybadger.io/common-rails-idioms-that-kill-database-performance/
Invisible Captcha - New release with Rails 5 support
New patch release - Invisible Captcha v0.9.2: a simple and flexible spam protection solution for Rails applications, based on honeypots. Link: https://github.com/markets/invisible_captcha [more inside]
Ruby: Stream processing of shell command results
Executing a shell command and then processing results can be an overkill for both performance and memory. Here’s one of the alternative solutions for executing and processing shell command results in a stream.
Raw SQL formatter
Made simple gem for easy raw SQL reading in development. Hope, you find it handy :) https://github.com/kvokka/pp_sql
Super simple ruby decorators
I wanted to have model decorators, accessible from anywhere but in separate namespace. [more inside]
How To Spy on Your Ruby Methods
What if you could find out what a method is doing? Using this built-in Ruby class you will be able to… http://www.blackbytes.info/2017/01/spy-on-your-ruby-methods/
Google Assistant SDK gem
Google provides a Node SDK for its Google Assistant. However, I work primarily in Ruby so I’ve created the google_assistant gem. It’s functional, but I am currently working toward a 0.1 release, hopefully to follow up with a 1.0 release before long. https://github.com/armilam/google-assistant-ruby
[Screencast] Periodic Tasks with sidekiq-cron
Using a third-party add-on, sidekiq-cron, we can create periodic tasks to extend the functionality of sidekiq. https://www.driftingruby.com/episodes/periodic-tasks-with-sidekiq-cron
My book 'Learn Ruby on Rails' free on Google Play
The first book in my series Learn Ruby on Rails is now available for free on Google Play. I’m making the book available as widely as possible. It is also free on Leanpub or Softcover, thanks to support from a Kickstarter campaign. If you’ve got a friend who has made a New Year’s resolution to learn to code, the book could be a good place to start.
How To Time Travel Using ActiveSupport TimeHelpers
If you need to test “time” literally. Here’s an alternative to TimeCop for testing time-related validity logic in Rails. http://blog.katpadi.ph/how-to-time-travel-using-activesupport-timehelpers/
Event sourced domain objects in less than 150 LOC
Some say: “Event sourcing is hard”. Some say: “You need a framework to use Event Sourcing”. Some say: … Meh. You aren’t gonna need it. Learn how to build event sourced domain model starting with just a PORO object. [more inside]