Class: RBS::Collection::Sources::Rubygems
- Inherits:
-
Object
- Object
- RBS::Collection::Sources::Rubygems
- Includes:
- Singleton
- Defined in:
- lib/rbs/collection/sources/rubygems.rb
Overview
Signatures that are inclduded in gem package as sig/ directory.
Instance Method Summary collapse
- #has?(config_entry) ⇒ Boolean
- #install(dest:, config_entry:, stdout:) ⇒ Object
- #to_lockfile ⇒ Object
- #versions(config_entry) ⇒ Object
Instance Method Details
#has?(config_entry) ⇒ Boolean
10 11 12 |
# File 'lib/rbs/collection/sources/rubygems.rb', line 10 def has?(config_entry) gem_sig_path(config_entry) end |
#install(dest:, config_entry:, stdout:) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/rbs/collection/sources/rubygems.rb', line 20 def install(dest:, config_entry:, 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) stdout.puts "Using #{name}:#{version} (#{from})" end |
#to_lockfile ⇒ Object
28 29 30 31 32 |
# File 'lib/rbs/collection/sources/rubygems.rb', line 28 def to_lockfile { 'type' => 'rubygems', } end |
#versions(config_entry) ⇒ Object
14 15 16 17 18 |
# File 'lib/rbs/collection/sources/rubygems.rb', line 14 def versions(config_entry) spec, _ = gem_sig_path(config_entry) spec or raise [spec.version.to_s] end |