Module: Gap::Ruby25

Defined in:
lib/gap50/ext/ruby25.rb

Constant Summary collapse

URL =
"https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.3-1/rubyinstaller-2.5.3-1-x86.7z"

Class Method Summary collapse

Class Method Details

.provide(path = "samdev/ruby25") ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gap50/ext/ruby25.rb', line 4

def self.provide(path = "samdev/ruby25")
    @ruby = Samsara.new "ruby.sam"
    ruby_exe = "#{path}/rubyinstaller-2.5.3-1-x86/bin/ruby.exe"
    unless FileTest.exists?(ruby_exe)
        unless @ruby.has_file_in? "rubyinstaller-2.5.3-1-x86.7z" 
            Gap::Maker.new do
                FROM "ruby.sam"
                aria = File.expand_path Gap::Aria2C.genfile "aria2c.exe"    
                system "cd #{@temp} && #{aria} #{URL}"
            end
            @ruby = Samsara.new "ruby.sam"
        end

        file = @ruby.genfile("rubyinstaller-2.5.3-1-x86.7z")
        sza = Gap::SevenZA.genfile "7za.exe"
        system "#{sza} x -aou -o#{path} #{file}"
    end
    ruby_exe
end