Skip to content

Commit

Permalink
Add support for Ruby 2.2
Browse files Browse the repository at this point in the history
* Use Ruby 2.2.6 from RubyInstaller on Windows since there is no more
  recent release of Ruby 2.2.
  • Loading branch information
eregon committed Feb 6, 2020
1 parent a01ba37 commit f422c05
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
os: [ ubuntu-16.04, ubuntu-18.04, macos-latest, windows-latest ]
# Use various version syntaxes here for testing
ruby: [ .ruby-version, 2.3, 2.7.0, ruby-head, jruby, truffleruby, truffleruby-head, rubinius ]
ruby: [ .ruby-version, 2.2, 2.3, 2.7.0, ruby-head, jruby, truffleruby, truffleruby-head, rubinius ]
exclude:
- os: windows-latest
ruby: truffleruby
Expand All @@ -34,7 +34,7 @@ jobs:
ruby-version: ${{ matrix.ruby }}
- run: ruby --version
- run: ridk version
if: matrix.os == 'windows-latest' && !startsWith(matrix.ruby, '2.3')
if: matrix.os == 'windows-latest' && !startsWith(matrix.ruby, '2.3') && !startsWith(matrix.ruby, '2.2')
- name: Subprocess test
run: ruby test_subprocess.rb
- name: OpenSSL version
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:

| Interpreter | Versions |
| ----------- | -------- |
| Ruby | 2.3.0 - 2.3.8, 2.4.0 - 2.4.9, 2.5.0 - 2.5.7, 2.6.0 - 2.6.5, 2.7.0, head |
| Ruby | 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.9, 2.5.0 - 2.5.7, 2.6.0 - 2.6.5, 2.7.0, head |
| JRuby | 9.2.9.0 |
| TruffleRuby | 19.3.0, 19.3.1, head |
| Rubinius | 4.14 |

Note that Ruby 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life,
which means Ruby 2.3 is unmaintained and considered insecure.
Note that Ruby 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life,
which means Ruby 2.3 is unmaintained and considered insecure.
On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained.
Ruby 2.2 resolves to 2.2.6 on Windows (last build from RubyInstaller) and 2.2.10 otherwise.

### Supported Platforms

Expand Down
4 changes: 3 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion generate-windows-versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'yaml'
require 'json'

min_version = '2.2.6'
url = 'https://raw.githubusercontent.com/oneclick/rubyinstaller.org-website/master/_data/downloads.yaml'
entries = YAML.load(Net::HTTP.get(URI(url)), symbolize_names: true)

Expand All @@ -18,7 +19,7 @@
}.sort_by { |version, entry|
version
}.select { |version, entry|
version >= "2.3"
Gem::Version.new(version) >= Gem::Version.new(min_version)
}.map { |version, entry|
[version, entry[:href]]
}.to_h
Expand Down
1 change: 1 addition & 0 deletions ruby-builder-versions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export function getVersions(platform) {
const versions = {
"ruby": [
"2.2.10",
"2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8",
"2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9",
"2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7",
Expand Down
1 change: 1 addition & 0 deletions windows-versions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const versions = {
"2.2.6": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-x64-mingw32.7z",
"2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z",
"2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z",
"2.3.3": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-x64-mingw32.7z",
Expand Down
2 changes: 1 addition & 1 deletion windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function install(platform, ruby) {
const newPath = setupPath(msys2, rubyPrefix)
core.exportVariable('PATH', newPath)

if (version.startsWith('2.3')) {
if (version.startsWith('2.2') || version.startsWith('2.3')) {
core.exportVariable('SSL_CERT_FILE', `${hostedRuby}\\ssl\\cert.pem`)
}

Expand Down

0 comments on commit f422c05

Please sign in to comment.