Windows Client/Linux Server IDE for Ruby?

I presently use ssh & vi to program in ruby/rails, typically from a
remote location on my WinXPpro laptop to a CentOS-4.3 Linux development
box. I have not in the past used any IDE for anything more than casual
testing of the software itself. However, having recently viewed the
QT.mov on Rails Migrations I found myself desiring the inline ruby/rails
code completion facility displayed by the editor used in that video.
However, I need to be able to run the editor locally on an XPpro but
work on files and projects stored remotely on a Linux machine.

Does software exist that provides this functionality for Ruby/Rails? If
so, what is it called and where do I get it? Or, can the inline code
completion facility be added to vi(m)?

Regards,
Jim

James B. [email protected] writes:

However, I need to be able to run the editor locally on an XPpro but
work on files and projects stored remotely on a Linux machine.

I believe Emacs with Tramp will give you that capability, if vi hasn’t
poisoned your mind against Emacs. =) Tramp allows you to edit files
over SFTP transparently.

For Ruby-specific coding, be sure to grab ruby-mode, which comes with
the standard Ruby distribution, I think. You can set up some pretty
nifty code completion using the snippets.el library[1].

For Rails-specific coding, you can try rails.el[2] for a “large and in
charge” environment (lots of features, kind of chaotic IMHO) or
arorem.el[3] for a more focused, minimalist approach.

RI for Emacs[4] is also really handy for documentation lookup. If you
generate ri docs for all your installed gems (as mentioned in a
previous thread) you can also use this for Rails and other gem
libraries.

The great thing about this setup is that it’s all cross-platform, you
can use it in your current situation, but you can stick with it if you
migrate to GNU/Linux or a Mac.

-Phil H.

[1] - http://cryptocracy.hh.org/~cartel/elisp/snippet.el
[2] - http://rubyforge.org/projects/emacs-rails/
[3] - http://dev.technomancy.us/phil/wiki/arorem
[4] - http://rubyforge.org/projects/ri-emacs/

(If you can’t find any of the files mentioned above, all of them
except rails.el are in my dotfiles archive:
http://dev.technomancy.us/phil/browser/dotfiles/.emacs.d)

James B. wrote:

I presently use ssh & vi to program in ruby/rails, typically from a
remote location on my WinXPpro laptop to a CentOS-4.3 Linux development
box. I have not in the past used any IDE for anything more than casual
testing of the software itself. However, having recently viewed the
QT.mov on Rails Migrations I found myself desiring the inline ruby/rails
code completion facility displayed by the editor used in that video.
However, I need to be able to run the editor locally on an XPpro but
work on files and projects stored remotely on a Linux machine.

Can you mount the remote directory as a local drive (by whatever that
mechanism is that Win2K/WinXP offers), and have the editor treat the
files as if they were local?


James B.

http://www.ruby-doc.org - Ruby Help & Documentation
Ruby Code & Style - The Journal By & For Rubyists
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://yourelevatorpitch.com - Finding Business Focus

Textmate. Have you seen this product for vi(m):

http://blog.hasno.info/blog/segfault/dev/2006/04/10/vim-7-ruby-omni-completion.html

There’s been a big thread on it the past couple of days.

Michael

Phil H. wrote:

James B. [email protected] writes:

I believe Emacs with Tramp will give you that capability, if vi hasn’t
poisoned your mind against Emacs. =) Tramp allows you to edit files
over SFTP transparently.

Having started with TECO (the pre-cambrian forebearer of EMACS) on a
VT-52 and later graduating to EDI and then EDT on VT-100s, my mind was
poisoned long before I ran into vi(m). That said, I am loath to learn
yet another editor unless I have a strong motive. Hoowever, inline
completion of API methods is a compelling argument to change if
necessary. I take it that there is no possiblity of obtaining this
functionality for Ruby/Rails in vim?

Do you happen to know what editor and options DHH was using when he did
the Migrations video tutorial?

