Ask a Question related to Ruby, Design and Development.
-
Pierre Baillet #1
Re: Plugin-API
Hi, --
On Thu, Nov 20, 2003, Christian Kruse wrote:Maybe you can have a look at the rbot source code> Hi there,
>
> I'm writing an application in Ruby which should be easy to extend. One
> should be able to write a plugin for this application and should be able
> to load it with an entry in the config file, e.g.
>
> [snip]
> What's the "ruby way" to do this?
>
> Greetings,
> CK
>
([url]http://www.linuxbrit.co.uk[/url]) which has a quite good system of plugin
auto discovery (and reload too)
HTH,
--
Pierre Baillet
It is a good viewpoint to see the world as a dream. When you have something
like a nightmare, you will wake up and tell yourself that it was only a dream.
It is said that the world we live in is not a bit different from this.
Ghost Dog - The Way of the Samouraď
Pierre Baillet Guest
-
Opera Plugin - Like IE Plugin
Experts! Can anyone tell me if and how it is possible to insert the Contribute Plugin into the Opera Browser? Thank you very much, Sectas -
PKI Plugin
Dear all exists a PKI plugin to use at Dreanweaver? Best Regards. F?bio http://www.smartsec.com.br -
Please help --> How can I install flash player plugin (version 8) in browser without downloading setup or redirecting to macromedia site if flash plugin is not available in browser
Hi, Please help How can I install flash player plugin (version 8) in browser without downloading setup or redirecting to macromedia site if... -
wma plugin
Can anyone please advise me how to embed a .wma (Windows Media Audio) file into html without the plugin autoplaying on load. I have tried creating... -
Christian Kruse #2
Plugin-API
Hi there,
I'm writing an application in Ruby which should be easy to extend. One
should be able to write a plugin for this application and should be able
to load it with an entry in the config file, e.g.
Load ContentFilter
Perl I would use eval statements like
eval "use $modname";
die $@ if $@;
to load the plugin. In Perl the plugin would look like the following:
push @{$main::Plugins->{state}},new Module;
package Module;
sub new() {
}
....
1;
What's the "ruby way" to do this?
Greetings,
CK
Christian Kruse Guest
-
Robert Klemme #3
Re: Plugin-API
"Christian Kruse" <ckruse@defunced.de> schrieb im Newsbeitrag
news:8mgipb.a13.ln@news.defunced.de...Assuming the config file is evaluated as ruby code you can do:> Hi there,
>
> I'm writing an application in Ruby which should be easy to extend. One
> should be able to write a plugin for this application and should be able
> to load it with an entry in the config file, e.g.
>
> Load ContentFilter
>
> Perl I would use eval statements like
>
> eval "use $modname";
> die $@ if $@;
>
> to load the plugin. In Perl the plugin would look like the following:
>
> push @{$main::Plugins->{state}},new Module;
>
> package Module;
>
> sub new() {
> }
> ....
>
> 1;
>
> What's the "ruby way" to do this?
15:33:28 [temp]: for file in PluginBase.rb SomePlugin.rb config.rb
application.rb ; do echo "---- $file ----" ; cat "$file" ; done
---- PluginBase.rb ----
class PluginBase
end
---- SomePlugin.rb ----
require 'PluginBase'
class PluginClass < PluginBase
# functionality
end
$plugin_registry << PluginClass
---- config.rb ----
require 'SomePlugin'
---- application.rb ----
# other classes
$plugin_registry = []
eval File.readlines("config.rb").join
p $plugin_registry
15:33:36 [temp]:
As easy as that...
robert
Robert Klemme Guest
-
gabriele renzi #4
Re: Plugin-API
il Thu, 20 Nov 2003 14:47:52 +0100, Christian Kruse
<ckruse@defunced.de> ha scritto::
you may find this thread useful:
[url]http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/48648[/url]
gabriele renzi Guest
-
Curt Hibbs #5
Re: Plugin-API
On Thu, Nov 20, 2003, Christian Kruse wrote:
You might want to look at the plugin system used by FreeRIDE which is called> Hi there,
>
> I'm writing an application in Ruby which should be easy to extend. One
> should be able to write a plugin for this application and should be able
> to load it with an entry in the config file, e.g.
>
> [snip]
> What's the "ruby way" to do this?
>
> Greetings,
> CK
FreeBASE and has been packaged as a separate download. See:
[url]http://freeride.rubyforge.org/wiki/wiki.pl?FreeBASE[/url]
The FreeRIDE IDE is completely (100%) implemented as a set of plugins, with
the exception of FreeBASE, which is the plugin manager. It has sophisticated
facilities for specifying dependencies between plugins (which affects the
load order of plugins) and includes a high-performance messaging engine (the
databus) that allows plugins to communicate with each other while minimizing
coupling.
However, if your plugin needs are very simple, this might be overkill.
Curt
Curt Hibbs Guest
-
Christian Kruse #6
Re: Plugin-API
Hoi,
Thank you very much for your help.> [...]
Greetings,
CK
Christian Kruse Guest



Reply With Quote

