[Masterview-users] Urgent Help! - User directives no longer functioning in 0.2.2
djlewis at acm.org
Thu Jul 6 01:05:41 EDT 2006
Ed - apologies, we didn't make the config-loading change clear enough in the
upgrade notes s.t. you now *had* to append your custom directives dir to the
Dropping out autoloading from vendor/plugins/masterview/directives was a
side effect of reworking where and how user configuration and customization
gets done. Basic philosophy: your app settings and custom directives should
live in your "own space", not in vendor/plugins which really ought to be
black-box stuff that's just installed and used.
When we made this change as part of the 0.2.0 release, it wasn't quite clear
yet where the "right" place to automatically look for user directives was.
These are code entities, so config/masterview didn't seem like the right
place. Somewhere in app directory makes more sense, but we weren't quite
sure at that point how things were best organized given other changes going
on at the same time related to where template files should be located.
I think we're now clear that the standard place for template files is in the
usual rails app/views directory, with direct compilation into the rails view
cache just like .rhtml, rather than in a separate dir such as
app/masterview/templates as we'd explored in some earlier versions of the
Given that templates live in app/views, I think the right place to look for
any app custom directives for a rails app is in an app/masterview/directives
directory. In the new 0.2.3 release that was just published today, if that
directory is found it will be automatically appended to the MasterView
directives load path, along with the builtin directives that ship with MV.
So... suggest you move your directive impls to app/masterview/directives,
then you don't need any special path additions in your MV config (though dup
registration is benign if there) or manual directive registration.
In progress for next release: support for alternate namespaces for custom
directives, so they aren't forced to share the mv: namespace prefix. Also
better API doc and a developer's guide for directive implementors.
P.S. the new 0.2.3 release has new config settings to allow alt locations
for img/stylesheet assets, per some of the issues you raised, so that .html
templates can reference co-located design-time copies of those resources and
have paths mapped properly to the public dir files. I use that to keep a
placeholder stylesheet in my app/views directory that's referenced from my
templates, so I don't have to use ugly ../../../public/stylesheet/xxx refs
(those are actually still around, but hidden in one place in the colocated
stylesheet rather than cluttering up all my .html docs)
From: Ed Howland [mailto:ed.howland at gmail.com]
Sent: Wednesday, July 05, 2006 11:18 AM
To: Jeff Barczewski
Cc: masterview-users at rubyforge.org; djlewis at acm.org
Subject: Re: Urgent Help! - User directives no longer functioning in 0.2.2
Thanks Jeff. I got confused by the masterview_plugin generator which when I
ran it created 'vendor/plugins/masterview/directives' which was where I
installed them previously. Since that option was commented out, I assumed it
still picked up any there and that you could add additional ones in the
I suggest that you make a note of this in the announcement, since others may
run into this as well.
Also, I never explicitly require 'masterview' anywhere. Are you suggesting
this in one of the normal Rails configuration files? Or in
On 7/5/06, Jeff Barczewski <jeff.barczewski at gmail.com> wrote:
> We didn't intentionally remove user level directives from the release.
> We consider it a benefit to allow user created directives.
> I would guess that since the newer version uses new configuration of
> how those user directive paths are specified that this is what broke
> things for you.
> Check your config/masterview/settings.rb that you have specified
> config.directive_paths << /path/to/my/directives
> to include your directive directories.
> I will run some tests to verify whether there are any issues with this.
> Also note that you can also manually 'require' any files that you want
> if you do it after you require 'masterview'. This will allow you to
> manually load any directives anywhere in your path including inside of
> gems. They simply have to be done after masterview though so that
> MasterView will become aware of them as they load.
> On 7/5/06, Ed Howland <ed.howland at gmail.com> wrote:
> > After upgrading to 0.2.2, my directives in
> > vendor/plugins/masterview/directives no longer function.
> Scanned all
> > the documentation and could not find _any_ information on user
> > created directives.
> > Reading the code itself, there seems to be 2 commented out sections.
> > One refers to app/masterview/directives and the other refers to
> > config/masterview/directives. Seems to be a lot of TODO commentary.
> > Why were user directives disabled in this release and no
> > notification given? Is there a work around? I desperately need to
> > get my code working again.
> > Thanks
> > Ed
> > --
> > Ed Howland
> > http://greenprogrammer.blogspot.com
More information about the Masterview-users