On 23-Oct-08, at 9:46 PM, Chris Parrish wrote:
Adam van den Hoven wrote:
What I mean is:
1) I decide to use your tag instead of creating my own special
purpose if_ and unless tags. I document it in my README
2) Like some existing extensions do, I inject a page or a snippet
or a layout into the database that uses my extension and yours
3) A user installs my extension because my announcement was so mind
blowingly awesome but doesn't really read the README
4) The user's site blows up because your extension is missing
The problem isn't with your extension. The problem is that there is
no standard way, no best practice to ensure at some point that the
requirements are met and gracefully allow the user to remedy that.
Its a Radiant problem.
Why not test for your extension's dependencies on load? For
instance, my soon-to-be-announced variables extension has the
following line in the activate method for the extension:
raise "The Variables Extension requires that the Conditional Tags
extension be loaded first" unless defined?(ConditionalTags)
Sure that works.... except that it is entirely too late IMHO. It
should be raised when you install the extension (say in the update or
migrate tasks) since that is when you are dealing with extensions. If
you were to do that for a live site running passenger then suddenly
your production site is down. You could argue that there are better
ways (I'm not convinced that capistrano is reasonable approach for
someone who isn't a dedicated Ruby coder) but it is a reasonable way
(especially for a savvy non-coder), which is why I wrote documentation
for just that sort of approach.
-Chris
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant