ruby

How do I add existing comments to RDoc in Ruby?

I've got all these comments that I want to make into 'RDoc comments' so they can be formatted appropriately and viewed using 'Ri.' Can anyone get me started on understanding how to use RDoc?...

.NET Migrations Engine

I was once under the belief that Microsoft was working on an official, ruby-like, Migration framework. However, I haven't been able to find any additional information (or even the original source of my belief). Does anyone know any information about an official migration framework? or possibly an open source one? ...

Implementation of "Remember me" in a Rails application.

My Rails-app has a sign in box with a "remember me" checkbox. Users who check that box should remain logged in even after closing their browser. I'm keeping track of whether users are logged in by storing their id in the user's session. But sessions are implemented in Rails as session cookies, which are not persistent. I can make them ...

Frequent SystemExit in Ruby when making HTTP calls

I have a Ruby on Rails Website that makes HTTP calls to an external Web Service. About once a day I get a SystemExit (stacktrace below) error email where a call to the service has failed. If I then try the exact same query on my site moments later it works fine. It's been happening since the site went live and I've had no luck tracking...

When to use lambda, when to use Proc.new?

In Ruby 1.8, there are subtle differences between proc/lambda on the one hand, and Proc.new on the other. What are those differences? Can you give guidelines on how to decide which one to choose? In Ruby 1.9, proc and lambda are different. What's the deal? Edit @Mike Stone: there's no difference between 1.8 and 1.9 in this regard. ...

How do I fix 'Unprocessed view path found' error with ExceptionNotifier plugin in rails 2.1?

After upgrading a rails 1.2 website to 2.1, the ExceptionNotifier plugin no longer works, complaining about this error: ActionView::TemplateFinder::InvalidViewPath: Unprocessed view path found: "/path/to/appname/vendor/plugins/exception_notification/lib/../views". Set your view paths with #append_view_path, #prepend_view_path, or #vie...

Open Source Ruby Projects

I have just recently started to study Ruby, and in lieu of Jeff's advice over the weekend... Stop theorizing. Write lots of software. Learn from your mistakes. ...I was interested in honing my skills while helping out the Open Source Community the process so I thought I'd ask if anyone have any suggestions for cool/interesting Open ...

How do I use (n)curses in Ruby?

I'd like to create a progress bar to indicate the status of an a batch job in Ruby. I've read some tutorials / libraries on using ncurses, none of which were particularly helpful in explaining how create an "animated" progress bar in the terminal or using curses with Ruby. I'm already aware of using a separate thread to monitor the progr...

How can I modify .xfdl files? (Update #1)

The .XFDL file extension identifies XFDL Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications. I know how to view XFDL files using a file viewer I found here. I can also ...

Calling Bash Commands From Ruby

How do I call console/bash commands from inside of a Ruby Program? Also, how do I get output from these commands back into my program?...

What is good forum software to add to an existing Rails application?

Should be easy to setup, and easy to couple application and forum users. ...

Text Editor For Linux (Besides Vi)?

Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby. Doing a google search yielded outdated answers. Edit: Since there has been some concern about the 'merit' of this question. I am about to ...

Reverse DNS in Ruby?

I'm in an environment with a lot of computers that haven't been properly inventoried. Basically, no one knows which IP goes with which mac address and which hostname. So I wrote the following: # This script goes down the entire IP range and attempts to# retrieve the Hostname and mac address and outputs them# into a file. Yay!require "so...

Mapping values from two array in Ruby

I'm wondering if there's a way to do what I can do below with Python, in Ruby: sum = reduce(lambda x, y: x + y, map(lambda x, y: x * y, weights, data)) I have two arrays of equal sizes with the weights and data but I can't seem to find a function similar to map in Ruby, reduce I have working....

Ruby On Rails with Windows Vista - Best Setup?

What do you think is the best set-up for RoR in a Win Vista environment? I've tried the radrails eclipse plug-in, and it just seemed too bulky for me, I've also started to just use Textpad and the command line, but I'm used to having somewhat of an IDE to work with. Thanks for the help!...

How do I rake tasks within a ruby script?

I've got a Rakefile with a rake task that I would normally call from the commandline (rake blog:post Title). I'd like to write a ruby script that calls that rake task multiple times, but the only solution I see is shelling out (`` or system). What's the right way to do this?...

How do I create a new Ruby on Rails application using MySQL instead of SQLite?

I want to create my Rails application with MySQL, because I like it so much. How can I do that in the latest version of Rails?...

Why Should I Learn Ruby?

So far, my favorite programming language has been python, hands down, but I've been hearing a number of good things about ruby from various people I hold in good regard, so let me put it to you: Why should I learn Ruby? Please do not post something to the effect of "Because it is awesome" or "It's better than language X because..." I...

How do I update Ruby Gems from behind a Proxy (ISA-NTLM)

Firewall I'm behind is running Microsoft ISA server (NTLM only mode), anyone have success getting their Ruby gems to install/update via Ruby SSPI gem or other method? ... or am I just being lazy? Edit: rubysspi-1.2.4 does not work UPDATE: This also works for "igem", part of the IronRuby project ...

How do I create a Class using the Singleton Design Pattern in Ruby?

The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object instance. Although I know how to code the singleton pattern in C++ and Java, I was wondering if anyone know how to implement it in Ruby?...