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 href="https://github.com/mz026/hash_police">HashPolice - hash format checker/a>
Hash Police is a gem to check whether given two hashes are of the same format, with readable result format and API. It can be used in testing to make sure the api response JSON format is as expcted by using a sample hash and is easy to integrate into testing frameworks like RSpec.
Tuxedo: 150 LOC Implements Presenter Logic in Rails
Dress up a boring looking instance with a Tuxedo suite and you have something nice to look at. Tuxedo is a simple gem that allows you to wrap any ruby object in a presenter. It attempts to use as little black magic as possible, 100% tested and documented. Read more
Enumerators and Enumerable Methods in Ruby
Vince explains how Enumerators and Enumerable work in Ruby with an example of generating prime factors. [more inside]
Wye Tech News #6
A new issue of our weekly compilation of interesting news and articles about Ruby, Rails, JavaScript and web development related stuff that we found during the week.
A Recipe to Store Capistrano’s Server Configs in YAML
A very basic yet effective recipe to extract your server’s details from the Capistrano config files and into a non-version-controlled YAML file. [more inside]
OSX 11.0.0 (shell scripts for bootstrapping new machines)
Beside the skills and experience you bring to a job, one of the most important assets in complimenting your abilities is your machine and the software configured on it. These OSX shell scripts make it possible to easily install and configure a new OS X machine with minimal effort. They are opinionated for my setup but easily customizable for your preferences. If nothing else, you might learn of new tools to add to your toolset. Enjoy!
On DataFrame datatype in Ruby
Here is a blog post ranting on DataFrame datatype, why Ruby needs it and why existing implementations are far from satisfactory.
Ruby’s “each_with_object” vs. “tap + each”
Why do many Rubyists prefer “each_with_object” and “tap + each” over explicitly returning objects? When the choice comes, which one should be preferred and why? Click to view difference in visuals and speeds of both. [more inside]
pstore_pp pretty-prints the contents of a PStore file as JSON
Given a PStore file database.pstore with a root ‘foo’ that has a value ‘bar’, and another root ‘some’ with the value ‘thing’, calling pstore_pp on it would yield the following result: [more inside]
15+ best resources for learning Ruby on Rails
What are the best resources help me lean quickly Ruby on Rails? This is a question which I asked myself when I begin learning Ruby on Rails. After a long time self-study and working with RoR, today I want to share some experience about awesome sites, blogs and books which I used to. Hope that they are useful for you. Read more: http://goo.gl/TxciZI
ETag caching gotcha in Roda + Nginx
Why ETag caching might work on your development machine but not in production in Roda application using Nginx as web server. http://masa331.github.io/2016/01/06/roda-etag-caching-gotcha.html
Photish - A simple photo collection website generator
Photish is a simple, convention based (but configurable) static photo site generator. https://github.com/henrylawson/photish
4 ways to filter has_many associations
Filtering has_many associations can be one of those problems which makes you want to do some extra reading to brush up on your SQL and ActiveRecord knowledge. http://ducktypelabs.com/four-ways-to-filter-has_many-associations/
Spina CMS - New update
It’s been a while since our last update. We’ve been working on some exciting stuff and I would like to show it to you. [more inside]
What's up with queues? Ruby + Redis
Just a simple primer on the basics of queueing. Feel free to suggest improvements and provide feedback! https://medium.com/when-code-explodes/what-s-up-with-queues-ruby-redis-c05311f33438#.lrng41qd2
Contextual validations with form objects
When you deal with complex forms The Rails Way is not enough. You have to introduce another abstraction for handling more sophisticated validations. http://blog.sundaycoding.com/blog/2016/01/08/contextual-validations-with-form-objects/
Is Rails 5 Ready? - Check the Status of Rails 5
A simple page that shows the status of the Rails milestones. http://solidfoundationwebdev.com/is_it_ready/rails
Hidden Complexity in Ruby Land
Ruby makes it easy to pack a lot of power into a few lines of code. [more inside]
All (new-ish) Rails security HTTP headers explained
Rails sends a couple of security HTTP headers by default, so you should probably know what they do. There are also a few additional ones that require a bit more configuration and thought. You can read the article here.
How Delete The First Instance Of Value From Array In Ruby
This article describes deleting the first instance of a value from an array in Ruby. http://solidfoundationwebdev.com/blog/posts/delete-the-first-instance-of-value-from-array-in-ruby
The difference between if and unless
A dive into what is happening under the hood between if and unless: Ruby’s “unless X” is processed differently than “if !X”!
Statefulness in a Stateless Language: Elixir
When it’s necessary to keep track of state, Elixir (functional, stateless) has got your back by using recursion and processes. You can read Micah Woods’ article here.
ActiveRecord stole my data and now I want it back
A case study from the Yammer engineering team describing how they migrated away from an ActiveRecord model to a plain Ruby class backed by a microservice. A practical demonstration of how to evolve an architecture, with plenty of code examples and suggested gems.