Class: ArduinoCI::ArduinoDownloaderOSX
- Inherits:
-
ArduinoDownloader
- Object
- ArduinoDownloader
- ArduinoCI::ArduinoDownloaderOSX
- Defined in:
- lib/arduino_ci/arduino_downloader_osx.rb
Overview
Manage the OSX download & install of Arduino
Class Method Summary collapse
-
.existing_executable ⇒ string
The executable Arduino file in an existing installation, or nil.
-
.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).
-
.extracter ⇒ 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, force_installed_executable, #initialize, #install, must_implement, #package_url
Constructor Details
This class inherits a constructor from ArduinoCI::ArduinoDownloader
Class Method Details
.existing_executable ⇒ string
The executable Arduino file in an existing installation, or nil
22 23 24 |
# File 'lib/arduino_ci/arduino_downloader_osx.rb', line 22 def self.existing_executable Host.which("arduino-cli") end |
.extract(package_file) ⇒ bool
Extract the package_file to extracted_file
45 46 47 |
# File 'lib/arduino_ci/arduino_downloader_osx.rb', line 45 def self.extract(package_file) system(extracter, "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_osx.rb', line 16 def self.extracted_file "arduino-cli" end |
.extracter ⇒ string
The technology that will be used to extract the download (for logging purposes)
39 40 41 |
# File 'lib/arduino_ci/arduino_downloader_osx.rb', line 39 def self.extracter "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_osx.rb', line 10 def package_file "arduino-cli_#{@desired_version}_macOS_64bit.tar.gz" end |
#prepare ⇒ string
Make any preparations or run any checks prior to making changes
28 29 30 31 32 33 34 |
# File 'lib/arduino_ci/arduino_downloader_osx.rb', line 28 def prepare reqs = [self.class.extracter] reqs.each do |req| return "#{req} does not appear to be installed!" unless Host.which(req) end nil end |