The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Yet Another Handy Ruby-on-Windows Script

1 reply on 1 page. Most recent reply: Sep 22, 2006 3:30 PM by John Suykerbuyk

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
James Britt

Posts: 1319
Nickname: jamesbritt
Registered: Apr, 2003

James Britt is a principal in 30 Second Rule, and runs ruby-doc.org and rubyxml.com
Yet Another Handy Ruby-on-Windows Script Posted: Sep 18, 2005 8:56 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by James Britt.
Original Post: Yet Another Handy Ruby-on-Windows Script
Feed Title: James Britt: Ruby Development
Feed URL: http://feeds.feedburner.com/JamesBritt-Home
Feed Description: James Britt: Playing with better toys
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by James Britt
Latest Posts From James Britt: Ruby Development

Advertisement

I do most of my Ruby development on Windows. But most of my time is spent in either gvim or the command line.

When I work on an application, I typically have at least two cmd shells running. One is for the main code directory, and one is for running ICE WATIR, my test-script-server WATIR add-on, which is extremely handy for running tests against a Web application.

It's easy enough to open up these windows by hand (provided you've told File Explorer how to do "Open Command Window Here" form the context menu). But tedious if you find yourself doing it over and over.

So the root dir of each application source tree now tends to have a Ruby file with code like this:

[
  'start "The App Name" cd rails',
  'start "Test" cd rails\test\ice_watir'
].each do |c|
  Thread.new( c ) { |cc| puts `#{cc}`}  

end

Each line of the array is a command to start a new shell with a given title, executing a given command ('cd someplace', in this case).

I also make a point of changing the background and text colors of the cmd windows, and tell the shell to use those colors whenever the given window title is used. This way I can quickly tell the shells apart without having to read the window title.

When I go to work on a project, I run the script and start up the needed shells, all nicely titled and colored, each starting in the proper directory.

Oh, one more handy script: You can start an instance of File Explorer for the current directory by running this:

start explorer .,/e

That trailing ,/e tells Explorer to use a two-paneled tree view.

That's too much to type on a regular basis, so I have a batch file for this, named e.bat, someplace in my PATH.

I can now simply run e to pop open a Explorer window.

For doing the same for arbitrary directories, I use a batch file with this:

start explorer %1 ,/e

I have this in ee.bat, so I can run, for example

ee c:\ruby

to go spelunking into the main Ruby files.

Read: Yet Another Handy Ruby-on-Windows Script


John Suykerbuyk

Posts: 1
Nickname: syke
Registered: Sep, 2006

Re: Yet Another Handy Ruby-on-Windows Script Posted: Sep 22, 2006 3:30 PM
Reply to this message Reply
To elimnate the need for both an "e" and an "ee" batch file (where ee expects a path to open the explorer in), use this single batch file instead:

set param=%1
if !%1==! set param=.
start explorer %param%,/e

John Suykerbuyk

Flat View: This topic has 1 reply on 1 page
Topic: Python 2.5 is fast! Previous Topic   Next Topic Topic: Controlling Rails Process Size

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use