lib/rbs/collection/config/lockfile_generator.rb in rbs-3.0.0.dev.2 vs lib/rbs/collection/config/lockfile_generator.rb in rbs-3.0.0.dev.3

- old
+ new

@@ -103,30 +103,32 @@ # If rbs_collection.lock.yaml contain the gem, use it. # Else find the gem from gem_collection. unless locked source = if src_data - Sources.from_config_entry(src_data) + Sources.from_config_entry(src_data, base_directory: config.config_path.dirname) else - find_source(name: name) or return + find_source(name: name) end - installed_version = version - best_version = find_best_version(version: installed_version, versions: source.versions(name)) + if source + installed_version = version + best_version = find_best_version(version: installed_version, versions: source.versions(name)) - locked = { - name: name, - version: best_version.to_s, - source: source, - } + locked = { + name: name, + version: best_version.to_s, + source: source, + } + end end - locked or raise + if locked + lockfile.gems[name] = locked - lockfile.gems[name] = locked - - locked[:source].dependencies_of(locked[:name], locked[:version])&.each do |dep| - assign_stdlib(name: dep["name"], from_gem: name) + locked[:source].dependencies_of(locked[:name], locked[:version])&.each do |dep| + assign_stdlib(name: dep["name"], from_gem: name) + end end gem_hash[name].dependencies.each do |dep| spec = gem_hash[dep.name] assign_gem(name: dep.name, version: spec.version, src_data: nil, ignored_gems: ignored_gems)