I'm finding that autotest has stopped working...
$ autotest
loading autotest/rails
Autotest style autotest/rails doesn't seem to exist. Aborting.
According to this blog post, the common reason for this error is that people don't have the autotest-rails gem installed. However, I definitely have that installed:
autotest-rails (4.1.0)
Z...
I apologize for the very specific issue I'm posting here but I hope it will help others that may also run across this issue. I have a string that is being formatted to the following:
[[,action1,,],[action2],[]]
I would like to translate this to valid YAML so that it can be parsed which would look like this:
[['','acton1','',''],['ac...
@father = Hierarchy.find(:first, :conditions => ['label = ?', 'father'])
@father.children.each do |child|
puts @father.object_id == child.parent.object_id
end
I would have thought the results here would be all true.
Instead they are all false.
Why does ActiveRecord work this way instead of recognizing that these are the ...
I'm trying to access my Amazon S3 account using the aws-s3 gem, but no matter what I do, I can't even print a bucket list.
Error:
undefined method `bytesize' for #<AWS::S3::Bucket:0x1b9e488>
From Code:
# hello_world.rb
require 'rubygems'
require 'sinatra'
require 'aws/s3'
get '/' do
connection = AWS::S3::Base.establish_connection...
How can I check if an NFS share on network is online/available/alive using Ruby code (on Linux)?
I have a code like this at the moment:
while !Ping.pingecho('192.168.1.116')
end
`mount -a`
exec 'SOMETHING THAT IS PLACED ON NFS SHARE'
And it doesn't work quite OK, because the remote machine exporting the share don't always have the NF...
I'm trying to make a threaded comments system that behaves like Reddit's: I click "Reply" on a comment, a form shows up. This form has a "Cancel" button that removes the form, going back to the original state.
I'm trying to achieve that with one link_to_function that adds the form, and the form itself has a button_to_function to remove ...
I am learning Java.
I have learned and used Ruby. The Ruby books always tell the advantages of Ruby over Java. But there must be some advantages, that's why lots of people (especially companies) use Java and not Ruby.
Please tell the absolute(not philosophical!) advantages of Java over Ruby.
...
So basically I have a controller. something like this
def show
@user = User.find[:params[id]]
#code to show in a view
end
User has properties such as name, address, gender etc. How can I access these properties in the model? Can I overload the model accesser for name for example and replace it with my own value or concatenate someth...
Hey!
I have a dictionary, lets call it myDict, in Python that contains a set of similar dictionaries which all have the entry "turned_on : True" or "turned_on : False". I want to remove all the entries in myDict that are off, e.g. where "turned_on : False". In Ruby I would do something like this:
myDict.delete_if { |id,dict| not dict[:...
I've got a table that includes a column named "valid". This has caused a problem after updating to Rails 2. ActiveRecord is expecting "def valid?" to do validation, not return a boolean value from the database.
How do I work around this problem? Is renaming the column my only option?
...
While the build of 1.8.7 I have seems to have a backported version of Shellwords::shellescape, I know that method is a 1.9 feature and definitely isn't supported in earlier versions of 1.8. Does anyone know where I can find, either in Gem form or just as a snippet, a robust standalone implementation of Bourne-shell command escaping for ...
How can I match a block of text that is indented using tabs?
Say I have the following text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
# This is a text block
@some = 'ruby'
@then = 'some more'
Aliquam malesuada scelerisque orci, sed venenatis sem eleifend ac. Vestibulum vehicula sagittis commodo. Praesent ...
Is there a good library/gem for accessing Amazon SQS from ruby1.9? The Amazon ruby example and right_aws do not work as-is with ruby1.9.
I'd strongly prefer something that's known to work under reasonably heavy load (a few hundred thousand queue items or more per day).
...
I have a Ruby script, which uses one external lib.
Sometimes script exits with segmentation fault,
when uses this lib and I must to rerun it.
Is it possible to somehow rescue this error by extracting fragment,
which has dangerous code to separate process or something like that?
Thanks
...
I am writing an app that has different parts running on multiple servers. As a result, I have a ruby file filled with global values, which contain the IP addresses of the machines on which each part is running.
The app has a Rails front end that connects to a remote database (on one of the other servers). Is it possible to make use of ...
is there a way to get the referer with the anchor from the referer page..
the situation is - i have a search page which loads results (users) below the search box using ajax. i am changing the hash/anchor on the fly when the search keyword is typed in.
so it becomes http://localhost/users/search#foo
the user gets link in the ajax res...
Does anyone know of any good tutorials for learning Ruby with Curses? I just can't seem to find one and the doc is very vague. I have never used curses before so I really don't know much about it.
...
Sorry for such a trivial question, but I'd feel silly building this if it already existed.
I have a vague memory of there being a Rails helper that could turn ['one', 'two', 'three'] into "one, two, and three", but I could be totally making things up. And I can't quite figure out where in the API to look since it's not in the TextHelper...
I have a Rails app that archives high-res images (and thumbs) on S3 (via the Paperclip plugin).
I would love to allow users to download multiple high-res files with a single download. Is it possible to create a .zip/.tar file on S3 without first copying them back to the server? Our app runs on a large dedicated box and I'd love to save...
Hello fellow Mac rubyists and AppleScript haters,
For those of you that have experience with both rubyosa and rb-appscript, I'd like the hear the pros and cons of each, which one you decided to stick with, and which one you'd recommend for a totally non-AppleScript savvy ruby old-timer. Also, are there any other options that I have miss...