I want to use some Padrino helpers (tag, content_tag etc.) in a helper file of my extension to generate some HTML.
What is the proper way to do this? I dug through the Middleman source and found some places where it’s done like this:
if !defined?(::Padrino::Helpers)
require 'vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/support_lite'
require 'vendored-middleman-deps/padrino-helpers-0.11.2/lib/padrino-helpers'
end
[...]
include Padrino::Helpers::TagHelpers
But that doesn’t seem like a future-proof way to do it. If the version of padrino-core
or padrino-helpers
changes, it will break…
What’s the recommended way to access Padrino (helpers) in extensions?