Sha256: 4ca6930251bba904c10c36c3f225751e8a9ac84434e3531172d603b7931ced6c
Contents?: true
Size: 1.57 KB
Versions: 3
Compression:
Stored size: 1.57 KB
Contents
# Usage: # # Lambdagem::Extract::Ruby.new("2.5.0", # s3: "lambdagems", # build_root: cache_area, # defaults to /tmp/lambdagem # dest: cache_area, # defaults to . (project_root) # ).run # module Lambdagem::Extract class Ruby < Base class NotFound < RuntimeError; end def run puts "Looking for #{full_ruby_name}" clean_downloads(:rubies) if @options[:clean] tarball_path = download_ruby unpack_tarball(tarball_path) end def download_ruby url = ruby_url tarball_dest = download_file(url, download_path(File.basename(url))) unless tarball_dest message = "Url: #{url} not found" if @options[:exit_on_error] puts message # exit # TODO: ADD BACK IN else raise NotFound.new(message) end end puts "Tarball downloaded to: #{tarball_dest}" tarball_dest end def download_path(filename) "#{@build_root}/downloads/rubies/#{filename}" end # If only the ruby version is given, then append ruby- in front. Otherwise # leave alone. # # Example: # # 2.5.0 -> ruby-2.5.0-linux-x86_64.tgz # ruby-2.5.0 -> ruby-2.5.0-linux-x86_64.tgz # test-ruby-2.5.0 -> test-ruby-2.5.0-linux-x86_64.tgz def full_ruby_name md = @name.match(/^(\d+\.\d+\.\d+)$/) if md ruby_version = md[1] "ruby-#{ruby_version}-linux-x86_64.tgz" else "#{@name}-linux-x86_64.tgz" end end def ruby_url "#{lambdagems_url}/rubies/#{full_ruby_name}" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
jets-0.5.5 | vendor/lambdagem/lib/lambdagem/extract/ruby.rb |
jets-0.5.4 | vendor/lambdagem/lib/lambdagem/extract/ruby.rb |
jets-0.5.3 | vendor/lambdagem/lib/lambdagem/extract/ruby.rb |