Which set of libraries and tools would you recommend to use for development SOAP-service onRuby 1.9 - soap-tools, web-servers, or maybe a web-framework?
I manually placed a library in the library directory (/usr/local/lib/ruby/site_ruby/1.8) and when I try to require it, it says "no such file to load".
I used "$:.first" to get the library path, so why wont it work? Is there any good way to debug this?
Thanks
I am looking to host multiple rubyonrails apps and want to use lighttpd or nginx.How do I do multiple name server configuration. ?
I know how to do it in apache through webmin control panel.But trying to move away from apache here
Hello,
how would I develop an Email client in Ruby-on-rails taking Gmail as an example? I would be especially interested in the send email functions
Thanks for any pointers
Can anyone please tell me how to delete a recurly account. As, I have tried with the following commands,
r = Recurly::Account.find(account_code)
r.delete
And also, I have tried with "r.destroy".
But, it only changing the state of recurly account from "active" to "closed" and not deleting the account completely.
I am using rails2.3.11 for this application.
Thanks in advance.
K. Subrahmanyam.
Hi,
I was going over some pages from WikiVS, that I quote from:
because lambdas in Python are restricted to expressions and cannot contain statements
I would like to know what would be a good example (or more) where this restriction would be, preferably compared to the Ruby language.
Thank you for your answers, comments and feedback!
In the effort to learn python and/or ruby, I was wondering how a file shredder would be implemented? I would like it to take in a file as an argument and then employ an algorithm to make that file unrecoverable. Would possibly add the support for multiple files or even whole directories later.
I'm new to Rails and am working with the collection_select method.
I have two fields I'd like to display in my select box:
first_name and last_name
So far, I can only display one or the other, not both.
Here's the code I'm working with:
collection_select(:hour,:shopper_id,@shoppers,:id,"last_name")
Thank you.
I'm trying to write a ruby script which automatically downloads some files from some server ever 30-45 minutes (to prevent overload) as long as my computer is turned on. It's possible that my computer might be turned off at some point, but the download should resume (probably re-download the current file).
I already have the file list but I can't figure out how to make such a script to run autonomously.
What are some ways I can do this?
I'm not sure what to call this, so I'll give an example.
In PHP
1==2 || 2 returns 1 or true
In Ruby
1==2 || 2 returns 2 (The second statement if the first evaluates to false).
Is there any short way to implement similar thing in PHP?
In ruby, how do I test that one array not only has the elements of another array, but contain them in that particular order?
correct_combination = [1, 2, 3, 4, 5]
[1, 5, 8, 2, 3, 4, 5].function_name(correct_combination) # => false
[8, 10, 1, 2, 3, 4, 5, 9].function_name(correct_combination) # => true
I tried using include, but that is used to test whether [1,2,3].include?(2) is true or not.
I want to unescape the following string:
'\u00020\u0002Standard\u00023\u0002Doe John\u000169\u0002\u0010\u0002Lorem\u0002\u0011\u0002Ipsum\u0002\u0014\u0002'
Javascripts unescape function works ok, however how can I unescape it in ruby?
Take in mind that unescape(previousString) is 0Standard3Doe John69LoremIpsum.
Any recommendation on libraries to do audio processing in Ruby. I need to do the following two tasks:
Find silences, for which I'm happy to just be able to iterate over each sample in the wave.
Cut and paste pieces of wav files to form a new wav file.
Convert wav to mp3, which I will probably leave to lame anyway.
I'm looking for the equivalent of NAudio, a C# library.
Hello,
I've a remote cgi script hosted on Apache using SSL. It takes in two input variables a and b.
I want to call call the cgi script with right input variables using ruby.
Any clues would be appreciated.
Hallo
rails version 2.3.5
I'm learning rails and I run into a problem.
I'm doing some nesting forms from the railscasts tutorials. I changed the text area into a data field to upload photos and everything is working.
Now i have to display the uploaded pictures and i simply can't do it. I Tried everything I could find on the net but nothing worked.
PROBLEM
I have the Article controller which handles the article CRUD.
inside the article new form there is nested a form for uploading images.
article controller
def code_image
@image_data = Photo.find(params[:id])
@image = @image_data.binary_data
send_data(@image, :type => @image_data.content_type,
:filename => @image_data.filename,
:disposition => 'inline')
end
photo model
def image_file=(input_data)
self.filename = input_data.original_filename
self.content_type = input_data.content_type.chomp
self.binary_data = input_data.read
end
articles/show.html.erb
<%=h @article.title %>
<%=h @article.body %>
<% for photos in @article.photos %>
<%= image_tag(url_for({:action => 'code_image',
:id => @article.photos.id})) -%>
<% end %>
articles/_formnew.html.erb
<% form_for (:article, @article,
:url => {:action=>'create'}, :html=>
{:multipart=>true}) do |f| %>
<%= f.error_messages %
<%= f.label :title %><br />
<%= f.text_field :title %><br /><br />
<%= f.label :body %><br />
<%= f.text_area :body, :style => 'width: 600px;' %><br /><br />
<% f.fields_for :photos do |builder|%>
<%= builder.label :content, "Photo"%><br />
<%= builder.file_field :image_file %><br />
<% end %>
<br />
<%= f.submit "Create" %>
<% end %
Thanks
What are the best practices for reading and writing binary data in Ruby?
In the code sample below I needed to send a binary file using over HTTP (as POST data):
f = File.new("resp.der", "r") # binary file
begin
while true
out.syswrite(f.sysread(1)) # out is an output stream (type IO)
end
rescue EOFError => err
puts "Sent response."
end
While this code seems to do a good job, it probably isn't very idiomatic. How can I improve it?
I'm looking to develop my first Facebook application and therefore looking for some advice on where to get started.
I've spent a few hours browsing Facebook's Developer Wiki, Facebooker library, looking at the sample chapters in "Developing Facebook Applications with Rails" by Pragmatic Programmers, etc.
Since FB is constantly changing their API, and Facebook Connect is newer than the aforementioned book, does anyone have any advice on where to get started?
i cant understand what the difference is between a namespace and a scope in the routing of ruby-on-rails 3.
could someone please explain?
namespace "admin" do
resources :posts, :comments
end
scope :module => "admin" do
resources :posts, :comments
end
thanks
I found ruby class Timeout very useful for my project.
But i need to run a block of code in background and keep it under a timeout..
For example
Timeout::timeout(2) { block.call }
How to do that?
I'm looking for a much more idiomatic way to do the following little ruby script.
File.open("channels.xml").each do |line|
if line.match('(mms:\/\/{1}[a-zA-Z\.\d\/\w-]+)')
puts line.match('(mms:\/\/{1}[a-zA-Z\.\d\/\w-]+)')
end
end
Thanks in advance for any suggestions.