mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-19 06:16:46 -06:00
* convert existing Cask:: namespace to Hbc:: * move Homebrew-fork code under Hbc:: * move freestanding classes such as Tty and TopologicalHash under Hbc:: * recast HOMEBREW_CASK_ constants as HBC_ * modify our Homebrew Formula for backward compatibility * devscripts and dev docs
33 lines
935 B
Ruby
33 lines
935 B
Ruby
class Hbc::DSL::Appcast
|
|
|
|
# todo :latest_version is considered experimental
|
|
# and may be removed
|
|
|
|
APPCAST_FORMATS = Set.new [
|
|
:sparkle, # first one is the default
|
|
:plaintext,
|
|
:unknown,
|
|
]
|
|
|
|
attr_reader :parameters, :sha256, :format, :latest_version
|
|
|
|
def initialize(uri, parameters={})
|
|
@parameters = parameters
|
|
@uri = Hbc::UnderscoreSupportingURI.parse(uri)
|
|
@sha256 = @parameters[:sha256]
|
|
@latest_version = @parameters[:latest_version] # experimental
|
|
@format = @parameters[:format]
|
|
@format = APPCAST_FORMATS.first if @format.nil?
|
|
unless APPCAST_FORMATS.include?(@format)
|
|
raise "invalid appcast format: '#{@format.inspect}'"
|
|
end
|
|
end
|
|
|
|
def to_yaml
|
|
[@uri, @parameters].to_yaml
|
|
end
|
|
|
|
def to_s
|
|
@uri.to_s
|
|
end
|
|
end
|