Displaying 10 results from an estimated 10 matches for "random_string".
2008 Mar 05
7
mocking successive return values
...tes a
quote number, looks to see if it is in the db already. If it is, it
calls itself to try again. I want to test that it looks in the
database for matching numbers until it finds one which does not exist
already.
## The code
def generate_quote_number
quote_num = "MMQ#{self.random_string}-001"
if Policy.find(:first, :conditions => ["quote_number = ?",
quote_num])
quote_num = generate_quote_number
end
quote_num
end
def random_string(size=8)
# return a random string
end
For the test, I simply lookup 3 existing quote numbers,...
2006 Jul 02
2
NoMethodError in Unit Test - Rails Newcomer
...n system to get familiar with rails,
and have basically solved most of my apps problems till now. I keep
getting the NoMethodError, and can''t understand why.
Model: customer.rb
class Customer < ActiveRecord::Base
...
def self.password=(pass)
@password=pass
salt = Customer.random_string(10) if !salt?
self.hashed_password = Customer.encrypt_password(@password, salt)
end
end
Test: customer_test.rb
require File.dirname(__FILE__) + ''/../test_helper''
class CustomerTest < Test::Unit::TestCase
self.use_instantiated_fixtures = true
fixtures :customers
......
2007 Mar 05
2
Any capistrano email recipes?
I''d like to set up capistrano to send an email whenever we do a
deployment. Just start an SMTP session with localhost and shoot off
the email. I have all the code to do that actually, I just don''t know
how to run some Ruby code on the deployment server. Anyone know how
to do that, or do you have an email recipe?
Pat
--~--~---------~--~----~------------~-------~--~----~
You
2006 Jun 21
3
png() or jpeg() in a php script
Hello,
I've got a problem with a PHP script, in which I call the system function
(to call another processes). The call is :
system("R --slave --vanilla < path/to/source/source.R");
if in this R file, I've got the lines:
pdf(file="/path/to/file/file.pdf")
commands
dev.off()
the pdf file is perfectly created
but if I change the lines to:
2000 Mar 03
7
[PATCH] Add a Maximum Idle Time (1.2.2)
The attached patch adds an option (off by default to preserve current
behavior) to set a timeout on the select() statement that waits for input
in clientloop.c. This fixes a timeout issue for me (explained below) and
probably also fixes the timeouts mentioned in last month's thread "Idle
time out". The patch is also available by http from:
2005 Dec 29
7
belongs_to causing NoMethodError exceptions ... ?
...before_create
self.email_address = @pending_user.email_address
self.account = @pending_user.account
##self.pending_user = @pending_user
self.pending_user_id = @pending_user.id
# XXX: send an email with the activation key here...
self.email_validation_key = MiscUtils.random_string(80)
# XXX: since we''re not sending email, manually set the
validation flag
self.email_validated = true
#breakpoint("user before_create finish")
end
def after_create
# mark the pending user as used
# XXX - handle failure better
##self.pendi...
2006 May 11
9
Undoing a SHA1
Hello for my password recovery system I want to recover the users
password and send it to them. In the DB its saved via SHA1 (login
generator)
--
Posted via http://www.ruby-forum.com/.
2016 Jun 30
4
[PATCH 0/4] p2v: Send ^C to remote end to cancel the conversion.
(I don't have a BZ# for this yet, but I'm expecting it to be
filed as an RFE)
Currently if the user is in the virt-p2v GUI and cancels the
conversion, all that happens is we abruptly close the ssh session to
virt-v2v.
That is bad .. possibly (or maybe not). But in any case there is an
alternative: we can send a ^C key to the virt-v2v process, which it
could catch and handle gracefully,
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers.
These aren't valid for global names in C++.
(http://stackoverflow.com/a/228797)
These large but completely mechanical patches change the illegal
identifiers to legal ones.
Rich.
2019 Sep 10
3
[PATCH 0/2] Remove virt-p2v from libguestfs
Now that virt-p2v has its own repository [1] and releases [2], it is
time to remove it from libguestfs.
[1] https://github.com/libguestfs/virt-p2v
[2] http://download.libguestfs.org/virt-p2v/
Pino Toscano (2):
Remove virt-p2v
Remove remaining virt-p2v bits
.gitignore | 4 -
Makefile.am | 7 +-
bash/Makefile.am