I wrote a script in Ruby. I'd like to run it every day at a certain time. How do you do that on a Windows XP system?
I poked around on the machine and discovered the "scheduled tasks" control panel, but it doesn't seem to have anything to do with running scripts, as far as I can tell from the options offered by the "wizard".
...
Using Ruby on Rails I want a confirmation page before creating an ActiveRecord object. The user will see a preview of the item they are creating before submitting and the object being saved in the database
A common pattern;
User visits /entry/new
User enters details and clicks submit
User is redirected to /entry/confirm which display...
I read some source code of ZenTest but didn't find where it is implemented.
Could you give me give some clue? Thanks in advance.
...
I want to write a piece of software which is essentially a regex data scrubber. I am going to take a contact list in CSV and remove all non-word characters and such from the person's name.
This project has Perl written all over it but my client base is largely non-technical and installing Perl on Windows would not be worth it for them.
...
Hi. I recently discovered Ruby Shoes, which sounds rather useful for a beginner like me. The only the problem is that my laptop is x64, while the only Linux package is i686. I tried it anyway and it didn't work for me, I kept getting an error. I didn't expect it to work, of course, but is there still a way to get Shoes on x64 Linux? Than...
I'm currently re-using a partial on two different views.
View A
View B
The partial belongs to Model A but has an association with Model B so it is applicable to Model B as well.
It contains a form and when data is submitted, it always redirects the user to View A. However, when I submit the form from View B, I would like to...
Is there an easy way to round a Time down to the nearest 15 minutes?
This is what I'm currently doing. Is there an easier way to do it?
t = Time.new
rounded_t = Time.local(t.year, t.month, t.day, t.hour, t.min/15*15)
...
Is there any documentation that discribes all the available functions and objects in shoe?
update: 2008.01.21
I am looking for a list of all the methods that can be called against an animate object.
For example I only figured out how to pause an animation using the toggle() method by reading source code from the shoebox (http://the-sh...
I was taking a look at Shoes which seems like a very nice tool for quick GUI applications. The common elements/controls, however, don't seem to include the equivalent of a list/report view (e.g., ListView in Windows, NSTableView in OS X).
Did I just miss this, or does it not (yet) exist?
...
I would like to change the name of the ruby process that gets displayed in the linux/unix top command. I have tried the
$0='miname'
approach but it only works with the ps command and in top the process keeps getting displayed as "ruby"
Thanks for any hints in advance.
...
In ruby, if I do "require foo", is there a way to subsequently determine the name of the module or modules defined in foo.rb?
For example, say I have a ruby file named foo.rb that looks like this:
# foo.rb
module MyModule
def self.summary
"this does something useful"
end
...
end
In another script, after I do "requ...
In our application we're using acts_as_solr for search. Everything seems to be running smoothly except for the fact that using the model name as the search query returns every single row in the table.
For example, let's say we have a users table. We specify acts_as_solr in our model to search the fields first name, last name and hand...
I'm trying to dynamically define functions that call through to another function that takes an options parameter:
class MyClass
["hour", "minute", "second"].each do |interval|
define_method "get_#{interval}" do |args|
some_helper(interval, args)
end
end
def some_helper(interval, options={})
...
I need to implement a web client in a Rails app. The existing web service is SOAP and can often take several seconds to respond to requests. Using SOAP4R, the requests block.
Is it acceptable to call these blocking methods directly from a rails controller? If not, should the rails controller buffer up commands with a separate service ...
In the near future, I may be teaching a Ruby programming class to undergraduates at an art college. It's a safe assumption that the students have little to no experience with programming. The class will be taught in a computer lab, but they don't have any administrative rights on the lab computers.
Ideally, I'd like the students to be ...
I've just installed railroad and tried to run a couple simple example runs.
I have an application model and controller that are causing it some heartburn.
There is no real application table - the model is used to load (include) things like the authenication system. The controller sets up the helper_methods, etc.
I also have many contro...
I need to build simple site "one big page" like 37signals product's pages, and I was thinking about this.
Anyone have an idea?
are they using Radiant or coding manually?
...
Rails caches (file cache) per default domain-based, but is there a way to disable this? My rails app can be reached via multiple domains and the content is all the same. I just don't want to have multiple cache files.
(I know memcache is better, this is not part of the question)
...
How do you start the Interactive Console for ruby and php
...
I'm getting a NoMethodError when trying to access a method defined in one of my helper modules from one of my controller classes. My Rails application uses the helper class method with the :all symbol as shown below:
class ApplicationController < ActionController::Base
helper :all
.
.
end
My understanding is that this should mak...