Displaying 20 results from an estimated 2000 matches similar to: "When is nil not false?"
2008 Jun 02
3
GiT and RSpec
>
> Message: 2
> Date: Thu, 29 May 2008 06:35:01 -0700
> From: David Chelimsky <dchelimsky at gmail.com>
> Subject: Re: [rspec-users] Coloured output in rspec 1.1.4
> To: rspec-users at rubyforge.org
> Message-ID: <175B70FE-B706-4C03-8B20-C5B207268AD6 at gmail.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> On May 29, 2008,
2008 Apr 28
16
GiT and Edge/Trunk Rails
I have a sub-application project that I had previously converted to edge
rails under svn. Originally, vendor/rails was set up with svn:externals
so that an svn update at the project''s root would pull the latest trunk
along with all the other updates. Since Rails has moved to GiT and
depreciated svn I decided to remove the svn:externals reference for
vendor/rails and reinstall trunk using
2009 Feb 02
12
[RSpec] rcov and/or rexml bug?
Hi,
Running: Ruby 1.8.7 p72, RSpec 1.1.12 and rcov 0.8.1.2.0, I get the
following error message with $ rake spec:rcov
--
/usr/local/ruby1.8.7//lib/ruby/1.8/rexml/formatters/pretty.rb:131:in
`[]'': no implicit conversion from nil to integer (TypeError)
from
/usr/local/ruby1.8.7//lib/ruby/1.8/rexml/formatters/pretty.rb:131:in
`wrap''
from
2008 Nov 05
1
Removed edge rails but cannot find installed rails
I removed edge-rails from a project, git rm, committed and pushed the
revised project to the shared repository, and then git pulled it onto my
Windows XPpro laptop.
Both the original host and my laptop have Rails-2.2.0RC1 installed. The
Gem environment is:
$ rails --version
Rails 2.2.0
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.1
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel
2006 Jan 27
4
testing for nil numeric value in find
In the agile/rails tutorial book the following construct is added
to products.rb.
def self.salable_items
find( :all,
:conditions => "date_available <= now()",
:order => "date_available desc")
end
Now, I wish to extend :conditions => to exclude products that have
a nil value for the price. I have tried different syntax
2008 Mar 26
2
Missing Method defined in controllers/application.rb
I have this in my controllers/application.rb:
class ApplicationController < ActionController::Base
...
def datebalk!
# set regexp for datebalks generated attributes
c = /.*__dteblk/
# Remove datebalks generated attributes from params hash
delete_if { |k, v| c =~ k.to_s }
end
...
end
When I call this from client_controllers.rb in this fashion:
# need this to strip
2009 Aug 05
1
ActiveRecord boolean false returning Nil
Hi All,
I have a column type of boolean, and when the value in that column is
set to ''false'' (eg. 0 for MySQL), it returns nil.
I have tested this in the console, and it doesn''t exhibit this
behavior there, only when running on Mongrel.
I tried wrapping the accessor call to intercept a nil and set it to
false for that attribute, but it doesn''t seem to be
2006 Jun 30
8
before_filter: nil vs. true vs. false
Folks,
My understanding of how filters work is that I should return true if
everything is ok and false if not. How does the filter below work
then (from the Rails Recipies book)?
It would return nil if there''s a user in the session. Does nil count
as true?
before_filter :check_authentication
def check_authentication
unless session[:user]
session[:intended_action] =
2008 Nov 19
6
RSpec, TestUnit, Cucumber and Autotest
OS=CentOS-5.2
Ruby=1.8.6
Rails=2.2.1_RC
Gems all up to date
I have been experimenting with autotest and I have a few questions.
1. given export AUTOFEATURES=TRUE if ./test exists (with tests) then
these tests are run and the features are not. Is this intended
behaviour?
2. given require ''autotest/redgreen'' in .autotest if /test tests are run
then all I get colourized is a
2009 Nov 03
3
Proper configuration for DNS slaves and masters
I have the following layout
DNS01 - Master
DNS02 - Remote slave
DNS03 - Local network slave
The master is configured so:
acl HLLnetworks {
209.47.176/24;
216.185.71/24;
};
options {
allow-query {
any;
};
allow-recursion {
HLLnetworks;
};
allow-transfer {
HLLnetworks;
};
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
2007 Nov 22
11
Initial run of RSpec 1.0.8 on MS-WinXPproSP2
Rails 1.2.5
Ruby 1.8.6
Rake 0.7.3
RSpec 1.0.8
PostgreSQL 8.2.5
I am experiencing a problem with the "rake spec spec" task on an initial
trial of rspec. After creating the rails app I installed rspec and
rspec_on_rails in the vendor\plugins subdirectory from svn. I then used
ruby script\generate rspec_model product. I next manually created the
database instances depot_development and
2012 May 11
2
Cyrus-imapd update from 2.2.12 to 2.3.16
We are trying to move our mail store from a host running cyrus-imapd
2.2.12 under CentOS-4 to one running 2.3.16 under CentOS-6. The
current host is a 32 bit architecture. The new host is 64 bit. We have
followed the update guide found at:
http://www.cyrusimap.org/docs/cyrus-imapd/2.3.16/install-upgrade.php
The steps we followed were:
1. Install cyrus-imapd et al on the new host.
2. Modify
2007 Nov 24
5
rspec.opts
Where can I find a list of the options and their usage and meanings for
the contents of this file?
Regards,
--
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada
2011 Jun 13
6
CentOS-6 Status updates
I just want to say that I really, really, appreciate the information
given on this site:
http://qaweb.dev.centos.org/qa/calendar
--
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax:
2012 Nov 12
3
Updating objects in arrays
Perhaps this is a Rails issue. However, I need to first determine whether
I simply am missing something about updating members of an array.
I have an array of 10 ActiveRecord objects. I wish to iterate over the
array and update an attribute. When I do this the underlying table row
changes but the object in the array frequently does not. For example:
count = 0
current_entries.each do
2013 Sep 16
3
easy BASH question
I am obviously missing something basic here but can someone explain to me what
is wrong with the first statement, which returns nothing?
$ history | grep ^su
$ history | grep su
2997 su -l
3024 su -l
3050 su -l
3054 su -l
Thanks,
--
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited
2006 Jan 25
8
conditional replacements in rhtml
I am working on the Agile programming tutorial and trying out some
ruby code. Can someone tell me why the following works:
<h1>Display Cart</h1>
<p>
Your cart currently holds <%= @items.size %>
<%= @items.size == 1 ? "item" : "items" %>.
</p>
while this does not?
<h1>Display Cart</h1>
<p>
Your cart currently
2011 Dec 14
2
Shutdown KVM guest not working
I am in the middle of a rather confusing situation. At
the moment I am unable to shutdown a KVM guest machine.
Nor am I presently able to open a virt-manager session on
the host.
I am not exactly sure what has happened but the problem
with the vm guest is that issuing a "virsh shutdown 1"
from the root console has no effect.
# virsh list
Id Name State
2015 Mar 23
7
Facebook CentOS group close to 15.000 members!
On Mon, March 23, 2015 05:24, Nux! wrote:
> I find this very, very sad.
>
I find it unsavoury. We are recommending that acknowledged newbies
subscribe to a service known for repeatedly and persistently violating
its members' privacy?
--
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited
2015 Feb 18
3
Help with routing question.
CentOS-6.6
We have a host that has multiple IPv4 addresses aliased to eth0. The
primary address is 216.185.71.x and the alias is 192.168.6.x.
This host connects to devices on both netblocks without problems.
Only default routing is used and it looks like this:
#ip route
192.168.6.0/24 dev eth0 proto kernel scope link src 192.168.6.x
216.185.71.0/24 dev eth0 proto kernel scope link src