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.
Composable validations
http://milhouseonsoftware.com/2015/02/08/composable-validations/ [more inside]
Learn about the Caesar cipher
Want to learn how to write your very own Caesar cipher encoder? Have a read :) http://www.blackbytes.info/2015/03/caesar-cipher-in-ruby/
How to display the source of a Ruby method
You might know this feature from pry, but know it is also available outside pry via the code gem.
Work Flow and Making Progress
Points I’ve learned about getting things done with programming. http://6ftdan.com/allyourdev/2015/03/28/work-flow-and-making-progress/
Making Big Changes Safely
I’d like to take you back 12 months ago. My story starts with my team beginning a 3-month project to add a new feature. My team is Task Force 1. We have 4 developers. The feature is called “Custom Inventory Statuses.” Read more
Gem of Week #13 - props gem - yet another config (INI) reader in Ruby
Hello, over at the Planet Ruby the Gem of the Week series continues with #13 - props - yet another config (INI) reader - that lets you read in configuration settings in the Windows-inspired INI format and lets you link up settings in hashes in a lookup hierarchy and so on. Full article. Cheers.
gem install abstract_class
The abstract class pattern implemented in Ruby: https://github.com/shuber/abstract_class [more inside]
SOLID Review: Interface Segregation Principle
My take on the Interface Segregation Principle in Ruby. Using Ruby modules, we can see the important role cohesive “interfaces” play, even in duck-typed languages. This leads to less coupling and more readable code.
Exceptions should not be expected – stop using them for control flow
If your exceptions aren’t exceptions but expectations, you’re doing it wrong. Raising (failing) and rescuing errors might look as a good idea but it isn’t. Read the article to find out why.
2 more ways to monetize open source software
I’ve already written about how to monetize open source software using educational materials and hosting. Today’s article is about monetizing open source software using paid support services and providing value-added enhancements. Read the article to find out how others are successfully doing it.
5 ways of forwarding your work to some other object in Ruby
How often do you need to delegate methods in Ruby? Do you remember the API to do that? How many ways are out there to do it? Find the answers: https://medium.com/@KamilLelonek/how-to-delegate-methods-in-ruby-a7a71b077d99
Pi 4 ways with Ruby
I recorded this a couple of weeks ago, based on examples I showed my high school class on how to calculate the value of pi. This shows 4 different algorithms for calculating pi in Ruby. There is an accompanying github project so you can run all the code yourself. [more inside]
Different Collection Types in Ruby
A basic overview of collection types available to you in Ruby. http://6ftdan.com/allyourdev/2015/03/26/different-collection-types-in-ruby/
Display information about a method's parameters
The debugging gem has reached 1.1.0 and now includes a howtocall method: def function(a, b=1, c: 2, d:,&e) end [more inside]
gem install sub_diff
Inspect the changes of your String#sub and String#gsub replacements: https://github.com/shuber/sub_diff
Rubyists - are you doing ETL unknowingly?
I just launched a new blog where I’ll share recipes and patterns to process data with Ruby. [more inside]
Work on exercism.io together with Katrina Owen at ROSS Conf
ROSS Conf Vienna is a one day mini-conference bringing Open Source Software maintainers and developers together in one room. The projects participating in its first edition include exercism.io from Katrina Owen and RVM from Michal Papis. In the morning bit the project owners will introduce their projects and share what would need work in the afternoon hackathon-y part. Access is free, we ask for a deposit that you’ll get back upon attendance. [more inside]
Write a simple template engine in 30 lines of code
Many template libraries are hundreds or thousands of lines of code. I break the problem down step by step and show you that you can build your own template engine in just a few lines of code.
Go beyond the easy fix with code archaeology
When you go bugfixing, the quick, obvious change isn’t always the best one. And the code in front of you is never the whole story. To go beyond the easy fix, you have to understand the history behind the code. And there are three great ways to learn what you need to know to confidently change code.
gem install variables
Variable objects for class and instance variables: https://github.com/shuber/variables
How to Create a simple Jekyll-like blog in your Rails 4 app – Nuts & Bolts #1
When I needed a company blog, I had a hard time deciding if I should use Jekyll, a Rails blog engine, or just build a simple blog functionality on my own. I implemented my own, see why and how.