Regards,
Jim

On 4/20/06, James B. [email protected] wrote:

Phil H. wrote:
[snip]
That said, I am loath to learn
yet another editor unless I have a strong motive. Hoowever, inline
completion of API methods is a compelling argument to change if
necessary. I take it that there is no possiblity of obtaining this
functionality for Ruby/Rails in vim?

There is no funky autocompletion in textmate, afaik, beyond completion
from open files, which vim already does. What you are seing in the
video are textmate snippets and there are at least two attempts to get
similar functionality in vim:

I use XP and I had snippetMaginc working at some point and it’s quite
decent. The snippets were actually converted to yaml form the textmate
repository.

As for editing files remotely, vim is supposed to be able to do it but
I had some problems.
At first, netrw was trying to quote something using single quotes, had
to change that to double quotes.
file, netrw, changed line 545 to:
exe g:netrw_silentxfer.“!”.g:netrw_scp_cmd.useport."
“”“.g:netrw_machine.”:“.escape(b:netrw_fname,’ ?&').”“” ".tmpfile

Then, I was able to open a remote file like this:
:let g:netrw_scp_cmd = “pscp -q” (that’s pscp from putty in my PATH)
:e scp://[username]@[host]/[/path/to/file]

Unfortunately, saving the file back doesn’t work and I gave up after
trying to debug it for a while.
In case anyone wants to try to make this final step work, the error is
produced by line 797 in netrw.vim:
echohl Error | echo “netrw your
“.substitute(tmpfile,‘[^/]+$’,‘’,‘e’).” directory is missing!”

It complains that it can’t find the temp directory but it seems to
ignore the _vimrc setting for it.

This probably has a simple fix. However, I’m quite tired and can’t be
bothered to track this down right now. But please post the solution if
you can make it work.

btw:
:version
VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 3, compiled Mar 4 2006
09:40:47)
MS-Windows 32 bit GUI version with OLE support
Compiled by [email protected]

Regards,
Jim

Happy huntin’

James B. [email protected] writes:

Having started with TECO (the pre-cambrian forebearer of EMACS) on a
VT-52 and later graduating to EDI and then EDT on VT-100s, my mind was
poisoned long before I ran into vi(m). That said, I am loath to learn
yet another editor unless I have a strong motive.

Just think of it as an excuse to learn more Lisp! (That’s a great
motive for me, but I guess not everyone is as crazy as I am. I do find
it quite rewarding, though, and you can’t beat the flexibility.)

However, inline completion of API methods is a compelling argument
to change if necessary. I take it that there is no possiblity of
obtaining this functionality for Ruby/Rails in vim?

I don’t think the autocomplete is what vim is lacking but rather the
transparent sftp editing. You may be able to add that functionality; I
haven’t really looked into it.

-Phil

Phil H. wrote:

Just think of it as an excuse to learn more Lisp! (That’s a great
motive for me, but I guess not everyone is as crazy as I am. I do find
it quite rewarding, though, and you can’t beat the flexibility.)

I choose not to comtemplate that possiblity. I am sure that you
understand.

I don’t think the autocomplete is what vim is lacking but rather the
transparent sftp editing. You may be able to add that functionality; I
haven’t really looked into it.

I just built vim70e and I am waiting for the next releasae of the
vim-ruby gem, due out today, which is supposed to contain the ruby/rails
autocomplete vim add-in. I will see about sftp later. For now, if
vim70 will auto-complete ruby/rails api calls then working on the host
over ssh is no hardship.

I suppose that I will probably find that satisfying this desire proves
far less usful than I imagined. I have found that the essental Ruby and
Rails APIs are far easier to keep in mind than many of the other
languagues I have had to deal with. But I sometimes find that
auto-complete functions reveal calls that are new to me and, given the
recent spate of updates to Rails, such clues might prove useful.

Jim

I use Notepad2 or jEdit from WinSCP.