mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-17 06:16:47 -06:00
20 lines
346 B
Ruby
20 lines
346 B
Ruby
class Cask::Source::Path
|
|
def self.me?(query)
|
|
File.file?(query)
|
|
end
|
|
|
|
attr_reader :path
|
|
|
|
def initialize(path)
|
|
@path = Pathname(path).expand_path
|
|
end
|
|
|
|
def load
|
|
require path
|
|
Cask.const_get(cask_class_name).new
|
|
end
|
|
|
|
def cask_class_name
|
|
path.basename.to_s.sub(/\.rb/, '').split('-').map(&:capitalize).join
|
|
end
|
|
end
|