Skip to content

Simplify dependency managment in engine installs #227

Description

@jensljungblad

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions