mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-17 14:26:45 -06:00
- introduce Cask::Source to encapsulate different types of loading behind a consistent interface - mostly this is method-level reorg, kept refactoring of the internals of these methods to a minimum for this pass - this is preparatory cleanup for adding the ability to represent a cask without a backing ruby file
19 lines
337 B
Ruby
19 lines
337 B
Ruby
module Cask::Source; end
|
|
|
|
require 'cask/source/path'
|
|
require 'cask/source/tap'
|
|
require 'cask/source/uri'
|
|
|
|
module Cask::Source
|
|
def self.sources
|
|
[
|
|
Cask::Source::URI,
|
|
Cask::Source::Path,
|
|
Cask::Source::Tap,
|
|
]
|
|
end
|
|
|
|
def self.for_query(query)
|
|
sources.find { |source| source.me?(query) }.new(query)
|
|
end
|
|
end
|