Is there a Ruby IDE for windows that supports auto completion for user defined classes (like textmate does)?
class MyClass
attr_accessor :name, :age
def initialize(name, age)
@name, @age = name, age
end
end
mc = MyClass.new
mc....
The last line should list [name, age]
...
I'm pretty new to programming, so be gentle. I'm trying to extract IBSN numbers from a library database .dat file. I have written code that works, but it is only searching through about half of the 180MB file. How can I adjust it to search the whole file? Or how can I write a program the will split the dat file into manageable chunks?
e...
I am planning an app that will need the ability to look up the elevation of geographic points by lat/lng. Ideally I would like something that would work worldwide, but US-only would also suffice. I have looked at using the USGS Elevation Query Web Service, however it only allows you to query for one point at a time, and I will need to lo...
I've got rails_authorization_plugin up and running with models.
What's the best way to implement permission checks on my site?
I have complicated conditions for when an instance of an object should be visible, is there an efficient way to chain them together so I'm not fetching multiple sets of data and grinding my DB as a result of lo...
I'm looking for something like CodeIgniter's:
$this->db->last_query();
(http://codeigniter.com/user_guide/database/helpers.html)
...
Hi there,
I'm using HighLine to write my console application and I would like to modify the HighLine::Question::in_range! function so that tab completion stayed activated but that highline do not bother checking if the words typed are in the range.
So let's say I have a tab completion list like %w{app1, app2, app3}
I'd like to be able...
I have followed the basic instalation ( http://railscasts.com/episodes/67-restful-authentication )
Doing this:
1.) ruby script/generate authenticated user sessions
2.) ruby script/generate authenticated user sessions and rake db:migrate
3.) On the file application_controler.rb I have included
include AuthenticatedSystem
4.) On t...
I just discovered the what c# knowledge should I have? question and wondered about the same, but for Ruby. I consider Ruby to be my favorite programming language, and beyond learning the basics, at least what I've picked up from numerous Ruby on Rails projects and a few Ruby scripts, I've tried to learn from reading blogs like Gluttonou...
Is there any way to write Shoes application using IDE (NetBeans for example)?
I hadn't found this solution and I don't like running Shoes app, selecting files, run.
I'm sure code for packing Shoes and IDE code will be different (I hope in require directives only), but I'm intresting in possibility.
...
Currently I am working on a piece of software, which is currently written 100% in Objective-C using the iPhone 3.0 SDK.
I have come to a cross roads where I need to do quite a bit or string concatenation, more specifically, NSString concatenation and so far I have been doing it like this:
Objective-C string concatenation:
NSString *re...
I'm working on a multi form Ruby-Qt program using, and I'm having a problem with controlling secondary windows from the primary one.
How can i disable the primary window when any secondary one is open, also how to take a secondary window output to use it on the primary one, and finally, sorry this is a silly one, what is the appropriate ...
Given the following two ways of defining a class method in Ruby:
class Foo
class << self
def bar
# ...
end
end
def self.baz
# ...
end
end
Is there a difference between the two? Is one more preferable than the other?
...
I've got a string
Purchases 10384839,Purchases 10293900,Purchases 20101024
Can anyone help me with parsing this? I tried using StringScanner but I'm sort of unfamiliar with regular expressions (not very much practice).
If I could separate it into
myarray[0] = {type => "Purchases", id="10384839"}
myarray[1] = {type => "Purchases", id...
I need some examples of implementing curry function in ruby(1.8.6 or 1.8.7 not 1.9).
...
I'm attempting to use Ramaze, the ruby framework, to implement a RESTful controller. I can't seem to gain access to the data in the request when I send a PUT, however. Sample code:
require 'ramaze'
class PutController < Ramaze::Controller
map '/'
def index
"Argument of "+request[:id]
end
end
Ramaze.start
And my interactin...
I'm setting up a new RedHat Enterprise Linux 5 system to host Ruby apps running under Apache with Phusion Passenger. I've updated all the local packages on the system. Here is what RedHat is giving me for Ruby:
$ ruby -v
ruby 1.8.5 (2006-08-25) [i386-linux]
That's pretty old. Is it better to use what RedHat provides or install a newer...
I am trying read zip file from HTTP GET request. One way to do it is by
saving the response body to a physical file first and then reading the
zip file to read the files inside the zip.
Is there a way to read the files inside directly without having to save
the zip file into a physical file first?
My current code:
Net::HTTP.start("cl...
I got a Base superclass and a bunch of derived classes, like Base::Number, Base::Color. I'd like to be able to use those child classes as if I they inherited from say Fixnum in the case of Number.
What's the best way to do this, while still having them respond appropriately to is_a? Base ?
So, I should be able to do
Number.new(5) + N...
For the purposes of the discussion I cooked up a test with two tables:
:stones and :bowls (both created with just timestamps - trivial)
create_table :bowls_stones, :id => false do |t|
t.integer :bowl_id, :null => false
t.integer :stone_id, :null => false
end
The models are pretty self-explanatory, and basic, but here they are:
...
So, I'm just trying out Ramaze for a new project, and I'm wondering why it won't work with Thin, but will with ramaze start (which is webrick I guess). Here's what it gives me:
/opt/local/lib/ruby1.9/gems/1.9.1/gems/thin-1.2.2/lib/thin/request.rb:50: [BUG] unknown type 0x22 (0xc given)
This is the line it's talking about:
@parser = ...