Ruby console alternative for IRB (Windows) - ruby

I am looking for some free light-weight GUI alternative for IRB console on windows. What I whould like to see:
Area to write a script (so I can edit, run, edit...)
Command line to play with current variables
Output window to see results
Intellisence
Breakpoints/debugging is a plus
Actually, some thing similar to powershell_ise.exe whould be great.
(source: microsoft.co.il)
P.S. I am not looking for IDE (NetBeans, Aptana, etc.)

How does SciTE fail? Kinda curious because it feels like what you are looking for if you are working from a file. Ctrl-F5 executes, etc.

Have a look at e-texteditor.
It isn't a full IDE, but it allows you to execute Ruby code, and either put the input inline, after a #=> comment, or into a new window.
You get some of what you want, not so much the debugger and console. But the run-inline thing helps out a bit there.
It is based on TextMate, which is just fantastic. But OS X only. Oh, and it costs money.

Related

How to script keyboard clicks in a browser on a mac

The title says it all. I'm trying to script keyboard clicks in the browser (preferably Chrome). It's simple, from the current page I want to tab through 5 elements, then click enter, then repeat.
Right now I'm using a trial of the mac App "Fake" but it seems overly complicated for what I'm trying to do. I'm new to Macs and having trouble figuring out the simplest way to accomplish this. Any suggestions?
I'd take a look at Sikuli. It has a lot of things in its favor:
Comes with a nice starter IDE (or, you can write scripts in your own editor)
You can write Sikuli scripts in Jython, which is nice if you already know (or want to learn) Python
There's a Java API too, should you want to use pure Java
Sikuli's ability to do fuzzy matching of screenshots can be surprisingly robust
Scripts can be run from the command line once you grow out of the IDE (or want to plug the scripts into a continuous integration system)

Ruby bring window to foreground

