Loomio
Thu 4 Apr 2019 6:49PM

Plugin example not working

ELP Edward L Platt Public Seen by 104

Hi, I've followed the example for creating a plugin ( https://help.loomio.org/en/dev_manual/plugins/ ) but the "Hello, World!" message is not printed when I run "rails c". Any suggestions on how to get this working?

I've tried adding plugin.enabled = true, but no luck. Here is the most recent code I've tried (placed in plugins/loomio_tags/plugin.rb):

# plugins/loomio_tags/plugin.rb
module Plugins
    module LoomioTags
        class Plugin < Plugins::Base
            setup! :loomio_tags do |plugin|
                # our code will go here!
                plugin.enabled = true
                puts "Hello, world!"
            end
        end
    end
end
ELP

Edward L Platt Fri 12 Apr 2019 2:20PM

Alternatively, is there a currently working example of a loomio plugin?

RG

Robert Guthrie Mon 15 Apr 2019 12:25AM

I feel it is fair to warn you that we've never had anyone external to Loomio write a plugin - you're the first. Having noticed this to be the case, I've not kept the plugin work current, because it has not added any value for so long.

Also I'm not very happy about how the plugin system works. I think that we should just be using Rails Engines for server functionality.. and then for the client, well, we're rewriting the entire frontend.. almost at beta stage - with no plugin support available in the new client at this stage. It can come but it's not a priority for me because it's not adding value that I can see.

A plugin system can be a really valuable thing - and in the future I can imagine us supporting Vue client plugins and rails engines. But as we do massive change work on the app to keep moving it forward, we need to break things like this.

I think a discussion about your work, and how to best go about what you want to do, would be a good thing to do. I'd be happy to have a call and help.