Class: Fvm::CLI::Installer
- Inherits:
-
Object
- Object
- Fvm::CLI::Installer
- Defined in:
- lib/fvm/cli/installer.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#executables ⇒ Object
readonly
Returns the value of attribute executables.
Instance Method Summary collapse
-
#initialize(dir, executables) ⇒ Installer
constructor
A new instance of Installer.
- #install(zip_url, version) ⇒ Object
- #installations ⇒ Object
Constructor Details
#initialize(dir, executables) ⇒ Installer
Returns a new instance of Installer.
10 11 12 13 |
# File 'lib/fvm/cli/installer.rb', line 10 def initialize( dir, executables ) @dir = Pathname.new( dir ). @executables = executables end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
9 10 11 |
# File 'lib/fvm/cli/installer.rb', line 9 def dir @dir end |
#executables ⇒ Object (readonly)
Returns the value of attribute executables.
9 10 11 |
# File 'lib/fvm/cli/installer.rb', line 9 def executables @executables end |
Instance Method Details
#install(zip_url, version) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fvm/cli/installer.rb', line 15 def install( zip_url, version ) # download the zip and unzip it temp = download zip_url # create the destination directory name for this sdk version dest = File.join( dir, "flex_sdk_#{version}" ) # move the unzipped directory to the destination move = FileUtils.mv temp, dest # make all executables in bin actually executable make_executables_executable! dest # return the destination dest end |
#installations ⇒ Object
28 29 30 |
# File 'lib/fvm/cli/installer.rb', line 28 def installations Dir[ File.join( dir, 'flex_sdk_*' ) ].map { |d| Installation.new( d ) } end |