Class: Mnenv::Installers::BinaryInstaller

Inherits:
Mnenv::Installer show all
Defined in:
lib/mnenv/installers/binary_installer.rb

Constant Summary collapse

PACKED_MN_REPO =
'metanorma/packed-mn'
RELEASES_URL =
"https://api.github.com/repos/#{PACKED_MN_REPO}/releases".freeze

Instance Attribute Summary

Attributes inherited from Mnenv::Installer

#source, #version

Instance Method Summary collapse

Methods inherited from Mnenv::Installer

#initialize, #install, #installed?

Constructor Details

This class inherits a constructor from Mnenv::Installer

Instance Method Details

#make_executableObject



27
28
29
30
31
32
33
34
35
# File 'lib/mnenv/installers/binary_installer.rb', line 27

def make_executable
  # Linux/macOS: make the binary executable
  binary_path = File.join(version_dir, 'metanorma')
  FileUtils.chmod(0o755, binary_path) if File.exist?(binary_path)

  # Windows: .exe files don't need chmod
  exe_path = File.join(version_dir, 'metanorma.exe')
  nil unless File.exist?(exe_path)
end

#perform_installationObject



22
23
24
25
# File 'lib/mnenv/installers/binary_installer.rb', line 22

def perform_installation
  download_binary
  make_executable
end

#verify_prerequisites!Object



18
19
20
# File 'lib/mnenv/installers/binary_installer.rb', line 18

def verify_prerequisites!
  verify_version_available!
end