ruby

jssh telnet fails even after installing the add-on on Linux

Hi, I am working with ruby gem "firewatir (1.6.5)" and mozilla Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.5.9-1.fc11 Firefox/3.5.9.<\i> I have installed the jssh.*.xpi extension for mozilla 3.5 for Linux and it works for sometime. But the problem is that after running some scripts I get the error ...

library wireshark in ruby

Hello, I'm doing my project of 4th year of university and the theme of this project is to realize a network analyser with web interface close to what wireshark proposes. So its necessary to mapper the wireshark library in the ruby language, that will allow me after to dissector the packets captured. I have been looking for some manual ...

Ruby Gems with flexible gem dependencies?

I'm about to extract major functionality of a larger project into a ruby gem. The little framework I created uses a few additional gems, for different import/export options. Ie. FasterCSV (for ruby 1.8) for csv import/export Nokogiri for csv import/export GraphViz for graph ... PDF ... I don't want users of the gem to install and l...

Mongoid/activesupport version problem

I'm attempting to use Mongoid from a plain Ruby script (not via Rails or any other framework) and I think I'm running into some version dependency conflicts: /opt/local/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': RubyGem version error: activesupport(3.0.0 not >= 2.2.2, < 3.0.pre) (Gem::LoadError) from /opt/loc...

Daemon Start at the application bootup

I have a daemon that should run behind my rails app doing db modifications.I implemented that daemon using ruby daemons gem. I want to start that daemon at the start of my app. Whenever my app starts, I need to start that daemon. How can I do this..? ...

ActiveRecord talk to two databases?

We've recently revamped a project, and are looking to bring all our old data into the new system. The problem is that the schema is marginally different, so a straight SQL import isn't possible. Due to some denormalization and database changes, we'll need to do some massaging of the data before it's ready for import. I was hoping for ...

has anyone had any success trying to use cucumber with non english speaking people writing stories?

i like cucmber stories. they just look great. I am trying to find a way to use them in my daily work as a projet manager / developer / tester / analyst (you name it :p). problem ? my clients speak french only. No english. i see that cucumber seems to support 40 languages (wow!) => http://wiki.github.com/aslakhellesoy/cucumber/spoken-la...

How to build/mantain an affinity score between 2 users?

I mean analyzing 2 users profiles I get a score that it is reciprocal a.affinity(b) == b.affinity(a) I'd like to know in particular: which schema would u use to implement the affinity table which db mysql, redis,.. which technology would you use to update the affinity score in background? Thanks ...

Multithreading within a hash of hashes ruby

I have a code snippet like this myhash.each_value{|subhash| (subhash['key]'.each {|subsubhash| statement that modifies the subsubhash and takes about 0.07 s to execute }) } This loop runs 100+ times and needless to say slows down my application tremendously(about 7 seconds to run this loop). Any pointers on how to mak...

rails 3 plugin install declare a specific branch

I want to install from a particular branch on a git repo, how do I do it? ...

Ruby string slice index: str[n..infinity]

Easy question, but couldn't find it in the doc. How do I slice a string or array from n until forever? >> 'Austin'[1..3] => "ust" >> 'Austin'[1..] SyntaxError: compile error (irb):2: syntax error, unexpected ']' from (irb):2 ...

How does one embed IIRB inside of a IronRuby program?

In Ruby main, you can embed IRB inside of a Ruby script as described here. Is there a way to do something similar with IIRB inside an IronRuby script? ...

Comparing the order of three arrays with the same elements

I have three arrays. The arrays all have the same size and contain the same elements. However, the three arrays must not be in the same order. How do I verify that the elements are not in the same order? Here's how I've implemented it: all_elements_equal = true array1.zip(array2, array3) do |first, second, third| if ...

Multi-index container for ruby

Is there anything like boost::multi_index but for ruby. Basically taking some container of objects and having it indexed N different ways with N different query methods. I guess you could use DataMapper with the SQLite in memory database but I was wondering if there is anything pure ruby around. Below is an imagined example of what thi...

stuck on about_methods.rb on the EdgeCase Ruby Koans

I'm hacking my way through the EdgeCase RubyKoans (www.rubykoans.com) and am stuck on the method starting at line 35 in about_methods.rb here. Running rake fails predictably and tells me to look at line 36. I'm reasonable sure I have the assert_match correct ("0 for 2") but I don't know what's failing. It's very possible that the assert_...

Should I use the template to render JSON or use Controller returning JSON in RoR?

That's my great doubt. We have a project in RoR and we are making it more dynamic, using Ajax calls. They want that I put literal JSON in html templates and parse it with eval() in javascript, avoiding to putting exception into Controller to return response as JSON directly. Example: WhateverControoler#index -> will render views/whatev...

regular expression extract string between two strings

Hi all, I am trying to extract strings using regexp. For example in the following string: select DESCENDANTS([Customer].[Yearly Income],,LEAVES) on axis(0), DESCENDANTS([Sales Territory].[Sales Territory],,LEAVES) on axis(1), DESCENDANTS([Customer].[Total Children],,LEAVES) on axis(2) from [Adventure Works] where [Meas...

What is the most common way to do authentication in rails 3?

I need to do authentication in rail3 with standard sign up/login/forgot password functionality. Is there a plugin or something that most people use for this? ...

Ruby: easiest way to remove the first char from a string.

Example: "[12,23,987,43" What is the fastest, most efficient way to remove the "[" ? Like, maybe a chop() but for the first char. ...

Can't find rake on Ruby Rails Install

Microsoft Windows [Version 6.0.6002] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Windows\system32>gem install rake Successfully installed rake-0.8.7 1 gem installed Installing ri documentation for rake-0.8.7... Installing RDoc documentation for rake-0.8.7... C:\Windows\system32>rake C:/Program Files (x86)/Ruby192...