ruby

Snow Leopard, sqlite3-ruby

So I followed every suggestion in this thread without success. I'm running os x 10.6, rails 2.3.3, ruby 1.9.1 and still getting this error when I try accessing the front page of my rails app: uninitialized constant SQLite3::Driver::Native::Driver::API I've googled every possible combination of snow leopard, rails, sqlite3 without any...

Ruby daemon not working

I need to run a standalone ruby script as Unix (linux) daemon. After running that daemon I need to run another Ruby method with it. I installed the ruby-daemon gem on my machine by using the gem install daemon. I did the test daemon program. My test.rb file is : module Test def test_method @s =" ITS WORKING !" f...

ruby handsoap documentation

Hi, Does anybody know some nice documentation about the ruby "handsoap" gem to get me started? Thanks ...

how do i initialize the money gem?

I have a new gem I'm playing with, but I'm not sure where to put it so that it is initialized, but that I don't have to do it each and every time I use my method which uses it. def self.get_rate(from, to, amount) Money.default_bank.fetch_rates #<---------------- Here it is... if to == "USD" or from == "USD" rate = Mon...

How to find references when refactoring rails application with textmate?

I have been practicing TDD in C# for several years now and recently have moved to Ruby on Rails full time. I am continuing the practice of TDD with RSpec. My question is regarding the process of finding references while refactoring. In Visual Studio I was addicted to Resharper's "find all references" when renaming or replacing methods. ...

Unsolvable Ruby error ...

This might be the most stupid thing i've ever seen, i had a broken pipe error with the method send and the ruby class 'Socket', i had this thing 4 days ago and didn't find any thing about it, and i'm kind of going crazy. I'm almost desperate, i found a broken pipe errors at the internet, but non of them with the send method, or even wit...

rails rjs replacement and swap values

I'm trying to figure out how to use RJS to swap between two fields... i know how to replace the values but I can't seem to figure out how to read it. Is it not possible to read values thru RJS? Only to replace? <%= link_to_function "Swap" do |page| #to_value = page[:currency_to].value page[:currency_from].value = to_value...

Desktop Application Framework similar to Rails

I'm looking for a desktop application framework similar to Rails: Good ORM MVC Default directory structure View Helpers/DSL Elegant Open Source Fun language Decently mature ...

How to ensure SWF is cached by the browser the first time it is downloaded when serving via HTTP and Mongrel cluster?

We have a Rails app that instantiates a SWF object 16 times (it has to do this, it's just the nature of the application). Instead of being downloaded once, it is being downloaded 16 times. How can we ensure this SWF is cached by the browser the first time it is downloaded? It's being served directly from Apache - can we modify the HTTP...

Ruby - Executing tests in a random order with rake

How can I have the tests for my Rails app to be executed in a random order? Is there a simple solution using rake? ...

Ruby Range Unexpected Behavior

Can anyone shed some insight onto why the following happens? irb(main):001:0> r = '1'..'30' => "1".."30" irb(main):002:0> r.each do |i| irb(main):003:1* puts "#{i} : #{r.include?(i)}" irb(main):004:1> end 1 : true 2 : true 3 : true 4 : false 5 : false 6 : false 7 : false 8 : false 9 : false 10 : true ... (snip.. the String-numbers here ...

what is ruby used for BESIDES rails?

Ruby on Rails has become a new competitive face in the server programming industry, along with php, asp.net, jsp, python, and a few others. But is ruby used for anything BESIDES rails? Does it owe all of its success to the rails framework? More questions here are tagged ruby-on-rails than ruby. However, I supposed PHP isn't used for that...

How can debug messages in erb be supressed in production mode

I want to print out some debug messages in my erb template when it is called in development mode, but not when it is called in production mode (i.e.) <%= debug variable_name %> However, this will be printed in any mode. I found I can do <% if logger.debug? debug variable_name end %> which seems to work. Is this the proper...

How can I copy a directory inside a zip archive to a second zip archive using rubyzip?

I have a .zip archive containing several directories. Using the rubyzip gem I would like to reach into the .zip archive, copy a specified directory (and its contents) and move the directory into a second .zip archive. Ideally I would not have to extract the contents of the first .zip archive, then re-zip them into a second archive. I'...

How do you call a method from the view in raiis?

Lets say I did script/generate controller home And in the home controller made a the method.. def say puts "You are here" end How would I call that method in the index.html.erb? When learning ruby it just said to run the whatever.rb in the terminal to run what ever code you wrote within that file. Just curious on how that would wo...

How to specify output file encoding in Ruby?

Hi. How can I set the encoding of a file when using a File#open? ...

Cucumber + Webrat + Selenium guide

Hello, I have been using Cucumber and Webrat for a while. I know need to start writing behaviour that involve AJAX interactions so I was thinking to use the Selenium adapter for Webrat. Can anyone point out a easy and updated step-by-step guide for installing and configuring selenium+webrat+cucumber? I would like to be able to mix javas...

Ruby Lingua::Stem alternative

Hi. Is there a free alternative of Perl Lingua::Stem module, able to handle Russian language? Thanks ...

ruby handsoap wiredump

Hi, How can see the wiredump of a soap using the 'handsoap' library? I use the on_before_dispatch hook, and right now I am looking at the SoapService variables to see where such a request might be stored. Hmm.. I should also check out invoke to see which var. is using.. Do you have a quick solution? :D Thanks ...

git - update to new branch of rails

I currently have a rails project running of a git tag v2.1.2, to get here id did git checkout v2.1.2 However there are now new fix's that have been applied to the 2.1 branch, how do I move to this branch rather than the tag? ...