are there any ruby IDEs?

R

Ryan Paul

I use vim most of the time, but i'm curious if there are any
ruby specific IDEs, or any graphical debuggers. Additionally, if any of
you folks have any good vim/ruby tricks to share, i'd love to hear them.
I'm currently compiling vim with ruby and python embedded. (I plan on
porting my vim extension scripts from python to ruby when I get a chance)

--SegPhault
 
S

Stephan Kämper

Ryan said:
I use vim most of the time, but i'm curious if there are any
ruby specific IDEs, or any graphical debuggers. Additionally, if any of
you folks have any good vim/ruby tricks to share, i'd love to hear them.
I'm currently compiling vim with ruby and python embedded. (I plan on
porting my vim extension scripts from python to ruby when I get a chance)

--SegPhault

There's FreeRIDE ( http://rubyforge.org/projects/freeride/ ) and
Mondrian (currently in beta test) ( http://www.mondrian-ide.com/ ).

Happy rubying

Stephan
 
S

Sascha Ebach

Hi,
I use vim most of the time, but i'm curious if there are any
ruby specific IDEs, or any graphical debuggers. Additionally, if any of
you folks have any good vim/ruby tricks to share, i'd love to hear them.
I'm currently compiling vim with ruby and python embedded. (I plan on
porting my vim extension scripts from python to ruby when I get a chance)

Have a look at the beta of Arachno Ruby IDE at www.scriptolutions.com. I
have been using it for a couple of weeks and I must say it has a _very_
impressive feature set for an early version. I found that you can
already work pretty well with it. Also Lothar Scholz, the creator, is a
list regular here. At the moment he is on vacation but should be back
in a couple of weeks.

Hey, wait a moment, I don't get anything for this ;)

Yours
 
G

Gavin Sinclair

I use vim most of the time, but i'm curious if there are any
ruby specific IDEs, or any graphical debuggers. Additionally, if any of
you folks have any good vim/ruby tricks to share, i'd love to hear them.
I'm currently compiling vim with ruby and python embedded. (I plan on
porting my vim extension scripts from python to ruby when I get a chance)

See http://vim-ruby.rubyforge.org.

The released files are quit out of date (/me smacks himself), so grab
a CVS tarball. It'll all be sorted out when Vim 6.3 arrives.

And please share your Python vim extension scripts. I'm eager to see
what they do.

Cheers,
Gavin
 
R

Ryan Paul

See http://vim-ruby.rubyforge.org.

The released files are quit out of date (/me smacks himself), so grab
a CVS tarball. It'll all be sorted out when Vim 6.3 arrives.

And please share your Python vim extension scripts. I'm eager to see
what they do.

Cheers,
Gavin

Most of this is pretty grotesque, but it works relatively well. I wanted
to come up with a way to make redirect stdout so that print would send
content to a scratch buffer. I set it up so that I could assign an
execution command to filetypes using autocmd. It executes that command on
the content, and then puts the output in the scratch buffer. if the
scratch buffer doesnt exist yet, it creates it. The way it finds the
scratch buffer is really kludgy, but I couldnt think of a better way.
The 'PyValOut' function is kind of neat. It takes the selected content in
the current buffer and evaluates it through the embedded interpreter and
dumps the content to the scratch buffer. I use this instead of interactive
mode a lot of the time. I use this stuff regularly for several languages
including ruby.

My CamlComment function is kind of funky, it puts ocaml comments around
the text of the current line, respecting starting whitespace. The
CamlRunAct function is a quick and dirty shortcut I use to control whether
I want the file to be run through the ocaml interpreter, or the compiler,
or something else entirely. I'll probably port all this to ruby as soon as
I get ruby/vim working, and figure out how to redirect stdout.


"""""" SegPhault's .vimrc

