While working on a sinatra app recently, I noticed that sinatra has no rails equivalent to rails console. So here’s tux , dressing your sinatra app in a console. Install and Try On $ gem install tux In the directory of your sinatra app, try on tux: $ tux # If app's rack config file isn't config.ru, specify it with -c $ tux -c app.ru # ruby options like -I and -r are available to tux $ tux -h…
So ruby 1.9.2 is the future and your still stuck on 1.8 at work. Why? It’s a pain … Well, let’s change that. Introducing one9 – a gem to find 1.9 method changes and make the upgrade process smoother. Install No surprises here. gem install one9 Well almost. If you’re using bundler (the default in rails3), add one9 to your Gemfile if your tests are invoked by bundler i.e. one9 test, one9 test rake *…
Since it’s last release , bond has gained a number of features. The most novel of these is the ability to generate gem-specific autocompletions from a gem’s yard documentation . This release also lets gems ship with their own irb autocompletions and introduces bond to emacs’ inf-ruby mode . Yard-Based Irb Autocompletions Update: Yard functionality has been moved to bond-yard . This feature…
Bond , a gem to improve irb’s autocompletion, just hit version 0.2.0 . With this version comes a completion configuration system similar to bash/zsh, more fixes to irb’s incorrect completions and most importantly, any method can have its arguments autocompleted! The screencast demonstrates most of this. Screencast Bond – Argument Autocompletion for Methods in Irb from cldwalker . Screencast Notes…
The previous post explained what lightning does. This post explains how you, the user, can use and customize lightning to speed up your commandline experience. Overview Default Functions Create and Delete Functions Aliases Creating Your Own Bolt Generating Bolts Miscellaneous Default Functions After having installed lightning : # We'll use these aliases throughout this post $ alias lg=lightning $…
Introducing lightning , a commandline framework that could revolutionize how fast you are on the commandline. Lightning lets you easily define and generate shell functions which autocomplete and interpret paths (files and directories) by their basenames. With these functions you don’t have to ever type the full path to any file for any command again. Overview Intro Install Lightning Bolts…
Almost a year ago , hirb started as an itch to get mysql-like tables for Rails’ ActiveRecord models. Now, hirb 0.3.0 provides table views for ten additional database gems. Whether you use hirb with couch, mongo, riak or any of the databases supported by sequel or datamapper , hirb essentially turns irb into a database-agnostic database shell. Database Gems Here are the list of additional database…
If you’re familiar with hirb , you know it’s good at displaying objects as tables . Hirb’s latest release takes a table’s usefulness a step further by turning them into two-dimensional menus, menus that can pick values from any table cell. Boson , in turn, provides these menus to any of its commands with a flick of the switch. Intro Hirb’s menus can be traditional one-dimensional menus . But what…
Gemcutter recently added a sweet search call to its API . With gemcutter’s API and boson , we’ll see how to search gems, get a gem’s information and compare multiple gems on the commandline. Also, I’ll explain how some of this was done so you’re able to make commands for any API . If you’re more interested in how this library is built, skip to here . To use this boson library: $ gem install boson…
First off, Happy New Year! Now back to our regularly scheduled program. Being the console-efficient prick I am, let’s look at a method_missing that let’s us type less where underscored methods are involved. This means that instead of typing some_really_long_ass_method we can type the shortcut method s_r_l_a_s . Instant aliasing! As you can see this works by typing the beginning letter of each word…
With the latest release of Boson , there are a slew of new features that need some explaining. Yes, there is a changelog and documentation , but some of these features are novel enough that a good intro is in order. Overview Here’s an overview of features: Command Options Pipe Options Query Option Libraries Local Libraries Directory-Spaced Libraries Social Libraries Plugin Libraries Invoking…
Continuing where this post left off, we’ll look at more examples of the unique command and view framework interaction that Boson and Hirb have. In particular, we’ll look at commands that are useful references to your current Ruby environment. Since Boson’s commands are just methods in a module, any of these commands work fine in irb without Boson . Game Plan We’ll be looking at my ruby_ref library…
In previous posts , Boson was introduced as a command framework, usable from the commandline and irb. In this post, we’ll focus on how Boson enhances irb by treating methods like shell commands. Preface If you’re an avid irb user like me , your ~/.irbrc is littered with methods. These methods are sometimes favorite tweaks to Ruby’s core libraries and sometimes interfaces to gems. But regardless of…
In the last post , I introduced Boson and its options for commands . What I didn’t mention was that Boson also gives those commands default options. Among them are ones to control rendering a command’s output with Hirb and even toggle rendering. At the flick of a switch, Boson commands (Ruby methods) can have Hirb’s views. Hirb’s Handy Tables Back in an old post , I concluded with a mention that…
Introducing Boson , a command/task framework that could change how you collect and execute your ruby code. Sure, there’s rake , thor and a dozen other gems. But how many will let you create a universe of ruby commands you can run from the commandline and irb? Spinning On Feel free to follow Boson on the Hub and to install it: $ gem install boson boson-more $ echo "require 'boson/more'" >>…