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.
- .existing_installation ⇒ string
The path to the directory of an existing installation, or nil.
- .find_existing_arduino_dir(paths) ⇒ string
An existing Arduino directory in one of the given directories, or nil.
- .find_existing_arduino_exe(paths) ⇒ string
An existing Arduino file in one of the given directories, or nil.
- .force_install_location ⇒ String
The location where a forced install will go.
- .force_installed_executable ⇒ string
The executable Arduino file in a forced installation, or nil.
Instance Method Summary collapse
- #extracted_file ⇒ string
The local file (dir) name of the extracted IDE package (zip/tar/etc).
- #package_file ⇒ string
The local filename of the desired IDE package (zip/tar/etc).
Methods inherited from ArduinoDownloader
autolocated_executable, autolocated_installation, #download, #downloader, #execute, #extract, #extracter, #initialize, #install, must_implement, #package_url, #prepare
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
51 52 53 | # File 'lib/arduino_ci/arduino_downloader_osx.rb', line 51 def self.existing_executable self.find_existing_arduino_exe(["/Applications/Arduino.app"]) end |
.existing_installation ⇒ string
The path to the directory of an existing installation, or nil
45 46 47 | # File 'lib/arduino_ci/arduino_downloader_osx.rb', line 45 def self.existing_installation self.find_existing_arduino_dir(["/Applications/Arduino.app"]) end |
.find_existing_arduino_dir(paths) ⇒ string
An existing Arduino directory in one of the given directories, or nil
29 30 31 | # File 'lib/arduino_ci/arduino_downloader_osx.rb', line 29 def self.find_existing_arduino_dir(paths) paths.find(&File.method(:exist?)) end |
.find_existing_arduino_exe(paths) ⇒ string
An existing Arduino file in one of the given directories, or nil
36 37 38 39 40 41 | # File 'lib/arduino_ci/arduino_downloader_osx.rb', line 36 def self.find_existing_arduino_exe(paths) paths.find do |path| exe = File.join(path, "MacOS", "Arduino") File.exist? exe end end |
.force_install_location ⇒ String
Returns The location where a forced install will go.
21 22 23 24 | # File 'lib/arduino_ci/arduino_downloader_osx.rb', line 21 def self.force_install_location # include the .app extension File.join(ENV['HOME'], 'Arduino.app') end |
.force_installed_executable ⇒ string
The executable Arduino file in a forced installation, or nil
57 58 59 | # File 'lib/arduino_ci/arduino_downloader_osx.rb', line 57 def self.force_installed_executable self.find_existing_arduino_exe([self.force_install_location]) end |
Instance Method Details
#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 extracted_file "Arduino.app" end |
#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-#{@desired_ide_version}-macosx.zip" end |