OSX 10.5 comes with Ruby 1.8.6 I believe, but I see a lot of tutorials that recommend installing the latest version of Ruby from source. I've done this in the past and it's caused minor issues down the road if I install something which expects Ruby to be in the default location and it's not (Phusion Passenger pref pane, for instance). ...
Here is the specific XML I ultimately need:
<?xml version="1.0" encoding="UTF-8"?>
<customer>
<email>[email protected]</email>
<first_name>Joe</first_name>
<last_name>Blow</last_name>
</customer>
But say I have a controller (Rails) that is sending the data to a method, I'd prefer to send it as a hash, like so:
:first_name => 'Joe...
And when would you use one rather than the other?
...
What is the proper way to create a well-behaved Unix or Linux daemon in Ruby?
What is the definition of a well-behaved daemon anyway, and how would one write such a program in Ruby?
...
Is it possible to make a model that uses a different table dependent on an association.
...
Hi,
Does anyone have any suggestions for how to create a screensaver that can cycle through some webpages? I would like to create a screensaver that displays various dashboard and statistics pages that are available in our Hudson CI server. This is a windows machine, with firefox and IE available.
Extra bonus points if I can do it in...
Are there any "simple" explanations of what procs and lamdbas are in Ruby?
...
What would be the correct translation of the following Python method to Ruby?
def uniqueCombinations(self, items, n):
"""
items: list of elements
n: number in a group
"""
if n == 0:
yield []
else:
for i in range(len(items)-n+1):
for cc in uniqueCombinations(items[i+1:],n-1):
...
I have a ruby script containing system command like http://gist.github.com/235833, while I ran this script from shell, it works correctly, but when I added it to my cron job list, it doesn't work any more, the cron job is like:
10/* * * * * cd /home/hekin; /usr/bin/ruby my_script.rb
any idea what's going wrong with what i've done? ...
So far I have been building my Rail app on a Mac OS X box using TextMate.
It's just me, so I haven't used Git. I have just opened and closed the code in the file system, used an AppleScript to take annotated snapshots at key moments, and let Time Machine take care of the rest.
I've just ordered a Windows laptop which I'll use for the s...
I know that questions about this topic exist, but i would like to know if anyone knows a solution for rails :)
I'm using a text_area_tag helper, and the contents that i want to display contain HTML tags.. any idea?
...
It's an application that we use internally at the office that I would like to offer as a hosted service for anyone.
How can I do that without making major code changes?
The first thing that occurs to me is to have the app select which database to connect to based on the domain.
So each instance of the app would have its own databas...
I've heard a lot about rails, what is it and how does it work?
...
I have this regex: ^\/\* to check and see if a file contains those two characters at the beginning. I'm iterating over many c++ source files trying to see which of them contain that. The problem is, that if a file contains this:
#include <source.h>
/* this is a comment */
this also matches the regex. I don't understand why, as the re...
What I want is both whats in "if" and whats in "else" to include #main-block.
- if @transparency
#content-inner{:style => "background: url(../../../images/illustrations/" + @transparency + ") no-repeat 88% 50%"}
- else
#content-inner
#main-block
What happens currently is, if @transparency is defined, #main-block is not neste...
What are the best practices and tools to test email-sending using rspec with Rails?
For instance, how do I test that an email has been sent or what should I test to have efficient testing and acceptable coverage.
If you guys need an example, how would I go and test this:
class UserMailer < ActionMailer::Base
def jobdesc_has_been_re...
I'm using the Handsoap gem with Httpclient gem as the driver in a Rails app.
How can I prevent network calls from Handsaop/Httpclient gems in test cases?
FakeWeb doesn't support Httpclient.
...
There must be a better way of writing this- I'm just not sure how (using staticmatic)-
- if current_page.include? "0.html"
- @current_index = 1
- if current_page.include? "1.html"
- @current_index = 2
- if current_page.include? "2.html"
- @current_index = 3
- if current_page.include? "3.html"
- @current_index = 4
- if current_pa...
I want to send messages between Ruby processes via TCP without using ending chars that could restrict the potential message content. That rules out the naïve socket.puts/gets approach.
Is there a basic TCP message implementation somewhere in the standard libs?.
(I'd like to avoid Drb to keep everything simple.)
...
What Rack enabled blogging engines exist? I want to deploy a free blog to heroku and need more customizabilty than the free hosting of Wordpress.com or Blogerty provide.
Also in another note, has anyone tried to port Wordpress to Ruby?
...