James Adam wrote:
> Ah,
>
> Sorry - I think I misunderstood what you were trying to achieve. In
> general, there's no simple way to set the options for a plugin before
> it has loaded. If you need a plugin to have some options set and
> *then* do something, init.rb probably isn't the place to achieve this.
> Instead, I'd develop your plugin such that things can happen at the
> end of environment.rb:
>
>   MyPlugin.option_one = :something
>   MyPlugin.option_two = [1,2,3,4]
>   MyPlugin.ok_now_get_ready()
>
> It sounds like you're trying to do something with the public asset
> copying facilities; in this case, you *should* be able to re-set the
> Engines.public_directory parameter at the bottom of environment.rb
> file, and then call
> Rails.plugins[:your_plugin_name].mirror_plugin_assets. That might do
> what you hope.
>   
ok, this makes sense. By studying the initializer code I already came to 
the same conclusion but maybe I was overlooking some meta-added 
functionality.
Or we need to modify the configuration class to add plugin specific 
options or do it like you say above.
To be honest I was just using the public_path example as a 'placeholder' 
for my questions, what I'm really trying to do is explained below.
> What is it that you're specifically trying to do?
>
>   
Well I added an option to the engines plugin to symlink the public files 
instead of copy them. So I added Engines.symlink_asset_files boolean to 
the module and used it in the
Engines.mirror_files_from.
In development mode I want to symlink (because some of the plugins I'm 
developing contain assets that get modified during the development 
process of the main application), in production mode I want to copy 
that's why I wanted to change the setting in config/environment.
Maybe there is another way of achieving what I want; basically I want to 
have full flexibility in development mode with as least restarting as 
possible. Is it possible to execute mirror_plugin_assets before every 
request get's handled in development mode ?

Oh and BTW thanks for the great engines +plugin+ you made.

regards

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

Reply via email to