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.
The Elements of Style in Ruby #2: Favor Sprintf(format) Over String#%
I just posted the second installment of my ongoing “The Elements of Style in Ruby” blog series.
Upgrading to Rails 4.0 from Rails 3.2 – Test case – Part I (preparations, configuration, gems)
I just wrote a first part of a tutorial on how to update you Rails application from Rails 3.2 to Rails 4. You can check it out here: Upgrading to Rails 4.0 from Rails 3.2 – Test case – Part I (preparations, configuration, gems).
Verified Double gem
Hi everybody, I’ve been working on verified_double, a gem for verifying mocks in rspec. It works similar to rspec-fire, but instead of checking if the doubled objects respond to the mocked methods, the gem looks for tests tagged to confirm the validity of those methods. The gem’s still in its infancy, but I hope it’s usable for the most common cases.
New gem for speedup your tests
I just launched gem factory_girl-seeds which can speedup your tests runtime in about 2 times :)
MetaCasts.tv - Ember.js Full Hour Video 25% Off!
For the next 24hrs get the MetaCasts.tv hour long video on Ember.js for 25% off, only $15. http://www.metacasts.tv/casts/ember-js-pts-1-4 Includes full source code.
Quick video intro to Searchlight, the lightweight search gem
Searchlight is a lightweight search gem that’s both easy to use and extremely flexible. (At least half its awesomeness is owing to my coauthor, Adam Hunter.) [more inside]
Secure Rails with Hakiri
I just released a CLI tool for Rails developers that allows them to quickly check for CVE vulnerabilities in their web stacks.
How to reduce code complexity in Ruby?
The blog post introduces what complexity is, how it can be measured, how to monitor it in Ruby, and how to reduce it in Ruby. The post is concluded with some thoughts and recap. [more inside]
Reliable mocks with Bogus
Mock with Bogus to avoid having to run your slow integration test suite everytime you refactor your code. Learn more about it in this screencast! [more inside]
football.db Gets Country Repos - Austria, Germany (Bundesliga, DFB Cup etc.)
The plain text football fixtures that you can read with the sportdb gem now sports for easy management and contributions country repos. The first repos include Austria (Österreich) and Germany (Deutschland). See the Deutsche Bundesliga 2013/14 match schedule, as an example. More info. Cheers.
Fuzzy Associative Memory (FAM) fuzzy logic / AI package now on Github
I just released my Fuzzy Associative Memory package to Github. A FAM is a Fuzzy Logic construct useful for decision making in control systems, AI, game agents, etc. There are embellishments still in the works, but this is working software. Pull requests are enthusiastically encouraged.
Speakers for NickelCityRubyConf announced!
We’ve got a great lineup for our conference here in Buffalo this September 20th and 21st. I hope to see you here!
Tweets as JSON via a rack app
A limited functionality version of rackatweet is now available. [more inside]
Faraday - Using Backup Host for Remote Requests
Nowadays almost every Rails application interact with the remote service or API. The problem is that you can’t fully trust those services and you forced to add a lot of test coverage and exception handling for this part of code. Once i worked with the API that had mirror server for case when the main one is unavailable. I write a middleware for Faraday, which will use backup host(provided by user) if the original one is unresponsive. [more inside]
A comprehensive guide to install Ruby & Rails on your PC with screencast
This blog on how to install Ruby & Rails from scratch at Codelearn should be a good resource as it covers all OSes - Windows, Linux & Mac.
Are You a Stable or a Volatile? Recap of Michael Lopp's RailsConf Talk
At RailsConf, Michael Lopp broke down two spectrums of personalities, stables and volatiles, and how these personalities play out in the application development environment. SmartLogic’s Matt recaps the stables and volatiles talk here if you missed it at RailsConf. Interesting to think about how this can help you work better with the people on your team.
Creating a Custom Rspec Generator
I was having trouble finding a good resource this, so I blogged about how I created a custom Rspec generator for one of my gems.
Attrio 0.4 released
Today we released Attrio-0.4 (attributes manager for plain old Ruby objects). In this release several issues were fixed but the most significant change is that attributes defined with Attrio are inheritable. Also all class level variables were removed. [more inside]
Performance optimization with pry-debugger
I just wrote in the Wimdu Engineering Blog about performance optimization with pry-debugger :)
Casting: adding behavior to objects without using extend
Most software developers tend to write code where objects are given too many responsibilities. Code with bloated objects is more difficult to test, to understand and to maintain in the long run. To keep the code small and focused, different strategies can be used to extract behavior. A new gem, “casting”, claims to bring the benefits of both mix-ins and delegation, but without their drawbacks. Read more: https://discuss.gemnasium.com/t/casting-adding-behavior-to-objects-without-using-extend/34
chruby 0.3.6 and ruby-install 0.2.0 released!
Released chruby 0.3.6 and ruby-install 0.2.0. chruby is an ultra-minimal Ruby switcher (~90 LoC), that does one thing and one thing only, switches Rubies. ruby-install downloads, compiles and installs any version of Ruby, JRuby, Rubinius or MagLev. ruby-install supports automatically installing into ~/.rubies / /opt/rubies and can install additional dependencies using your system’s package manager.
I18n tasks to introspect translations
I just shared i18n-tasks. Rails I18n tasks to find missing / unused translations and more. Works with slim / coffee / haml etc. Provides these tasks: