mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
feat: pull ruby version from mise configuration (#339)
* docs: note that ruby version is sourced from mise * feat: source ruby version from mise configuration * test: test specific ruby version in integration tests, use mise-specified version * test: snapshot update
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
"/mise/installs",
|
||||
"/usr/local/bin/mise",
|
||||
"/etc/mise/config.toml",
|
||||
"/root/.local/state/mise"
|
||||
"/root/.local/state/mise",
|
||||
"mise.toml"
|
||||
],
|
||||
"step": "packages:mise"
|
||||
},
|
||||
@@ -54,8 +55,8 @@
|
||||
],
|
||||
"commands": [
|
||||
{
|
||||
"cmd": "sh -c 'apt-get update \u0026\u0026 apt-get install -y libjemalloc-dev libyaml-dev'",
|
||||
"customName": "install apt packages: libjemalloc-dev libyaml-dev"
|
||||
"cmd": "sh -c 'apt-get update \u0026\u0026 apt-get install -y cargo libjemalloc-dev libyaml-dev rustc'",
|
||||
"customName": "install apt packages: cargo libjemalloc-dev libyaml-dev rustc"
|
||||
}
|
||||
],
|
||||
"inputs": [
|
||||
@@ -73,6 +74,10 @@
|
||||
{
|
||||
"path": "/mise/shims"
|
||||
},
|
||||
{
|
||||
"dest": "mise.toml",
|
||||
"src": "mise.toml"
|
||||
},
|
||||
{
|
||||
"customName": "create mise config",
|
||||
"name": "mise.toml",
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
const (
|
||||
MisePackageStepName = "packages:mise"
|
||||
// System-level config at /etc/mise/config.toml is auto-trusted by mise
|
||||
MiseInstallCommand = "mise install"
|
||||
MiseInstallCommand = "mise install"
|
||||
)
|
||||
|
||||
// represents a app-local mise package
|
||||
|
||||
@@ -255,6 +255,8 @@ func (p *RubyProvider) InstallMisePackages(ctx *generate.GenerateContext, miseSt
|
||||
miseStep.Version(ruby, gemfileVersion, "Gemfile")
|
||||
}
|
||||
|
||||
miseStep.UseMiseVersions(ctx, []string{"ruby"})
|
||||
|
||||
miseStep.AddSupportingAptPackage("libyaml-dev")
|
||||
miseStep.AddSupportingAptPackage("libjemalloc-dev")
|
||||
version := p.getRubyVersion(ctx)
|
||||
|
||||
@@ -19,7 +19,8 @@ The Ruby version is determined in the following order:
|
||||
- Set via the `RAILPACK_RUBY_VERSION` environment variable
|
||||
- Read from the `.ruby-version` file
|
||||
- Read from the `Gemfile` file
|
||||
- Defaults to `3.4.2`
|
||||
- Read from mise-compatible version files (`.tool-versions`, `mise.toml`)
|
||||
- Defaults to `3.4.6`
|
||||
|
||||
## Runtime Variables
|
||||
|
||||
|
||||
@@ -4,3 +4,4 @@ else
|
||||
yjit = "not enabled"
|
||||
end
|
||||
puts "Hello from Ruby 3! YJIT is #{yjit}."
|
||||
puts "Ruby version: #{RUBY_VERSION}"
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
[
|
||||
{
|
||||
"expectedOutput": "Hello from Ruby 3! YJIT is enabled."
|
||||
}
|
||||
{
|
||||
"expectedOutput": [
|
||||
"Hello from Ruby 3! YJIT is enabled.",
|
||||
"Ruby version: 3.2.1"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
require 'sinatra'
|
||||
|
||||
puts "Hello from Sinatra"
|
||||
puts "Ruby version: #{RUBY_VERSION}"
|
||||
|
||||
get '/' do
|
||||
'Choo Choo! Welcome to your Sinatra server 🚅'
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
[
|
||||
{
|
||||
"expectedOutput": "Hello from Sinatra"
|
||||
},
|
||||
{
|
||||
"httpCheck": {
|
||||
"path": "/",
|
||||
"expected": 200,
|
||||
"internalPort": 4567
|
||||
{
|
||||
"expectedOutput": [
|
||||
"Hello from Sinatra",
|
||||
"Ruby version: 3.1.2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"httpCheck": {
|
||||
"path": "/",
|
||||
"expected": 200,
|
||||
"internalPort": 4567
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
puts "Hello from Ruby"
|
||||
puts "Ruby version: #{RUBY_VERSION}"
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
[tools]
|
||||
ruby = "3.3.0"
|
||||
@@ -1,5 +1,8 @@
|
||||
[
|
||||
{
|
||||
"expectedOutput": "Hello from Ruby"
|
||||
}
|
||||
{
|
||||
"expectedOutput": [
|
||||
"Hello from Ruby",
|
||||
"Ruby version: 3.3.0"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user