Module: RBS::Collection::Sources

Defined in:
lib/rbs/collection/sources.rb,
lib/rbs/collection/sources/git.rb,
lib/rbs/collection/sources/base.rb,
lib/rbs/collection/sources/stdlib.rb,
lib/rbs/collection/sources/rubygems.rb

Defined Under Namespace

Modules: Base Classes: Git, Rubygems, Stdlib

Class Method Summary collapse

Class Method Details

.from_config_entry(source_entry) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rbs/collection/sources.rb', line 11

def self.from_config_entry(source_entry)
  case source_entry['type']
  when 'git', nil # git source by default
    __skip__ = Git.new(**source_entry.slice('name', 'revision', 'remote', 'repo_dir').transform_keys(&:to_sym))
  when 'stdlib'
    Stdlib.instance
  when 'rubygems'
    Rubygems.instance
  else
    raise
  end
end