-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
The code for loading dependencies is extremely complex and hairy. It should be possible to dramatically simplify it by just checking a projects Gemfile.lock with something like this:
lockfile = Bundler::LockfileParser.new(Bundler.read_file(Pathname.new("~/tmp/cool/Gemfile.lock").expand_path.to_s))
names = lockfile.dependencies.map {|d| d.name}
names.map do |n|
{ name: n, path: Bundler.rubygems.find_name(n).first.full_gem_path }
endShould be able to remove huge globs of code in the following files:
https://github.com/rsense/rsense-server/blob/master/lib/rsense/server/command.rb
https://github.com/rsense/rsense-server/blob/master/lib/rsense/server/load_path.rb
https://github.com/rsense/rsense-server/blob/master/lib/rsense/server/gem_path.rb
https://github.com/rsense/rsense-server/blob/master/lib/rsense/server/command/preload.rb
Getting this done might even remove the problems we currently have with loading larger projects like Rails apps.
Reactions are currently unavailable