Can we simplify Gemfile vs .gemspec when installing in an engine? It should at least be possible to automatically require all things specified in the .gemspec file. People not familiar with creating gems and engines have been confused about the fact that you need to manually require dependencies when specifying them in a .gemspec. Not sure this is something we should solve though.
Here's an example of requiring all runtime dependencies:
Gem.loaded_specs["admin"].runtime_dependencies.each do |dep|
begin
require dep.name
rescue LoadError
require dep.name.gsub("-", "/")
end
end
require "admin/engine"
module Admin
# Your code goes here...
end
However, this does not handle gems such as godmin-tags that needs to require a file called godmin/tags. How does bundler handle this?
Can we simplify Gemfile vs .gemspec when installing in an engine? It should at least be possible to automatically require all things specified in the .gemspec file. People not familiar with creating gems and engines have been confused about the fact that you need to manually require dependencies when specifying them in a .gemspec. Not sure this is something we should solve though.
Here's an example of requiring all runtime dependencies:
However, this does not handle gems such asgodmin-tagsthat needs to require a file calledgodmin/tags. How does bundler handle this?