""" Python Stuff
python << EOF
from vim import *
import sys,commands

def first(c,l):
for x in l:
if c(x): return x

txtsplit = '-'*20
CB = lambda: current.buffer
io = sys.stdout,sys.stderr
getBuf = lambda x:first(x,buffers)
pybuf = lambda x:x[0].startswith('Program Output')
prepend = lambda l,t: l[:len(l)-len(l.lstrip())] + t + l.lstrip()

def rep(t,l):
for x in l.items():
t = t.replace(x[0],x[1])
return t

def getSel(l1,l2):
return '\n'.join(current.buffer.range(int(l1),int(l2))[:])+'\n'

class vBuf:
def __init__(s,b=None):
s.buf = b and b or getBuf(pybuf)
if not s.buf:
command(':bel new')
command(':set bt=nofile')
s.buf = current.buffer
s.clear()

def write(s,t):
if '\n' in t: map(s.buf.append,t.split('\n'))
else: s.buf[-1]+=t

def clear(s):
s.buf[:] = None
s.buf[-1] = 'Program Output Buffer'
s.buf.append('-'*20)
s.buf.append('')

def redirbuf(b=None):sys.stdout = sys.stderr = vBuf(b)
def resetbuf():sys.stdout,sys.stderr = io

def PyValOut(r):
redirbuf()
exec(r)
print txtsplit
resetbuf()

def PyExOut(r):
redirbuf()
print commands.getstatusoutput(r)[1]
print txtsplit
resetbuf()

def FileDir(x): return '/'.join(x.split('/')[:-1])
def ToFileDir(): command('lcd '+FileDir(current.buffer.name))

EOF

"""" General Stuff
let mapleader = ","
map <Leader>s :source %<cr>
map <leader>b :MiniBufExplorer<cr>
imap <C-S> <Esc>:w<cr>a
imap <C-D> <C-R>=strftime("%x")<cr>
imap <M-;> <Esc>
imap <C-L> <Esc>$a<Return>
imap <C-E> <Esc>,c:w<cr>,,a
command! ToFileDir py ToFileDir()

"""" C Stuff
map <Leader>mc :source /usr/share/vim/vim62/extraPlugins/c.vim<cr>:syntax on<cr>
map <Leader>ind :%!indent<cr>

"""" Python Stuff
command! -range Pval py PyValOut(getSel(<f-line1>,<f-line2>))
map <leader>c :py vBuf().clear()<cr>
autocmd BufEnter *.py map <Leader>, :py PyExOut('python '
+current.buffer.name)<cr>

"""" XML Stuff
autocmd BufEnter *.xsl map <Leader>. :py curxsldoc = current.buffer.name<cr>
autocmd BufEnter *.xml map <Leader>, :py PyExOut('xsltproc %s
%s'%(curxsldoc,current.buffer.name))<cr>

"""" Ocaml Stuff
python << EOF
def camlComment():
l = current.line
current.line = l.strip().startswith('(*')\
and rep(l,{'(* ':'',' *)':''})\
or prepend(l,'(* ') + ' *)'

def camlRunAct():
return CB()[0].startswith('(* Build:')\
and CB()[0][CB()[0].find(':')+2:].replace('%',CB().name)\
or 'ocaml %s'%CB().name
EOF

autocmd BufEnter *.ml map <Leader>, :py PyExOut(camlRunAct())<cr>
autocmd BufEnter *.ml imap <C-C> (* *)<Esc>hhi
autocmd BufEnter *.ml map <C-C> :py camlComment()<cr>

""" Makefile Stuff
autocmd BufEnter Makefile map <Leader>, :py PyExOut('make exec')<cr>
autocmd BufEnter Makefile map <Leader>. :py PyExOut('make clean')<cr>

""" Ruby Stuff
autocmd BufEnter *.rb map <Leader>, :py PyExOut('ruby '+current.buffer.name)<cr>

