Skip to content

Commit 73fe30d

Browse files
authored
Merge pull request rbenv#1214 from rbenv/script-update-rbx-defs
Added generate script for rbx definitions used postmodern/ruby-versions.
2 parents 2c642bd + 60a1706 commit 73fe30d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

script/update-rbx-defs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'open-uri'
4+
require 'pathname'
5+
6+
file = "https://raw.githubusercontent.com/postmodern/ruby-versions/master/rubinius/checksums.sha256"
7+
dir = Pathname(File.expand_path("share/ruby-build"))
8+
9+
open(file).each do |package|
10+
sha256, filename = package.chomp.split
11+
version = filename.match(/rubinius-(3.[\d\.]+).tar.bz2/)
12+
13+
next unless version
14+
15+
version = version[1]
16+
defname = "rbx-#{version}"
17+
18+
next if File.exists?(dir.join(defname))
19+
20+
definition = <<-TEMPLATE
21+
require_llvm 3.7
22+
install_package "openssl-1.0.2o" "https://www.openssl.org/source/openssl-1.0.2o.tar.gz#ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d" mac_openssl --if has_broken_mac_openssl
23+
install_package "rubinius-#{version}" "https://rubinius-releases-rubinius-com.s3.amazonaws.com/rubinius-#{version}.tar.bz2##{sha256}" rbx
24+
TEMPLATE
25+
26+
File.open(dir.join(defname), "w"){|f| f.write definition}
27+
end

0 commit comments

Comments
 (0)