Class: Doubleshot::Resolver::GemResolver::Source
- Defined in:
- lib/doubleshot/resolver/gem_resolver/source.rb
Direct Known Subclasses
Constant Summary collapse
- SUPPORTED_PLATFORMS =
[ /\bjava\b/i, /^jruby$/i, /^ruby$/i ]
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(uri) ⇒ Source
constructor
A new instance of Source.
Constructor Details
#initialize(uri) ⇒ Source
Returns a new instance of Source.
26 27 28 |
# File 'lib/doubleshot/resolver/gem_resolver/source.rb', line 26 def initialize(uri) @uri = uri end |
Class Method Details
.map(*mime_types) ⇒ Object
9 10 11 12 13 |
# File 'lib/doubleshot/resolver/gem_resolver/source.rb', line 9 def self.map(*mime_types) mime_types.each do |mime_type| mappings[mime_type.to_s] = self end end |
.mappings ⇒ Object
15 16 17 |
# File 'lib/doubleshot/resolver/gem_resolver/source.rb', line 15 def self.mappings @@mappings ||= {} end |
.new(uri) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/doubleshot/resolver/gem_resolver/source.rb', line 19 def self.new(uri) uri = URI.parse(uri.to_s) instance = mappings[uri.scheme].allocate instance.send(:initialize, uri) instance end |