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.
Decorators in Ruby
Ruby’s low-overhead metaprogramming facilities make it easy to create elegant APIs with minimal effort. As a testament to its power, I can say with a high degree of confidence that all of your favorite Ruby libraries leverage metaprogramming in one way or another. [more inside]
Pongal Gem Released
Pongal is a valid US state generator that can be used in Geocoding applications. https://rubygems.org/gems/pongal The source code is on Bitbucket https://bitbucket.org/bparanj/pongal
Holycorn: PostgreSQL multi-purpose Ruby data wrapper
I have just released Holycorn. It is a Foreign Data Wrapper for PG that uses Ruby (actually, mruby) as its data provider: write a Ruby script, and select its data transparently from a PG table!
Render Markdown views with Redcarpet and Pygment in Rails
This Lugo Labs Tutor tutorial shows a way how to create a Rails renderer for Markdown so we can use it in views as we do when we write HTML. The view will need to support all Markdown syntax and Pygments, to prettify any code we have in the view. The code should be wrapped within a tag decorated with a class specifying the language in which the code is written, following standard Markdown syntax.
Ruby Productivity Scripts
As developers, we are so busy that we don’t have time to think about the amount of repetitive tasks we do on a daily basis. So, why not automate repetitive tasks and learn Ruby at the same time? Read the first article in this series: Clone a Git Project
Ilya Grigorik lays out HTTP/2 on The Changelog
On episode 161 of The Changelog, Ruby Hero Ilya Grigorik joins us to cover everything around HTTP/2 — the spec, HTTP/1 history, SPDY, binary framing layer, the semantics of HTTP/2, pipelining, multiplexing, header compression (HPACK), server push, TLS, “time to glass”, upgrading, adoption, support and more!
Have you bought your ticket to eurucamp yet?
eurucamp is one of Europe’s biggest ruby conferences, and it’s also, in our humble opinion, one of the best! If you haven’t bought your ticket yet, there’s still time. Tickets went on sale last weekend! http://tickets.eurucamp.org/ [more inside]
How to use Basic Authentication with the Ruby Rest-Client gem
If you’ve ever tried to use basic auth with the rest-client gem, you know it’s not really obvious how to do it. Here is a quick writeup I did to hopefully save the next dev an hour of fiddling: https://www.krautcomputing.com/blog/2015/06/21/how-to-use-basic-authentication-with-the-ruby-rest-client-gem/
Ruby Refinements - Not quite ready for production
Ruby’s refinements may lead to odd and unexpected behavior. Here are some of the limitations I’ve found Ruby refinements have as of Ruby 2.2.2 [READ MORE]
A cookie based approach to handling guest users in Rails
Check out this post I wrote on implementing a database-less and polymorphic approach to handling guest users in Ruby on Rails using the cookie or session store.
Inch CI: Year One
Inch CI celebrated its first anniversary this week and I wrote a blog post about it: Inch CI: Year One
JS Live: It's RubyFlow, but for JavaScript
If you dig JavaScript, Angular, React, Ember, Node, and all the rest, check out JavaScript Live - it’s a slightly jazzed up version of the RubyFlow software (backports will come in due course) for JavaScript developers :-)
Dokaz: check code fragments inside your Markdown
I’ve recently released dokaz gem, which is quick-and-simple way to run all code blocks inside your GitHub Markdown files (Readme or Wiki) and see, if they are working and what they output.
JavaScript + Ruby on Rails: 7 Must-Read Resources
Hey folks, Here’s a list of 7 learning resources for those of you who want to get to know JavaScript better. There’s something both for beginners and more experienced developers. Enjoy! 7 Must-Read Resources on JavaScript for Ruby on Rails
Super-fast string matching using Aho-Corasick
We’ve got a use case for finding occurrences any of a large (100k+) dictionary of strings in a piece of text, so we’ve published an implementation of the Aho-Corasick bibliographic search algorithm which improves a little bit on some of the other available implementations – it might be useful if you have a similar requirement!
Finnaly figured out how to run single example easily with Guard Minitest/Spec
EDIT Looks like minitest-focus is the way to go here. Can’t believe that I haven’t heard of this until now! [more inside]
Docker Basics : Connecting Containers
In this tutorial, you will learn how to run a simple Rails app with PostgreSQL database by linking database container and the Rails app container Docker Basics : Connecting Containers
A simple way to check your gems' memory usage
I just posted a brief intro to the derailed gem, which is a nice collection of profiling tools: http://blog.honeybadger.io/profile-your-gem-memory-usage-with-derailed/
Crows, microlibrary for authorization in Ruby classes
I’ve written a micro library for authorization in Ruby classes, Crows provide you with a few helpers to check if current_user can make operations into some records. This gives you the freedom to build your own plain Ruby classes to make authorization works easily, without the painful of bigs DSLs. Hope you enjoy it!
Ruby World-Wide Conference Calendar (Sorted by Year, Month, etc.) @ Planet Ruby
Hello, I’ve created a little Ruby script that reads in the awesome-events page @ Planet Ruby and (auto-)generates a calendar page listing Ruby conferences sorted by date (year, month, etc.). Anything missing? Contributions welcome. Cheers.
Getting accurate code coverage metrics from SimpleCov in a Rails project
We use SimpleCov to track code coverage of our tests in Rails projects. For coverage to be in any way useful as a metric it needs to be accurate. We noticed that files for which we had no tests were not being tracked and not included in the coverage. [more inside]
How to get more value out of your Heroku dynos, and speed up your Rails application
We found ourselves going over and over the same optimisations when deploying new sites on Heroku, so we’ve tried to compile them all in one place.