Skip to content

Commit

Permalink
DRY ruby versions a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Jan 17, 2025
1 parent 7d80a5b commit 9077417
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 38 deletions.
38 changes: 7 additions & 31 deletions debian_specs/passenger/passenger_free_ruby.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,14 @@
int
main(int argc, const char *argv[]) {
try_exec("ruby", argc, argv);
try_exec("/usr/bin/ruby4.10", argc, argv);
try_exec("/usr/bin/ruby4.9", argc, argv);
try_exec("/usr/bin/ruby4.8", argc, argv);
try_exec("/usr/bin/ruby4.7", argc, argv);
try_exec("/usr/bin/ruby4.6", argc, argv);
try_exec("/usr/bin/ruby4.5", argc, argv);
try_exec("/usr/bin/ruby4.4", argc, argv);
try_exec("/usr/bin/ruby4.3", argc, argv);
try_exec("/usr/bin/ruby4.2", argc, argv);
try_exec("/usr/bin/ruby4.1", argc, argv);
try_exec("/usr/bin/ruby4.0", argc, argv);
try_exec("/usr/bin/ruby3.10", argc, argv);
try_exec("/usr/bin/ruby3.9", argc, argv);
try_exec("/usr/bin/ruby3.8", argc, argv);
try_exec("/usr/bin/ruby3.7", argc, argv);
try_exec("/usr/bin/ruby3.6", argc, argv);
try_exec("/usr/bin/ruby3.5", argc, argv);
try_exec("/usr/bin/ruby3.4", argc, argv);
try_exec("/usr/bin/ruby3.3", argc, argv);
try_exec("/usr/bin/ruby3.2", argc, argv);
try_exec("/usr/bin/ruby3.1", argc, argv);
try_exec("/usr/bin/ruby3.0", argc, argv);
try_exec("/usr/bin/ruby2.7", argc, argv);
try_exec("/usr/bin/ruby2.6", argc, argv);
try_exec("/usr/bin/ruby2.5", argc, argv);
try_exec("/usr/bin/ruby2.4", argc, argv);
try_exec("/usr/bin/ruby2.3", argc, argv);
try_exec("/usr/bin/ruby2.2", argc, argv);
try_exec("/usr/bin/ruby2.1", argc, argv);
try_exec("/usr/bin/ruby2.0", argc, argv);
char* exe = "/usr/bin/rubyX.XX";
for(int m = 4; m > 0; m--) {
for(int n = 10; n > -1; n--) {
sprintf(exe,"/usr/bin/ruby%i.%i", m, n);
try_exec(exe, argc, argv);
}
}
try_exec("/usr/bin/ruby1.9.1", argc, argv);
try_exec("/usr/bin/ruby1.8", argc, argv);

fprintf(stderr, PROGRAM_NAME ": cannot find suitable Ruby interpreter\n");
return 1;
Expand Down
8 changes: 1 addition & 7 deletions debian_specs/passenger/passenger_system_ruby.c.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<%
require File.dirname(File.absolute_path(__FILE__)) + '/helpers'
all_ruby_versions_to_try = distro_ruby_versions.reverse +
['4.10', '4.9',
'4.8', '4.7', '4.6', '4.5', '4.4',
'4.3', '4.2', '4.1', '4.0', '3.10',
'3.9', '3.8', '3.7', '3.6', '3.5',
'3.4', '3.3', '3.2', '3.1', '3.0',
'2.7', '2.6', '2.5', '2.4', '2.3',
'2.2', '2.1', '2.0', '1.9.1', '1.8']
(1..4).to_a.product((0..10).to_a).map{|x,y|"#{x}.#{y}"}.reverse.push('1.9.1')
all_ruby_versions_to_try.uniq!
-%>
/*
Expand Down

0 comments on commit 9077417

Please sign in to comment.