Class: ArduinoCI::ArduinoDownloaderLinux
- Inherits:
-
ArduinoDownloader
- Object
- ArduinoDownloader
- ArduinoCI::ArduinoDownloaderLinux
- Defined in:
- lib/arduino_ci/arduino_downloader_linux.rb
Overview
Manage the linux download & install of Arduino
Class Method Summary collapse
-
.extract(package_file) ⇒ bool
Extract the package_file to extracted_file.
-
.extracted_file ⇒ string
The local file (dir) name of the extracted IDE package (zip/tar/etc).
-
.extractor ⇒ string
The technology that will be used to extract the download (for logging purposes).
Instance Method Summary collapse
-
#package_file ⇒ string
The local filename of the desired IDE package (zip/tar/etc).
-
#prepare ⇒ string
Make any preparations or run any checks prior to making changes.
Methods inherited from ArduinoDownloader
autolocated_executable, #download, downloader, #execute, existing_executable, force_installed_executable, #initialize, #install, must_implement, #package_url
Constructor Details
This class inherits a constructor from ArduinoCI::ArduinoDownloader
Class Method Details
.extract(package_file) ⇒ bool
Extract the package_file to extracted_file
39 40 41 |
# File 'lib/arduino_ci/arduino_downloader_linux.rb', line 39 def self.extract(package_file) system(extractor, "xf", package_file, extracted_file) end |
.extracted_file ⇒ string
The local file (dir) name of the extracted IDE package (zip/tar/etc)
16 17 18 |
# File 'lib/arduino_ci/arduino_downloader_linux.rb', line 16 def self.extracted_file "arduino-cli" end |
.extractor ⇒ string
The technology that will be used to extract the download (for logging purposes)
33 34 35 |
# File 'lib/arduino_ci/arduino_downloader_linux.rb', line 33 def self.extractor "tar" end |
Instance Method Details
#package_file ⇒ string
The local filename of the desired IDE package (zip/tar/etc)
10 11 12 |
# File 'lib/arduino_ci/arduino_downloader_linux.rb', line 10 def package_file "arduino-cli_#{@desired_version}_Linux_64bit.tar.gz" end |
#prepare ⇒ string
Make any preparations or run any checks prior to making changes
22 23 24 25 26 27 28 |
# File 'lib/arduino_ci/arduino_downloader_linux.rb', line 22 def prepare reqs = [self.class.extractor] reqs.each do |req| return "#{req} does not appear to be installed!" unless Host.which(req) end nil end |