[Masterview-users] Logging from within a directive

Ed Howland
Fri, 09 Jun 2006 20:32:53 -0000

On 6/9/06, Deb Lewis <djlewis at acm.org> wrote:
>
>
> The next release of MasterView will include a rework of the mechanisms for
> customizing the MasterView configuration.  The new approach will be similar
> to the style used for rails app configuration, where you customize the
> settings for your app by providing initialization specs in your config
> directory, setting values in the configuration and allowing for
> environment-dependent settings which override/augment the general config
for
> your app.
>
> There''ll be documentation on all the supported configuration
options and
> description of how to use them, along with some sort of example/prototype
> config file so it''s easy to drop in and get going if you want
something
> different than the standard defaults,.
>
> I''ll make sure there are options supported to allow configuring
the logging
> facilities.  (that area isn''t quite sorted out, working on that
right now)

Great news. Looking forward to it. Do you have a timescale?

>
> [p.s. introducing myself: I''m currently working with Jeff on some
> enhancements to MasterView, having recently picked it up to use in a rails
> development project I''m doing and deciding there were some things
I wanted
> added or done differently.  kudos to Jeff, he''s done a really nice
job
> creating MasterView]
>
> ~ Deb

Introducing myself as well. I''ve just started using MV in a recent
newly minted, but ongoing project. I''ve only completed the outer layer
of the first seach page so far, Today I hope to get the new entry
forms converted. (At the very least, I can through out a lot of my
other
small templates which had to be edited by hand each time I got them
back from the designer.

I''ve know Jeff for a few months through the StL.rb (St. Louis Ruby
brigrade.) He also gave a talk on it there and mentioned it during his
RoR talk at the StLLUG meeting where I''ve attended since naught-0.

So far it has been working out OK. I am getting our designer on
Subversion this afternoon, so we can share the files that way. As we
talked about in a recent post, the relative path was the only
confusing part to him. He lives in Dreamweaver-land and all paths are
below the project directory. Too bad there aren''t things like symlinks
in Windows.

****
BTW, so I am not too far ahead of the projected directive syntax, will
one version of ''image_tag'' look like this:

<img src="../../../public/images/my.gif"
mv:image_tag="my.gif">

Currently, to support image sizes and other attributes, I am forced to
do this for all my image tags:

<img src="../../../public/images/my.gif" height="17"
width="16
mv:image_tag="''my.gif'', :size =>
''17x16''">

So even <img src="../../../public/images/my.gif"
needs:
 mv:image_tag="''my.gif''">

That is because I need to pass the complete argument as a string to
the image tag inside the erb. The quoting and unquoting of strings
inside attribute values of mv: is a real pain. Clearly, I need more
help on writing directives.

?

Thanks
Ed


>
>  ________________________________
>  From: masterview-users-bounces at rubyforge.org
> [mailto:masterview-users-bounces at rubyforge.org] On Behalf
> Of Jeff Barczewski
> Sent: Thursday, June 08, 2006 1:29 PM
> To: masterview-users at rubyforge.org
> Subject: Re: [Masterview-users] Logging from within a directive
>
>
> The Logger is set on the MasterView module so you would probably need to
> refer to it like
>
> MasterView::Log.debug "foo"
>
> or even better use
>
> MasterView::Log.debug { "foo" }
>
> The second form is better since it is a block and the block won''t
get
> executed if the output level is above debug which saves cpu if you were
> doing any string building concatenating, etc.
>
> _______________________________________________
> Masterview-users mailing list
> Masterview-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/masterview-users
>
>


--
Ed Howland