GUI based debugger for Ruby?
Is there any GUI based debugger for Ruby? Just a debugger. I do not want a full IDE like NetBeans because they tend to get your project dirty with extra files. thanks! ...
Is there any GUI based debugger for Ruby? Just a debugger. I do not want a full IDE like NetBeans because they tend to get your project dirty with extra files. thanks! ...
I have an input box which I want to handle two types of information, foo and bar. The form action is set to either the foo controller or 'bar controller. It really doesn't matter which one. For the sake of example, the form action is to foo/new. In the controller, I have a function that looks at the form input text and determines if i...
In Ruby, when referring to the "downcase" method of the class "String", I write String#downcase. When talking about the "new" class method, I write String.new. Is there something similar for Objective-C? ...
I know Emacs has some sort of integration with gdb (though I never used it) to jump through files as you debug a program. I'd like to do the same with Ruby programs. ...
I want to do something simple and straightforward, like min(5,10), or Math.max(4,7). Are there functions to this effect in Ruby? ...
Hi all, Using Google + Bing didn't yield an answer to what should be a simple question: How are you supposed to use the HMAC module in Ruby to create a HMAC with MD5 (that uses a secret)? The HMAC docs seem awfully thin. Thanks! ...
how do i pass php array's to ruby script as an argument so that ruby script can read php's array. ? ...
so i have ruby script that simply writes to a test.txt file with "hello" i have a php script that executes this ruby script, when a user clicks a link. i find that test.txt is empty. however when i run by itself $> ruby sayhi.rb test.txt is filled with "hello" ...
I have a webservice method that reads a photo and returns its byte data. I'm currently doing the following: @photo_bytes = IO.read("/path/to/file") send_data(@photo_bytes, :filename => "filename", :type => "filetype", :disposition => "inline") I'm getting some strange behavior when calling this a lot... occasionally send_data is retur...
To save the HTML of a web page using ruby, it's very easy. One way to do is by using rio : require 'rubygems' require 'rio' rio('http://www.google.com') > rio('google.html') It is possible to do the same for by parsing the html, requesting again the different image,s js, css and then save each of them. I think it is not very efficient...
i have a large php array encoded to JSON, and passing it to a ruby script. however, it keeps throwing JSON::ParserError.... it is confused by the numerous doublequotes and singlequotes in the array. i ahve tried escapeshellarg, escapeshellcmd ..... these are not working. ...
def partial(template, *args) options = args.extract_options! options.merge!(:layout => false) if collection = options.delete(:collection) then collection.inject([]) do |buffer, member| buffer << erb(template, options.merge(:layout => false, :locals => {template.to_sym => member})) end.join("\n") else erb(t...
I would like to store the cookies from one open-uri call and pass them to the next one. I can't seem to find the right docs for doing this. I'd appreciate it if you could tell me the right way to do this. NOTES: w3.org is not the actual url, but it's shorter; pretend cookies matter here. h1 = open("http://www.w3.org/") h2 = open("http:/...
I've just come to a realization about deadlocks - namely what they are - and I'm concerned about this issue affecting my Rails code. Are there any specific deadlock issues to watch out for while developing a Rails app? Have you ever encountered a deadlock in your Rails code - or is that even possible? (I'm not referring to database de...
I'm trying to make a time with Time.local which in my code is dynamic. On the first of each month the values I'm passing are Time.local(2009, 9, -1, 0). In PHP this would set the time to the last day of the previous month. In ruby I just get "ArgumentError: argument out of range". Am I using the wrong method or something? Thanks. ...
Zlib::GzipReader can take "an IO, or -IO-lie, object." as it's input, as stated in docs. Zlib::GzipReader.open('hoge.gz') {|gz| print gz.read } File.open('hoge.gz') do |f| gz = Zlib::GzipReader.new(f) print gz.read gz.close end How should I ungzip a string? ...
I would like to calculate the similarity between users, which is reciprocal. similarity[:user1][:user2] == similarity[:user2][:user1] So it would be great to use: unordered_set(:user1, :user2) = 1 unordered_set(:user2, :user1) += 1 read_unordered_set(:user1, :user2) #=> 2 read_unordered_set(:user2, :user1) #=> 2 How can I get a sim...
Hi. How to disable creating an '.idea' folder in Rubymine? It creates that folder after opening every single file and if I delete the folder, works just the same as if I don't. TIA ...
I have a text file containing what I am told are unicode characters, for example: \320\222\320\21015-25'ish per main or \320\222\320\21020-40'ish per starter Which should read: £15-25'ish per main or £20-40'ish per main starter However, when viewing this text in Firefox, the output is mangled with various unwanted characters. So, ar...
I have a number of models that load a collection of strings, based on the user's i18n locale. In order to simplify things, each model that does so includes the following module: module HasStrings def self.included(klass) klass.extend ClassMethods end module ClassMethods def strings @strings ||= reload_strings! e...