edwardila
(Edward Skalibog)
1
Hi, Discourse team
I want to offer you an interesting solution for Gemfile in the plugin directory and adding external gems if they are needed
# Load plugins' Gemfiles
Dir.glob File.expand_path("../plugins/*/{Gemfile}", __FILE__) do |file|
eval_gemfile file
end
If we add this to the main Gemfile, we can load Gemfiles from plugins.
Lets discuss this solution.
P.S. DSL doc for eval_gemfile => https://apidock.com/ruby/v2_6_3/Bundler/Dsl/eval_gemfile
Falco
(Falco)
2
That is interesting! At the moment plugins can require gems by listing the whole recursive dependency tree in the plugin.rb file, eg:
edwardila
(Edward Skalibog)
3
Thanks, this is what I was looking for.
But I think my decision is more clear and understandable for me.
Reasons(imho):
- We leave plugin.rb more clean
- Gemfile is more understandable for rails devs.
sam
(Sam Saffron)
4
Unfortunately this means that the lock file will become a moving target, and we ship that in source control.
Gem files are nice, but until we can ship delta lock files this type of solution will not work.