I am using Ruby 1.9.1p430 (2010-08-16 revision 28998) on MS Ws7 with MS Office 2010
I have launched a copy of Word from Ruby using WIN32OLE:
wd = WIN32OLE.new('Word.Application')
All works fine, I can manipulate my document as required.
However, the Word window is in the background and I would like to bring it to the foreground so that the user sees the window and can interact with it as necessary.
I have done some reading but cannot find a way to do this using Ruby.
Any help or pointers in the right direction greatly appreciated.
You are using
wd.visible = true
And it is still in the background?
Good luck :-)
Unfortunately, that sort of thing is both os specific, and not in the standard libs, so it is going to be tough. First thing is dig through the WIN32OLE docs a bit http://ruby-doc.org/stdlib/libdoc/win32ole/rdoc/index.html, but I don't think it will be there.
after that, I would poke around github a bit (although I wouldn't hold out too much hope).
After that, I would look at http://www.autoitscript.com/autoit3/index.shtml (or something like it), and see if I could use that or integrate with it somehow.
finally, I would look at how http://win32utils.rubyforge.org/ handles api wrapping, figure out the win32 api call you need, and then write a c extension wrapper for it.

Fast, Simple Programmer's Editor

Do any of you have any good links that you could share with me? I am looking for a FAST programmers editor that can open a file containing over 100, 000 lines of code really fast? i'm currently using notepad atm and its taking a good 8 seconds to open a file that is 29000 lines long :(
i would prefer something that is just like notepad.
and yes, i have tried everything that i've found on google and they all either have splash screens, or they are just too slow. i don't want to wait 8 seconds just to add a line or two. or just to check what number the last array is etc...
Have you had a look at Notepad++.
I use this editor extensively and have been very impressed thus far.
check out
Programmer's notepad
You could always try vi / vim
Have you tried Sublime Text? I just tried it with 100,000 line file where each line contained 'x' * 80, and it only took about a second.
Personally I use jed, which is a lightweight emacs clone, but it's probably not to everyone's taste. (In particular, it doesn't really feel like a Windows application - it doesn't have the normal keyboard shortcuts etc. Once you're used to it, it's very quick though...)
Textpad is what I've used for years. It's cheap, light-weight, yet very functional.
It does have a splash by default, however, that can be disabled in the options.
I just ran a test of the Zeus programmer's editor and it loaded a 100,000 line C/C++ file in less than a second.
Cream. It's Vim, but with sane keyboard bindings.
TextMate if you use Mac
I am wondering why no one hasn't mentioned SciTE yet... its one of the best code editors, with source code coloring support (don't know if that's the correct term for it), and lots other features...
you can also try Notepad2, such as good replacement for notepad itself, extending it to be good enough as a code/simple programmer's editor...
Nobody mentioned Emacs yet?
I use it on the PC i'm on now without trouble (and the beast has 256Megs of RAM..)
In the linux world GEdit and Kate fits most needs.
Notepad++ has code coloring for almost every language.
Dreamweaver is great to use purely as a text editor/FTP tool if you're doing web stuff.

Programming a terminal emulator, what's in it?

This is related somewhat to this question about a better shell terminal/gui-interface for cmd.exe
In my quest to find a better shell terminal, the only useful thing I came across was Console2, other alternatives weren't free and generally didn't offer much more than Console2 to make them worth their price.
I can't help but wonder, "how come"? The shell terminal is a very valuable tool to a programmer, yet no one came around to try and do a better job than cmd.exe (except for the guys # console2)??
Surely designing a command line shell terminal emulator can't be such a hard task!
Has anyone tried writing a shell terminal emulator before? What's in it? Any resources out there (say, if I want to program my own shell)?
UPDATE
17/07/2009
I rephrased the question, what I was referring to as a "shell" is actually called a terminal emulator (at least in the linux world). I only realized this recently so I thought I should revisit this question and fix it.
There are plenty of shells around for Windows, bash under Cygwin is the one I use the most, and it's certainly free. I have to be honest here, cmd.exe has come a long way since the batch file processor of MSDOS. It's actually quite powerful, but still not a pimple on the rear end of bash :-).
You should try to write a command line shell, it will be an education for you. It's not that hard to do the basics if all you want is a program launcher.
But, if you want all the power of a real shell, including a full blown programming language, job control, piping, output redirection and (seriously) too many other things to list, we probably won't be hearing from you for a while. Except when you pop up your head to ask us esoteric questions about how shells should do this or that.
What about PowerShell from Microsoft? AFAIK it's free, and gives you C# power right in the shell, and tons of other features. But, it DOES require the NET Framework...
I won't endorse it yet, as I haven't really used it, but it's on my list to do...
My bets are on Powershell for the future if you are a Windows guy.
PowerShell will be installed by default on Windows Server 08 R2 (WS08R2) and Windows 7 according to MS.
I have used Powershell myself and found it to be very useful, and if you are familiar with .NET then its all the more easier.
Download a two page reference document here, this is all you will need to get started.
I mean the gui-interface part that displays the text,
Ah! you mean what we call a "pseudo-tty" or a "terminal emulator" in unix. In windows, I guess it is called a "console host". I do not use windows, but I heard that console2 is very good.
Seems there are others:
http://www.powershellanalyzer.com/
http://powershellide.com/
http://www.codeplex.com/PoshConsole
and, of course, for real programmers, you have the shell mode of (x)emacs :-)
Erm... what about all the ports of Unix command shells to Windows?
Just go with cygwin and log on using PuTTY. So much better than the standard console. :)
Also, Python (or perl for that matter) can replace the shell entirely.
You might want to try Take Command Console, formerly 4NT, formerly 4DOS.
Quick summary of points you might care about:
Command line editing with filename completion, history, and cut & paste
Integrate PERL, Ruby, REXX, Python, and any Active Scripting language
Fast - 20-200% faster output display than the standard Windows console
Integrated file explorer - examine directories, drag and drop files
Upwardly compatible with CMD.EXE with literally thousands of additions
Not free (except trial version) and not open source. I haven't tried it myself, but I was a 4DOS junkie back in the day, before Cygwin.
If you need handy terminal - give a try to ConEmu (I'm the author). It is a Windows console window enhancement (local terminal emulator), which presents multiple consoles and simple GUI applications as one customizable tabbed GUI window with dozens of features.
Another answer and comments

Where can I find a graphical command shell?

Terminals and shells are very powerful but can be complicated to learn, especially to get the best out of them. Does anyone know of a more GUI based command shell that helps a user or displays answers in a more friendly way? I'm aware of IPython, but even the syntax of that is somewhat convoluted, although it's a step in the right direction.
Further to this, results could be presented graphically, e.g. wouldn't it be nice to be able to pipe file sizes into a pie chart?
Hotwire is an attempt to combine the power of the traditional command line interface with GUI elements. So it has a GUI side, and tries to be helpful in suggesting commands, and in showing you possible matches from your history. (While there are keyboard shortcuts to do this in bash and other shells, you have to know them ...)
You can use all your common system commands, but a number of key ones have new versions by default which use an object pipeline, and are displayed with a nice GUI view. In particular ls (aka dir) shows lists files and shows them in columns. You can sort by clicking on the column headers, double click on files to open, or double click on directories to move to that directory. The proc command allows you to right click on a process and one of the options is to kill it.
The object pipeline works in a similar way to Microsoft Powershell, allowing commands in the pipe to access object properties directly rather than having to do text processing to extract it.
Hotwire is cross platform (Linux, BSD, Windows, Mac), though it is at an early stage of development. To learn more, install (click on the link for your platform) and work through the simple getting started page.
If you don't like hotwire, you could also look at the list of related projects and ideas maintained on the hotwire wiki.
fish is a Unix shell that focuses on user-friendliness, such as by providing colored highlighting and extensive tab completion.
For a different kind of blend of textual and graphical interface, there's Quicksilver, as well as similar/inspired tools like Launchy, GNOME Do and ENSO.
Is this for Python in particular, or are you just interested in any command shell that has a GUI interface?
If the idea of piping file sizes into a pie chart interests you, you might try PowerGUI, a GUI layer on Microsoft's PowerShell command shell. PowerShell also lets you pipe data from commands into XML, CSV, and other formats that are understood by GUI programs.
GUI-based command shell seems like an oxymoron to me.
Not really? A command shell is just an encapsulated environment in which to execute commands. Why can't they have GUI extensions? We are in the 21st century! :)
Check out http://hotwire-shell.org/
This is along the lines of what I was thinking. It's a shame it uses PyGTK, I'd have preferred PyQT (perhaps a licensing issue?). There look to be some interesting related links from the project as well.
If the idea of piping file sizes into a pie chart interests you, you might try PowerGUI, a GUI layer on [...]
PowerGUI looks like a hobby project I've been working on that organises regularly used tasks. It looks like it organises frequent jobs and formats the output for you. The formatting I see as the end result of the data flow. But it would be nice to be able to tinker with data and then continue to use it.
PowerShell as a command shell is very forgiving for new users and is easy to learn. There is an add-on product (it is a commercial product) called PowerGadgets that would let you pipe file sizes into a pie chart or other types of displays
PowerGadgets looks very interesting. It would be interesting to have things like system monitors so that you could say, read the CPU usage per second and pipe it into a graph.
Is this for Python in particular, or are you just interested in any command shell that has a GUI interface?
Any really, currently, but I like the idea of cross platform, easy to edit, no compiler setup. I use Windows at work and Windows/Linux (Ubuntu)/OSX at home. Python is just an easy solution, and for writing stuff like this is has a lot of libraries already.
Thanks for all the links. Keep them coming. :)
I'm not sure whether you're asking for a shell as in bash/csh, or a shell as in ipython. If it's the later, then I'd recommend looking at Reinteract. While it's still very alpha, it's already a great tool for rapid prototyping in python, and allows embedding of plots, widgets, etc.
GUI-based command shell seems like an oxymoron to me.
The key-word here is Graphical.
If I want a GUI, I want a full-featured GUI. But if I want raw performance, I want a command line.
I'm not exactly sure what you're asking for. You can either have a GUI or a command line. What do you need from a graphical command shell that you couldn't get from a straight GUI?
Also, if you want graphical information about file sizes there are a few applications that do that. One example is WinDirStat.
Also not related to Python, but Ubiquity (a firefox extension) is a graphical command-line-like tool for the web, with a similar spirit to Quicksilver/Launchy/GnomeDo.
I know that Automator in Mac OS X is not a shell but it is the best graphical tool I have ever used to do batch tasks. I think it is worth mentioning here as even I (self-titled as a power user) use it from time to time to rename files or other routines. Although these could be done in a few lines of shell script, the Automator's graphical interface makes me feel like I am not working and it just works.
Check out http://hotwire-shell.org/
PowerShell V2 is developing a graphical command shell, but I don't think that is what you are looking for.
PowerShell as a command shell is very forgiving for new users and is easy to learn. There is an add-on product (it is a commercial product) called PowerGadgets that would let you pipe file sizes into a pie chart or other types of displays. Information about that can be found here.
As for ease of use, PowerShell command follow a Verb-Noun pattern (along with aliases for ease of use from the command line) and is very discoverable. Check out some screencasts I did on using PowerShell at PowerShell Basics.
I found POSH, a GUI for MS PowerShell. This is pretty much what I intended. You have a command-line backend with a WPF GUI frontend. You can pipe results from command to the next and show graphical output.
Maxima provides a mathematical shell (screens) . It is nice that you type in a C-like syntax and receive graphically formatted output.

Resources