I'm looking for a Ruby tutorial which would be usable for Java programmers with 8+ years of experience. I don't need another tutorial which explains basic programing/OOP/OOD concepts (inheritance, polymorphism, encapsulation, classes, constructors, hashes, etc.), just a fast-track tutorial (or even a reference?) which could tell us how to do specific things in Ruby.
Is it possible to create a form on Windows using Ruby? I have a Ruby script and I would like to have an input form to ask for a user's password, then use this in the rest of my script.
update: I have successfully done this with wxRuby, although it looks ugly. Shoes looks promising, I might look into that if I need to do this again..
Hi,
I'm in need to get some integration work done in my ruby application. My main focus is web services and ActiveMQ integration (the systems I'm going to connect to are mainly written in Java).
I was wondering if there's something that resembles the capabilities of Camel in Ruby? All I need is something that'll let me define routing between incoming data from those sources I mentioned above, do some pre-processing and post them back somewhere else.
Thanks,
Matthias
I'm now learning Ruby because I saw it's a very powerfull language, but now I want to know what mobile ports of Ruby we have and for what devices.
PS: I have a HTC S711, HP iPAQ Hx2, Nokia E61, Nokia N95, Palm T|X, Palm Z22, HP Jornada 720..., it's better if I can use it on these platforms, but I'm open to buy other devices, as I'm a mobile addict.
[{"id":"123","name":"House"},
{"id":"1456","name":"Desperate Housewives"},
{"id":"789","name":"Dollhouse"},
{"id":"10","name":"Full House"}
]
How can I render to produce this JSON format from within Ruby? I have all the data from the DB (@result) and don't know what data structure to use in Ruby that will render to this when I do this:
respond_to do |format|
format.json { render :json = @result}
end
What data structure should @result be and how can I iterate to produce it? Thank you!
Hi dear community!
I need draw some lines/circles/rect/etc from ruby into something like canvas.
I tried wxRuby and fxRuby but they are have no good examples to draw simple lines.
Just tried to install qtruby on Windows and its fall cause of some number of errors.
So:
1) Which API for ruby to draw on canvas I need?
2) Give me a little sample of it (full code please)?
Sincerely
Eugene
I found this regex statement on the wiki (http://en.wikipedia.org/wiki/Sentence_boundary_disambiguation) for Sentence boundary disambiguation, but am not able to use it in a Ruby split statment. I'm not too good with regex so maybe I am missing something? This is statment:
((?<=[a-z0-9)][.?!])|(?<=[a-z0-9][.?!]\"))(\s|\r\n)(?=\"?[A-Z])
and this is what I tried in Ruby, but no go:
text.split("((?<=[a-z0-9)][.?!])|(?<=[a-z0-9][.?!]\"))(\s|\r\n)(?=\"?[A-Z])")
Hi,
I'm a big fan of Resharper in visual studio. It has some awesome refactoring tools, similar to what you get in Ecplipse for Java. Is there anything like this for Ruby? Better yet, is there a plugin or something into VIM that does refactoring for Ruby code like renaming all instances of a method or variable, renaming classes sitewide, etc?
thanks,
craig
In Python, if I want to get the first n characters of a string minus the last character, I do:
output = 'stackoverflow'
print output[:-1]
I can do the above in Ruby with:
output = 'stackoverflow'
output.reverse[1..output.length]
Is there another way to perform this action in Ruby?
Is it possible to run jRuby and native rubyon the same machine?
For example installing rake or gem under both it find's Matz Ruby extensions /usr/bin/gem or /usr/bin/rake
The MRI gems and jruby gems are mixed up.
Is there any experience in that constellation ?
Thanks erhard
I've encountered a thread in one of the zend articles comparing Ruby developers to vampires == ruby == red == blood. Then mentioned something about werewolves? I'm just a bit inquisitive on what are werewolves compared to??
I want to know how to open and manipulate a simple image file in Ruby language.
I don't need to do any advanced stuff, just things like open(), get_pixel() and put_pixel() and I don't wanna use any gem for doing that, but just to know the barehands-ruby way.
Hello
I am trying to validate a dollar amount using a regex:
^[0-9]+\.[0-9]{2}$
This works fine, but whenever a user submits the form and the dollar amount ends in 0(zero), ruby(or rails?) chops the 0 off.
So 500.00 turns into 500.0 thus failing the regex validation.
Is there any way to make ruby/rails keep the format entered by the user, regardless of trailing zeros?
How good is the new Ruby Installer for Windows?
I asked before about why Ruby was so slow on windows and now I've seen some impressive benchmarks showing marked speed improvements with the minGW compilation used in the new installers and am curious how it has worked for people who have tried it?
How many gems are broken for this version? Any big ones you have been bit by not on this list?
Hello I have a very simple HTTP ruby server. I want it to simply server a PNG image. So I sent headers like image/png but I think that Ruby is converting the image data to a string first.
Here is my relevant code
webserver = TCPServer.new('127.0.0.1', 20001)
while (session = webserver.accept)
#....
file = File.open("tmp_testserve.png", "rb")
contents = file.read
file.close
session.print @content
session.close
#....
Is this what is happening?
I am trying to get to grips with BDD web development in Ruby using cucumber + capybara and I am stuck at what should be an easy task - just to check the number of rows in a table. Something along the lines of:
page.should have_xpath("//table[@id='myTable']")
find("//table[@id='myTable']/tr").length.should = 3
But this doesn't work and I can't find a way to assert against the table length.
Any ideas anyone (please be easy on me tho' I'm a ruby nooby)
Thanks in advance
Neil
I have a Rsync program Deltacopy with an executable as client and server but would like to replace this if possible with a pure Ruby implementation of Rsync. I found gems like six-rsync and rsync-update but they seem to be no general implementations. I'm looking for a pure Ruby solution, so no executables involved and preferably runnable on multiple OS.
If possible a simple sample would be great.
I only look for Rsync, no other transfer or backup solutions please.
A new web application may require adding Artificial Intelligence (AI) in the future, e.g. using ProLog. I know it can be done from a Java environment, but I am wondering about the opportunities with modern web languages like Ruby or Python. The latter is considered to be "more scientific" (at least used in that environment), but using Google there seems to be a preliminary ProLog implementation for both.
Any suggestions on modern (open source) web languages (like Python or Ruby) in combination with AI?
I've heard so much about Textmate - The Missing Editor for Mac and that it is the best one for Ruby.
What is your choice?
And what is the best Ruby editor on Windows?
E?
Is it possible to run a ruby application as a Windows Service? I see that there is a related question which discusses running a Java Application as a Windows Service, how can you do this with a Ruby application?
Okay, so I've looked through a couple of my ruby books and done some googling to no avail.
What is the difference between main and initialize in Ruby? I've seen code that uses
class Blahblah
def main
some logic here
end
#more methods... end
and then calls it using Blahblah.new.
Isn't new reserved only for
initialize? if not, then what's the difference between the two?