""" colorscheme
command! FoldDarkBG :highlight Folded guifg=purple guibg=black
 
G

gabriele renzi

I use vim most of the time, but i'm curious if there are any
ruby specific IDEs, or any graphical debuggers. Additionally, if any of
you folks have any good vim/ruby tricks to share, i'd love to hear them.
I'm currently compiling vim with ruby and python embedded. (I plan on
porting my vim extension scripts from python to ruby when I get a chance)

some more stuff:
ruby development tool is an eclipse plugin
ORE and rubydevelop are gnome/gtk based editors
RDE and rubywin are win32 based editors

RDT, RDE and rubywin (IIRC) have an integrated debugger.
 
D

Dave Burt

I did a bit of a look-around for an answer to this question a while ago, and
I have a couple of questions for the Ruby folk:

1) Who does RDE, and is development still active? (I like the RHS coloured
pixel-per-char overview =)) (...though I suppose it's destined to die, being
Pascal- not Ruby-based)

2) Has there been any new since 2002 about ActiveState Visual Ruby (or
ActiveRuby)?
See:
http://www.activestate.com/Corporate/Copyright.html
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/50745

3) What are people's preferred IDEs?
 
G

gabriele renzi

il Thu, 13 May 2004 10:15:29 +0200, "E.-R. Bruecklmeier"
very impressive! After installation it just keeps crashing ... :-(

send a pr about it. It is stable on my winxp box
 
E

E.-R. Bruecklmeier

gabriele renzi schrieb:



send a pr about it. It is stable on my winxp box

Win98/SE Just after the Start:

Cannot find import; DLL may be missing, corrupt, or wrong version
File "efox_microsoft.dll", error 31

That's it!


Eric.
 
S

Sascha Ebach

Hi Eric,
Win98/SE Just after the Start:

Cannot find import; DLL may be missing, corrupt, or wrong version
File "efox_microsoft.dll", error 31

That's it!

Keep in mind that it is a very early test version so this is expected.
It has crashed on me a couple of times too. But most of the times it
runs beautifully.

Win98 doesn't seem like the best of all platforms for using Ruby anyway.
Give the author a break to come back from his holidays. Judging from the
mission statement on his website he will fix such issues.

Yours
 
K

Kevin Proctor

send a pr about it. It is stable on my winxp box
Win98/SE Just after the Start:

Cannot find import; DLL may be missing, corrupt, or wrong version
File "efox_microsoft.dll", error 31
Eric.

Same situation here. I'm also running Win98SE and receive the same error
dialog. The DLL is present in the applications folder 'C:\Util\Arachno
Ruby IDE' however. I *was* going to play around and see if it was a
Win98 issue (try it on another machine) or an installer issue (perhaps
it incorrectly assumes a default directory) but them I got distracted
until this thread. I can wait til Lothar's vacation is over to bother
him though. :)

Kevin
 
S

Stephan Kämper

Friedrich said:
You recommend FreeRIDE?

Would I? Good question indeed. I would prefer to use some Open Source
stuff, but would pay for a really great solution which supports the OSes
I use (which are Linuxoides and WinXP currently).
But actually I'm using TextPad most of the time for most of the things...
I would prefer ArachnoRuby, at least it did not crash on ever
occasion.

Now, if you prefer something anyway, I'd recommend to use what you
prefer, since you'll likely use that anyway. :)

Happy rubying

Stephan
 
K

Kristof Bastiaensen

Would I? Good question indeed. I would prefer to use some Open Source
stuff, but would pay for a really great solution which supports the OSes
I use (which are Linuxoides and WinXP currently).
But actually I'm using TextPad most of the time for most of the things...

What about (X)emacs ? It supports Ruby fairly well, and it
is cross platform. And you get automatic indenting and
highlighting. I couldn't do without automatic indentation, and I
also like the fact that you can create your own commands.
I wonder why it isn't mentioned, does nobody use emacs for
Ruby programming?

Kristof
 
K

Kristof Bastiaensen

I use Emacs for Ruby programming.. and programming in general, and for
all kinds of other stuffs. I really should try out the Ruby
Refactoring Browser, as it seems that it's meant to be used through
emacs for now :) I really wonder how good it is.

Ruben

That's interesting, I will also take a look at it.
Are there other packages that are commonly used by
emacs programmers?
What I am missing is a way to execute code inside
a emacs session, like *scratch* for elisp.
I am currently using irb, but many times I am entering
multiline code in irb, just to find out I made a mistake
and have to retype it.
Another nice thing would be a class browser, where you could browse by
method and class, in stead of by file (a la smalltalk).

If you are interested, I find the following replacements
very useful.

Replacement for kill-line,
basicly it either preserves indentation, or removes all
whitespace, not just mess it up.

(defun my-kill-line (&optional arg)
"Improved version of kill-line ;-)
preserves indentation and removes extra whitespace"
(interactive "_P")
(let ((col (current-column))
(old-point (point)))
(cond ((or (and (numberp arg) (< arg 0))
(not (looking-at "[ \t]*$")))
;use default behavior when calling with a negative argument.
;who calls kill-line with a negative argument anyway?
(kill-line arg))
((and (skip-chars-backward " \t") ;always true
(bolp)
(save-excursion
(forward-line arg)
(not (looking-at "[ \t]*$"))))
; killing from an empty line:
; preserve indentation of the next line
(kill-region (point)
(save-excursion
(forward-line arg)
(point)))
(skip-chars-forward " \t")
(if (> (current-column) col)
(move-to-column col)))
(t ; killing from not empty line:
; kill all indentation
(goto-char old-point)
(kill-region (point)
(save-excursion
(forward-line arg)
(skip-chars-forward " \t")
(point)))))))

(global-set-key '(control k) 'my-kill-line)

replacement for beginning-of-line,
(this seems to be standard in most editors):

(defun beginning-of-line-or-indent ()
"Go to the first non blank character on the line,
or if already there, to the first character."
(interactive)
(let ((oldpoint (point)))
(beginning-of-line 1)
(skip-chars-forward " \t")
(if (= oldpoint (point))
(beginning-of-line 1))))

(global-set-key '(home) 'beginning-of-line-or-indent)
(global-set-key '(control a) 'beginning-of-line-or-indent)

Kristof
 
R

Ruben

At Fri, 14 May 2004 06:34:04 +0900,
Kristof said:
That's interesting, I will also take a look at it.
Are there other packages that are commonly used by
emacs programmers?

Do you know http://www.emacswiki.org ? You can find a lot of
information and pointers to emacs-lisp code there. Some packages that
i've looked at and seem interesting (allthough not directly related to
ruby), are JDEE (Java Development Environment for Emacs), ECB (Emacs
Code Browser), Flymake, color-theme.
What I am missing is a way to execute code inside
a emacs session, like *scratch* for elisp.

You can start a shell inside emacs (M-x eshell), most of the time
however, i do this (executing code, not ruby specific) in a seperate
xterm. Debugging on the other hand (C-code), i always do with gdb
inside emacs (M-x gdb), it is nice because emacs will show you where
you are in the source, and you have the source right there when you
want to make changes. (you can do something similar with 'M-x rubydb',
but i've never really used that yet, only tested)

Actually you can also start compiles (with 'make') from inside emacs
(M-x compile). Emacs will show the output of make in a seperate
buffer. If there are errors, you just have to click/enter on the error
and it will 'warp' you to the source at the location of the error.
I am currently using irb, but many times I am entering
multiline code in irb, just to find out I made a mistake
and have to retype it.

The elisp-files you get for ruby support in emacs also contain
'inf-ruby.el'. If you load this, then you can run irb inside emacs
(M-x run-ruby). There are functions defined so that you can mark
something in your source-file and 'send' that code to the running
irb-process (ruby-send-region/ruby-send-region-and-go). You might take
a look at 'inf-ruby.el'. To be honest i haven't used this a lot, but
most of my programming work is in C. You might also look into
'rubydb3x.el'.
Another nice thing would be a class browser, where you could browse by
method and class, in stead of by file (a la smalltalk).

Maybe you should take a look at ECB (Emacs Code Browser,
http://ecb.sourceforge.net), this probably does what you want. It
doesn't support Ruby though, AFAIK :(. (it supports C/C++, Java and
even Python...) Personally, i've used it a couple of times, but most
of the time i don't. Things like this always seem to take up too much
screen space, and i really want to see as much code as possible at
once.
If you are interested, I find the following replacements
very useful.

Replacement for kill-line,
basicly it either preserves indentation, or removes all
whitespace, not just mess it up.

(defun my-kill-line (&optional arg)
...)

hmm.. maybe i'm doing something wrong, but this seems to act the same
as normal kill-line ? are you using Xemacs, or Emacs ?
replacement for beginning-of-line,
(this seems to be standard in most editors):

i'm afraid i'm the kind who doesn't like this behaviour, but thanks
anyway :)

Ruben
 
K

Kristof Bastiaensen

At Fri, 14 May 2004 06:34:04 +0900,

Do you know http://www.emacswiki.org ? You can find a lot of
information and pointers to emacs-lisp code there. Some packages that
i've looked at and seem interesting (allthough not directly related to
ruby), are JDEE (Java Development Environment for Emacs), ECB (Emacs
Code Browser), Flymake, color-theme.

Thanks, I will take a look at it. The problem is that there
is so much elisp code out there, that is sometimes unpractical
to find something really useful (i.e. for Ruby). I have tried
ECB, but I couldn't get it to work. There were just
so many dependencies, and anyway they don't work with Ruby.
want to make changes. (you can do something similar with 'M-x rubydb',
but i've never really used that yet, only tested)

Interesting, I will give it a try.
There are functions defined so that you can mark
something in your source-file and 'send' that code to the running
irb-process (ruby-send-region/ruby-send-region-and-go). You might take
a look at 'inf-ruby.el'. To be honest i haven't used this a lot, but
most of my programming work is in C. You might also look into
'rubydb3x.el'.

That is kind of what I was looking for. I find it only a bit
annoying that you can eat the prompt. I would prefer no prompt
at all (maybe there is a way around).
Maybe you should take a look at ECB (Emacs Code Browser,
http://ecb.sourceforge.net), this probably does what you want. It
doesn't support Ruby though, AFAIK :(.

Eh, not really, I'd like something specific for Ruby.
hmm.. maybe i'm doing something wrong, but this seems to act the same
as normal kill-line ? are you using Xemacs, or Emacs ?

Xemacs. If it doesn't work on Emacs, shouldn't it give an error?
Try to use it at the end of a line, and see the difference.
Try also on an empty line, type many spaces, and press my-kill-line.
I find myself never having to type many times del or tab to fixup
whitespace anymore. I am interested what you think about it (I think
it is a great improvement).
i'm afraid i'm the kind who doesn't like this behaviour, but thanks
anyway :)

Well I did, but I was used to do it from MSVC. :)

Thanks for the info,

Kristof
 
C

Charles Comstock

Kristof said:
That's interesting, I will also take a look at it.
Are there other packages that are commonly used by
emacs programmers?
What I am missing is a way to execute code inside
a emacs session, like *scratch* for elisp.
I am currently using irb, but many times I am entering
multiline code in irb, just to find out I made a mistake
and have to retype it.
Another nice thing would be a class browser, where you could browse by
method and class, in stead of by file (a la smalltalk).

There is code somewhere on the rubygarden wiki for executing a range of
ruby code. It's under editor extensions I think. I was under the
impression the majority of ruby coding did occur under emacs, with
perhaps vim showing up as the next most used editor, but perhaps i am
mistaken.
Charlie

Charlie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top