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.
Store different kind of actions in one table
Store different kind of actions (Like, Follow, Star, Block …) in one table via ActiveRecord Polymorphic Association. ActionStore
Decorators, are we really decorating well? or using a tooth brush to paint a room?
After a little interest in my latest gem, I wrote a little piece to add to the design patterns in Rails conversation. A small blog about decorators in Rails and why I steer well clear of draper and other implementations. As well as an introduction to my own implementation of the decorator pattern, bottled_decorators.
Bringing more life to the irb
If you want to bring more life to your irb console then have a look at this. Irb can be made to do more things that you originally imagined. http://blog.redpanthers.co/ruby-irb-console-improvements-irbtools/
A better way to import all your records using ActiveRecord Import!
Ever suffered through importing lots of records using ActiveRecord ? If so, this post is for you! https://revs.runtime-revolution.com/a-better-way-to-import-all-your-records-using-activerecord-import-6053e20692f3#.n9lc1iwk5
An alternative to Rails before_action
Thoughts on best practices for filters in Rails controllers and the search for an alternative to the not proper uses of before_action. https://medium.com/@shvetsovdm/an-alternative-to-rails-before-action-eb010c3ffbfb#.9unc7tr7g
Integrate Rubocop gem with Popular (Ruby) Text Editors
Integrate rubocop(A Ruby static code analyzer) in popular text editors Sublime, Atom, Vim, Visual Studio Code and RubyMine [more inside]
Testing multithreaded ActiveRecord code with transactional fixtures
ar multi threaded transactional tests gem synchronizes transactions and db queries, so testing multithreaded code works with transactional fixtures.
Distinct Active Records in has_many through associations
A quick reminder on how to load only distinct collections into Ruby on Rails models with has_many through associations.
Introducing our Sidekiq cluster script
Here’s an easy way to run multiple Sidekiq processes via systemd: http://blog.honeybadger.io/introducing-our-sidekiq-cluster-script/
Animated Turtle Graphics using PDF
After seeing one of Jamis Buck’s weekly programming challenges being the implementation of a turtle graphics system, I decided to tackle this one using HexaPDF as backend. It turns out that animated turtle graphics are still more fun!
A Simple Introduction to Structs
http://www.rubyletter.com/blog/2017/02/03/struct-use.html An introduction to Ruby structs, their abilities, and when to avoid them.
How To Test Ruby CLI: Console
Learn how to programmatically interact with a child process (an IRB console) from Ruby. This is how I test Hanami CLI. http://lucaguidi.com/2017/02/08/how-to-test-ruby-cli-console/
A Medium editor for Rails
Hey, I’ve released a new version of Dante2, a Medium wysiwyg clone, which supports a better Rails integration and es6 module support check it out on https://michelson.github.io/dante2/
Handling exceptions in Rails' test environment like in production
Recently I encountered a difference between running Rails in production and test environment, and how you can fix it: https://christoph.luppri.ch/articles/2017/02/07/handling-exceptions-in-rails-test-environment-like-in-production/
Ossert, a Ruby gems ranking system utilizing an Open-Source Maturity-like model
In our work, we come across a plenty of libraries, frameworks, and tools. Among the alternatives, we are supposed to choose the best option — and support the existing code relying on it. [more inside]
Hash Tables Explained
What happens behind the scenes when you use a hash object in Ruby? Read this post to find out… http://www.blackbytes.info/2017/02/hash-tables-explained/
New org for feedparser (atom, rss, etc.) and feedfilter (strip_ads) gems
Hello, for easier (re)use and contributions I’ve moved the feedparser and feedfilter gems to its own github org /feedparser - there’s no dependency on planet pluto ;-) - its former home. The feedparser gem offers a web feed parser and normalizer for Atom, RSS 2.0 and friends. And the feedfilter gem offers filters ‘n’ rules for easy (re)use e.g. strip_ads for feedflare of tracking bugs for feedburner, etc. Cheers.
sidekiq-merger 0.0.10 release!
Merge sidekiq jobs so that you can cancel notifying emails or batching similar ones. The repo includes Dockerfile for you to try the functions without any effort. [more inside]
Simple tips to make scaling your database easier as you grow
In this post we’ll discuss a few easy wins - things you can do when a Rails project is young to make it much easier to scale its data layer as the project grows. http://blog.honeybadger.io/easy_rails_database_scaling_wins/
The Ruby Book Club Podcast reads 'Refactoring: The Ruby Edition'
The Ruby Book Club Podcast is now reading ‘Refactoring: The Ruby Edition’. You can find all of the episodes so far here, including older series where we discuss ‘99 Bottles’ and ‘Confident Ruby’. You can also subscribe wherever you normally get your podcasts.
OpenStreetMap Blogs (blogs.osm.org) Moved from Python to Ruby ;-)
Hello, Thanks to Andy Allan for moving the OpenStreetMap Blogs from the classic Planet Planet (in Python) to the modern (Planet) Pluto (in Ruby). See the new planet setup on Github. Cheers. PS: What’s Pluto!? A Free Planet (Static) Site Generator - Auto-Build Web Pages From Published Web Feeds -> feedreader.github.io
About PStore feature of Ruby stdlib
PStore(persistent store) implements a file based persistence mechanism based on a Hash. It writes Ruby objects to an external file so it can access easily if needed. [more inside]
[Screencast] Managing Servers with Ansible
A look into the Drifting Ruby network architecture and how I manage deployments with Ansible. https://www.driftingruby.com/episodes/managing-servers-with-ansible
rspec-benchmark v0.3.0
rspec-benchmark adds a new performance matcher for comparing between two operations.