Problems on ruby 1.8.4 (2005-12-24) [powerpc-darwin8.6.0]
Arthur Vanderbilt
arthur at thevanderbilts.net
Tue May 30 21:42:22 EDT 2006
I'm fixing little problems that my configuration is having with hobix svn
trunk. I'll post them here as I go?
Here is the first one ...
hobix blogs was throwing an exception when there were no blogs that looks
like this:
/usr/local/lib/ruby/site_ruby/1.8/hobix/commandline.rb:133:in
`blogs_weblog': undefined method `-@' for nil:NilClass (NoMethodError)
from /usr/local/bin/hobix:79
Because although it would respond to sort, there was nothing in the array.
So the following prints the no blogs message as expected.
Index: lib/hobix/commandline.rb
===================================================================
--- lib/hobix/commandline.rb (revision 125)
+++ lib/hobix/commandline.rb (working copy)
@@ -127,10 +127,10 @@
def blogs_weblog_explain; "List your weblogs."; end
def blogs_weblog_args; []; end
def blogs_weblog
- if @config['weblogs'].respond_to? :sort
- blogs = @config['weblogs'].sort
- name_width = blogs.collect { |b| b[0].length }.max
- tabular( blogs, [[-name_width, 0, 'weblog-name'], [-40, 1,
'path']] )
+ if ( ( @config['weblogs'].respond_to? :sort ) && (
@config['weblogs'].length != 0 ) )
+ blogs = @config['weblogs'].sort
+ name_width = blogs.collect { |b| b[0].length }.max
+ tabular( blogs, [[-name_width, 0, 'weblog-name'], [-40, 1,
'path']] )
else
puts "** You have no blogs set up. Use `hobix setup_blogs' to
get started."
end
--
Arthur A. Vanderbilt
arthur at thevanderbilts.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/hobix-is-the-way/attachments/20060530/ae501fef/attachment-0001.htm
More information about the Hobix-is-the-way
mailing list