Module: Javy::Installer

Defined in:
ext/javy/javy.rb

Class Method Summary collapse

Class Method Details

.call(target:, platform:, version:) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'ext/javy/javy.rb', line 63

def self.call(target:, platform:, version:)
  asset = Asset.new(
    platform: platform,
    version: version,
    owner: "Shopify",
    repository: "javy",
    basename: "javy"
  )

  downloaded = asset.download(target: target)
  raise InstallationError.asset_not_found(platform: platform, version: version, url: asset.url) unless downloaded

  true
end

.installed?(target:) ⇒ Boolean

Returns:

  • (Boolean)


78
79
80
# File 'ext/javy/javy.rb', line 78

def self.installed?(target:)
  File.executable?(target)
end