Wednesday, November 14, 2012

Things I have learned today

I started today trying to get tab completion working in jruby / irb / windows 7. That happens to be one of the things that I did not learn today. If you figure it out or know how feel free to respond on SO: http://stackoverflow.com/questions/13381560/how-to-enable-irb-tab-completion-in-jruby - I'm really starting to think that it's a jRuby 1.7 problem. Maybe sometime I'll have the opportunity to install 1.6.8 and see if it works there.

Anyway, today has been spent trying to make IRB more usable. I've used IRB for little code tests here and there, but I think that it's a great tool for the toolbox, and I'd really like to get more use out of it. So I tried to make it fit my development style better, and thus the tab completion. (I've found the IRB tab completion VERY handy when you don't have docs around; i.e. when I'm offline)

In trying to fix the tab completion I've installed a whole host of things to make stuff better.


Ansicon - I tried this when I first started playing with jRuby. Once I had it installed, it crashed every single thing I tried to run in the console. I couldn't ping google - it was that bad. Eventually I figured out how to remove it, but today I put it back. I haven't run the installer on the thing (burn me twice, shame on me) but have been running it from the console just as a regular application.

That helped me figure out why it was crashing - apparently there's some nvidia dll that really doesn't like the ansicon hooks. Way down at the bottom of this bug report is how to fix it. I also had a problem running the x64 ansicon - it would run fine in the regular console but it caused powershell to go boom. Maybe powershell is only 32-bit even on a x64 install? I ended up using the 32-bit version of ansicon and it stopped crashing, so that does kinda make sense.

Powershell - started using PS when the regular windows console started crashing. The biggest plus as far as I'm concerned is the ability to use "ls" and "cd ~". For some reason, I also prefer the extra space it puts after the command prompt.  I hate its four-line error messages though.

Console2 - just started playing with it today, but I'm sold already. It allowed me to hook ansicon to powershell without having to hack the crap out of windows. Plus it has all of its settings modifiable. I reset CTRL-V to be paste, since that's one of my biggest peeves with the console.

Irbtools - this has a ton of useful stuff in it, and it's a little overwhelming, but I've found a couple uses for it already. I had to tweak it to get it where I like it, but like almost everything in ruby, tweaking is pretty easy. I've been using awesome_print for a while, but that's just one of the cool things it has. "ls" and "cd" are very handy, and I like the possibilities of CodeRay.

Pry - this would be better if it worked with ansicon. The killer feature here is the ability to start a console session while in the middle of an application - now that's cool. That seems like a great thing to have while trying to debug. I'll have to play around with it - see if it works during an rspec test, etc.

One other thing I've learned in the past, if not strictly today, is that it's best (at least on Windows) to run the x86 version of Java. Programs have a tendency not to detect the 64-bit version, among other things. The safest route is to run the 32-bit version unless you know you need the extra address space.

This post is mostly for my own benefit, but maybe it'll help someone else. If you've got any cool irb / windows shell tools, feel free to toss a comment in.

No comments:

Post a Comment