lib/rbs/collection/sources/rubygems.rb in rbs-2.8.4 vs lib/rbs/collection/sources/rubygems.rb in rbs-3.0.0.dev.1

- old
+ new

@@ -8,30 +8,28 @@ # Signatures that are inclduded in gem package as sig/ directory. class Rubygems include Base include Singleton - def has?(config_entry) - gem_sig_path(config_entry) + def has?(name, version) + gem_sig_path(name, version) end - def versions(config_entry) - spec, _ = gem_sig_path(config_entry) + def versions(name) + spec, _ = gem_sig_path(name, nil) spec or raise [spec.version.to_s] end - def install(dest:, config_entry:, stdout:) + def install(dest:, name:, version:, stdout:) # Do nothing because stdlib RBS is available by default - name = config_entry['name'] - version = config_entry['version'] or raise - _, from = gem_sig_path(config_entry) + _, from = gem_sig_path(name, version) stdout.puts "Using #{name}:#{version} (#{from})" end - def manifest_of(config_entry) - _, sig_path = gem_sig_path(config_entry) + def manifest_of(name, version) + _, sig_path = gem_sig_path(name, version) sig_path or raise manifest_path = sig_path.join('manifest.yaml') YAML.safe_load(manifest_path.read) if manifest_path.exist? end @@ -39,11 +37,11 @@ { 'type' => 'rubygems', } end - private def gem_sig_path(config_entry) - RBS::EnvironmentLoader.gem_sig_path(config_entry['name'], config_entry['version']) + private def gem_sig_path(name, version) + RBS::EnvironmentLoader.gem_sig_path(name, version) end end end end end