Discussion
Loading...

Discussion

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
James Smith 💾
@Floppy@mastodon.me.uk  ·  activity timestamp 5 months ago
@rgarner I’m trying to think how to make a system like https://plugins.octoprint.org/; could be that engines aren’t quite the right thing, but maybe there’s a way I can bend them to my will.
  • Copy link
  • Flag this post
  • Block
Russell Garner
@rgarner@mastodon.social replied  ·  activity timestamp 5 months ago
@floppy any mileage in abusing one or more `constraints` blocks with custom FeatureConstraints#matches?
  • Copy link
  • Flag this comment
  • Block
James Smith 💾
@Floppy@mastodon.me.uk replied  ·  activity timestamp 5 months ago
@rgarner hm, maybe…. This is all useful stuff thank you. Helpful to have ideas just bouncing around ❤️
  • Copy link
  • Flag this comment
  • Block
James Smith 💾
@Floppy@mastodon.me.uk replied  ·  activity timestamp 5 months ago
@rgarner I’m trying to think how to make a system like https://plugins.octoprint.org/; could be that engines aren’t quite the right thing, but maybe there’s a way I can bend them to my will.
  • Copy link
  • Flag this comment
  • Block
Russell Garner
@rgarner@mastodon.social replied  ·  activity timestamp 5 months ago
@floppy all an Engine really is is a Rack app that has a routing match associated with it at boot time via #mount (routes end up compiled so there's no real 'dynamic' there to speak of), so if your plugins map naturally to sprouting a bunch of new paths, so much the better – spike out something with constraints (no reboot required!)

If it's something different to that? Dunno. Couldn't divine the OctoPrint boundary from a cursory glance...

  • Copy link
  • Flag this comment
  • Block
Russell Garner
@rgarner@mastodon.social replied  ·  activity timestamp 5 months ago
@floppy how about this? (naming/style are all over the place but you get the idea)

https://gist.github.com/rgarner/74f17bd661c9f82b024c65076e76abae

  • Copy link
  • Flag this comment
  • Block
Russell Garner
@rgarner@mastodon.social replied  ·  activity timestamp 5 months ago
@floppy I suppose in your use case the only difference would be rather than mounting a fixed set, you'd need to iterate some form of manifest to mount
  • Copy link
  • Flag this comment
  • Block
Russell Garner
@rgarner@mastodon.social replied  ·  activity timestamp 5 months ago
@floppy @manyfold if you don't mind an app restart (and a fatuous example) then is

mount Sidekiq::Web, at: '/admin/sidekiq' if ENV['SIDEKIQ_ENABLED']

out of the question in routes.rb?

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-alpha.8 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login