Am 01.02.2008 um 12:41 schrieb James Adam:
> Adding the about.yml information is something we can definitely
> re-include.

Cool!

> Originally, we would simply load about.yml into a Hash
> which can be accessed from the plugin instance:
>
> about.yml
> ---
> :author: James
> :url: http://interblah.net
> :version: 2.0.1
> :description: Blah blah
>
> becomes
>
> plugin = Engines.plugins[:my_plugin]
> plugin.about
> # ==> { :version => "2.0.1", :author => "James", :url =>
> "http://interblah.net"; ... }

That's a reasonable approach, IMO.

> This is relatively easy to support - in fact, is there any reason why
> this couldn't be implemented as a patch to Rails core itself?

I can't see any.

> Regardless, my only suggestion would be that the plugins mechanism is
> not particular about the specific keys in about.yml - anything can be
> present.

I agree.

> So the config.rb would be stored somewhere outside of /vendor/plugins?
> I'm not sure this is a particularly good fit for the engines plugin
> itself -

I imagined it to be something a long the lines of Rails' config/ 
database.yml which provides application specific config data. Likewise  
a [plugin_root]/config.yml could define plugin specific configs. The  
plugin could ship with config.example.yml with defaults and comments.

> it seems better that Mephisto makes some class available to
> its plugins to support this. Something like
>
>  create_table :plugin_configs do |t|
>    t.string :plugin
>    t.string :key
>    t.string :value
>  end
[...]
> .... anyway. That's just off the top of my head, but the point is that
> I'm not sure that it's anything that the engines plugin should really
> handle explicitly. Any thoughts?

This actually is how Mephisto works today. :))

Personally I feel that a) having a standard way of customizing  
configuration is a need that would fit into Engines perfectly, but b)  
ActiveRecord as a storage engine for this need feels a bit too  
heavyweight for being used in Engines.

How about:

#plugin.rb - if present, defines some arbitrary properties and options
author 'James'
website '...'
option :foo, 'bar' # 'bar' is the default value

#config.rb - if present, defines customized option values
foo 'baz'

Hmm, actually I myself am not fully convinced of this. But you get the  
idea. I'd like to see a way of providing about info, defining options  
w/ default and customized option values in a simple manner.

--
sven fuchs                      [EMAIL PROTECTED]
artweb design           http://www.artweb-design.de
grünberger 65           + 49 (0) 30 - 47 98 69 96 (phone)
d-10245 berlin          + 49 (0) 171 - 35 20 38 4 (mobile)



_______________________________________________
Engine-Developers mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org

Reply via email to