warning about Loquatious

15 views
Skip to first unread message

Joel VanderWerf

unread,
Jun 27, 2010, 10:33:47 PM6/27/10
to Webby

I'm getting this warning

---------------------------------------------------------------------------
The Loquacious configuration system has detected that one or moe
settings have an undefined value. An attempt is being made to reference
sub-properties of these undefined settings. Messages will follow containing
information about the undefined properties.
---------------------------------------------------------------------------
Access to undefined value "gnuplot": gnuplot.[]
Access to undefined value "gnuplot": gnuplot.[]

This happens when I use the gnuplot filter, but it also happens with the
graphviz filter in the example that comes with webby. However, the
filter runs normally.

Here's where it happens:

def gnuplot( *args, &block )
opts = args.last.instance_of?(Hash) ? args.pop : {}

text = capture_erb(&block)
return if text.empty?

defaults = ::Webby.site.gnuplot || {}
# ^^^ this leads to method_missing


Is there some way to register the gnuplot key so that Loquatious is happier?

Also, how do you access things in the Sitefile now. The old syntax

SITE.key1.key2 = val

doesn't seem to work.

Tim Pease

unread,
Jun 28, 2010, 11:51:23 PM6/28/10
to webby...@googlegroups.com

On Jun 27, 2010, at 8:33 PM, Joel VanderWerf wrote:

>
> I'm getting this warning
>
> ---------------------------------------------------------------------------
> The Loquacious configuration system has detected that one or moe
> settings have an undefined value. An attempt is being made to reference
> sub-properties of these undefined settings. Messages will follow containing
> information about the undefined properties.
> ---------------------------------------------------------------------------
> Access to undefined value "gnuplot": gnuplot.[]
> Access to undefined value "gnuplot": gnuplot.[]
>
> This happens when I use the gnuplot filter, but it also happens with the graphviz filter in the example that comes with webby. However, the filter runs normally.
>
> Here's where it happens:
>
> def gnuplot( *args, &block )
> opts = args.last.instance_of?(Hash) ? args.pop : {}
>
> text = capture_erb(&block)
> return if text.empty?
>
> defaults = ::Webby.site.gnuplot || {}
> # ^^^ this leads to method_missing
>

defaults = ::Webby.site.gnuplot.nil? ? {} : ::Weby.site.gnuplot

The Loquacious configuration system assigns an undefined object as the default value for all unknown configuration options (an instance of Loquacious::Undefined). This object is what is printing out the messages. In ruby only "false" and "nil" are falsey; everything else is true by default. So the Loquacious::Undefined instances are true, and the compromise that Loquacious makes is to have the "nil?" method always return true.

>
> Is there some way to register the gnuplot key so that Loquatious is happier?
>
> Also, how do you access things in the Sitefile now. The old syntax
>
> SITE.key1.key2 = val

Webby.site.key1 {
key2 val
}

Again, the Loquacious configuration system dictates this structure. If you read up on the Loquacious documentation / source code you'll see why. I'll leave that as an exercise for the reader ;)

Blessings,
TwP

Reply all
Reply to author
Forward
0 new messages