Class: Munola::Resolver

Inherits:
Enola::Resolver
  • Object
show all
Defined in:
lib/munola/channel.rb

Overview

The binary this channel drives is fetched from the fork's releases; until the first one is cut, MUNOLA_BINARY names a binary to drive instead, and every command says which one answered.

Instance Method Summary collapse

Constructor Details

#initialize(override: ENV.fetch("MUNOLA_BINARY", nil), **options) ⇒ Resolver

Returns a new instance of Resolver.



16
17
18
19
# File 'lib/munola/channel.rb', line 16

def initialize(override: ENV.fetch("MUNOLA_BINARY", nil), **options)
  super(**options)
  @override = override
end

Instance Method Details

#resolveObject

Raises:

  • (Enola::Unavailable)


21
22
23
24
25
26
27
# File 'lib/munola/channel.rb', line 21

def resolve
  return super unless @override

  raise Enola::Unavailable, "MUNOLA_BINARY names #{@override}, which is not executable" unless File.executable?(@override)

  Found.new(@override, "MUNOLA_BINARY (#{Enola::Probe.new(@override).version || 'no version answered'})")
end