While in OKC for OpenBeta4, Adam and Wynn sat down with James Edward Gray II and talked about his many Ruby gems, TextMate bundles, and his upcoming Ruby conference Red Dirt Ruby Conf this May. RubyQuiz.com Challenge your Ruby fu, feel dumb, learn something, repeat. OpenBeta4 We were blown away by the startup community in […]
tumblr-rb from Mark Wunsch is a cool new Ruby wrapper for Tumblr, the blogging service that powers The Changelog. While not the first Ruby wrapper for Tumblr, nor even the first with CLI support, tumblr-rb is the first we know of to support YAML front-matter.
YAML front-matter isn’t a special part of your brain, rather it’s YAML formatted meta-data at the top of a text file, a pattern made popular by Webby, Jekyll, Nanoc, and other static-ish publishing tools:
--- title: The Tumblr Gem state: queue format: markdown tags: Ruby, Tumblr, Weary slug: tumblr-rb --- You can also give it a URL: $ tumblr http://mwunsch.github.com/tumblr/tumblr.1.html That will create a _Link_ post on Tumblr pointing to the `tumblr` manpage.
Tumblr is about removing the friction from blogging workflow. If you spend any time in the terminal, tumblr-rb takes it even farther.
gem install ghost
And then from the command line:
$ ghost add mydevsite.local [Adding] mydevsite.local -> 127.0.0.1 $ ghost add staging-server.local 18.104.22.168 [Adding] staging-server.local -> 22.214.171.124 $ ghost list Listing 2 host(s): mydevsite.local -> 127.0.0.1 staging-server.local -> 126.96.36.199 $ ghost delete mydevsite.local [Deleting] mydevsite.local
Aside from basic
delete options, Ghost provides powerful
delete_matching operations to import files or delete entries based on pattern matching.
Check out the source on GitHub.
UPDATE: We covered ghost-ssh, a hidden feature of
ghost which lets you manipulate your
~/.ssh/config file as well.
Why would a schema-less database need migrations? Simple: to help you keep old data fresh as you change your data format. Recently added new columns to your MongoMapper model and need to update old values in your MongoDB collection? Terry Heath gives you Mongrations:
script/generate mongration update_followers_count_for_existing
You’ll get a new file with the familiar Rails migration format:
class UpdateFollowersCountForExisting < MongoMapper::Mongration def self.up end def self.down end end
Just add your own code to manipulate your data and call
rake db:mongrate. Mongrations include rake tasks for
Terminal junkies rejoice! Now you can use Cucumber to test your command line interfaces just like you do for your web apps. Aruba from Cucumber creator Aslak Hellesøy provides familiar step definitions for testing output, exit statuses, and file system commands. Here’s an example feature file for testing exit statuses:
Feature: exit statuses In order to specify expected exit statuses As a developer using Cucumber I want to use the "the exit status should be" step Scenario: exit status of 0 When I run "ruby -h" Then the exit status should be 0 Scenario: non-zero exit status When I run "ruby -e 'exit 56'" Then the exit status should be 56
Aruba provides the exit status step:
Then /^the exit status should be (\d+)$/ do |exit_status| @last_exit_status.should == exit_status.to_i end
To use Aruba just install the gem
sudo gem install aruba
and then require it in your
env.rb or any file under
Are you a Rubyist and want to play with Riak, the sweet new NoSQL distributed database we featured earlier? During our interview for upcoming Episode 0.1.4, Sean Cribbs gave us a scoop. Introducing Ripple, a hot new Ruby client for Riak.
An example from the README
require 'riak' # Create a client interface client = Riak::Client.new # Retrieve a bucket bucket = client.bucket("doc") # a Riak::Bucket # Get an object from the bucket object = bucket.get("index.html") # a Riak::RObject # Change the object's data and save object.data = "Hello, world!" object.store
Still want more Riak? Stay tuned. Episode 0.1.4 will rock!
After more than a year and over 4000 commits by 250 authors, the Rails 3 Beta is here! The Rails 3.0.0.beta gem is now live on Gemcutter:
sudo gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n sudo gem install rails --pre
After you have installed and configured
otp_kickoff … (see readme)
In your terminal, type:
otp_kickoff new_application --name=amazingapp
That will generate:
create amazingapp/src create amazingapp/ebin create amazingapp/deps create amazingapp/src/amazingapp_app.app create amazingapp/src/amazingapp_app.erl create amazingapp/src/amazingapp_sup.erl create amazingapp/src/amazingapp_server.erl create amazingapp/src/amazingapp_handler.erl create amazingapp/src/amazingapp.erl create amazingapp/src/amazingapp.hrl
You start a new project. You get all excited. You’re adding tests. You’re adding factories. You’re fixturating your setups. You’re adding more tests. Your tests start slowing down, but you need to keep pushing because your backlog has a lot of new, nifty features in it. You’ve got 3000+ lines of test code, 2000+ assertions. Your tests are annoyingly slow. Your tests have become a burden.
How Riot is different
Riot differs primarily in that it does not rerun setup for each test in a context. I know this is going to shock a lot of folks. However, over the past several years of my doing TDD in some capacity or another, there are certain habits I have tried to pick up on any many others I have tried to drop.
(content extracted from the project’s readme)
I made commits to riot and colorize today. Once there are new releases of both, riot will be promoted to my favorite Ruby testing library!