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.
Dropping elements left and right: fun with ruby arrays
Exploring ways of dropping elements from arrays: a look at Array#drop_while, implementing and benchmarking a counterpart Array#drop_while_right. More of an experiment and an excuse to play with refinements and benchmark-ips then something that would be used in production code :) [more inside]
Unicode Micro Libraries
Unicode X is a set of libraries providing specific Unicode-related functionality, like finding out the script a character belongs to or retrieving the name of a character.
Refactor away duplication in your RSpec tests using the Parameterized Test Method
What do you do when you need to run the same test multiple times, but with different parameters? If you copy and paste the test, you end up with a hard-to-read test file. You can’t easily tell how the tests differ from one another. Parameterized test method to the rescue!
The Optimist’s Guide to Pessimistic Library Versioning
Richard Schneeman looks at different strategies for declaring dependencies in libraries and how we might be able to make major version bumps easier into the future. Article here.
Don't tie jQuery to the Rails
It’s time for jQuery to go. It’s a great library but it’s not a part of Rails. I was recently auditing a site for dependencies. Skimming the list of JavaScript libraries I blew right by jQuery. Then a thought popped into my head. The bits of dynamic front-end were built using React. Where was jQuery being used? [more inside]
How to turn your service into a Heroku add-on
Butter CMS takes us through exactly how to build a Heroku add-on and shares their experience with the entire process.
RubyFlow Turns 8 Years Old
I just noticed that RubyFlow’s first post was 8 years and a few days ago. Thanks for all of your support and (14675!) posts over the years :-)
Playing With Google Vision API: Ruby Slack Bot Tutorial
Hey folks, I wanted to present a simple bot using Google Vision API in Ruby, created by my colleague Szymon. This tutorial will help you when building apps that require visual content identification. It’s open source, so feel free to use the code, contribute and improve where you find necessary. Your feedback is very welcome! Ruby Slack Bot: Using Google Vision API Tutorial
Rails 5 adds warning when fetching big result set with Active Record
Running into memory issue by accidentally loading large number of records in Rails ? Rails 5 has a solution. [more inside]
Testing PDF generation with Ruby
If you are generating PDFs in your apps, you should also test them. Here are my thoughts on how to test PDF generation in Ruby. I would welcome other tips/approches you do.
Background jobs in Ruby
Queue management systems are used to process background jobs, so these jobs don’t interfere with the user experience. There are systems that use a database, and others that use Redis instead. Even Ruby on Rails has standardized it with ActiveJob so the application uses the same syntax for any system.
Global Hotkeys Management for toggling windows in Linux/X11
I’ve just released global_hotkeys_manager a new gem that integrates some command line tools like xbindkeys and xdotool to enable you to assign global hotkeys (shortcuts) to existing windows that will toggle their visibility for quick access. It supports Linux/X11. [more inside]
Don't you Struct.new(...).new(...)
Have you ever seen Struct.new(...).new(...) in code or have you written it yourself? Have a look at this post ideas for reasons why not to do it, such as the immense performance hit.
From Rails to Node.js – Initial Observations
My initial observations coming to node.js from a rails background. [more inside]
Notifyor now with Linux support
Link: The new version of notifyor now supports growl messages on linux. Notifyor is a gem which generates growl messages on your desktop when something happens in your rails app.
Things to Consider when Metaprogramming in Ruby
Metaprogramming in Ruby is a polarizing topic. The most common purpose of Ruby metaprogramming is for code to alter itself at runtime. Metaprogramming can be used to achieve terse and more flexible code. However, it is not without its cost. As with most things, nothing of value is free, even metaprogramming.
Slide Show Quick Starter Kit - Write Your Talks in Text w/ Markdown (n Ruby Helpers)
Hello, I’ve put together a quick starter kit for writing your talks in plain text with markdown formatting conventions. What’s included? 1) A first sample talk (see sample1.text) 2) A second sample talk (see sample2.text) incl. some (ruby) macros/helpers e.g. left, right, step, etc. ++ Use a (static) slide show builder / generator to build a web page that is an all-in-one-page handout and a live slide show all at once e.g. $ slideshow build sample1.text and than open sample1.html in your browser of choice. Cheers.
From Rails to Hanami Part 2: Sequel Migrations, Model Validations, Specs and Fixtures
The ‘real world problems’ driven guide to use Hanami on production:
Metaprogramming in The Wild
How are some of the most popular open-source projects making use of metaprogramming?
Ruby Methods: differences between load, require, include and extend in Ruby.
One day, as your code grows, you may find it hard to organize your application. At this point, the best idea is to split your code into several files. [more inside]
Rails Emoji Picker 0.1.5 was released!
A lot of bugs were fixed since the first release. Now rails emoji picker is ready to use Heroku Example - Example on Heroku Github Repository - Rails Emoji Picker [more inside]
Reifier
Toy rack app server written in ruby [more inside]
Simple Multitenancy with Rails and Pundit
Minimalist way to get a multitenant Rails app up and running.