homebrew-cask-versions/lib/cask/source.rb
phinze ca0dbf84a6 pull cask loading out into classes
- 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
2013-11-16 13:40:51 -06:00

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