refactor devcontainer for simpler ruby install

This commit is contained in:
Dylan Knutson
2025-07-20 17:36:28 +00:00
parent 6ba5a70bb5
commit 198ab946d7
10 changed files with 77 additions and 11 deletions

23
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM mcr.microsoft.com/devcontainers/base:debian-12
RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -qqy \
build-essential \
autoconf \
libssl-dev \
libyaml-dev \
zlib1g-dev \
libffi-dev \
libgmp-dev \
rustc \
watchman \
libsqlite3-dev \
pkg-config
USER vscode
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv
ENV PATH="/home/vscode/.rbenv/bin:/home/vscode/.rbenv/shims:$PATH"
RUN echo 'eval "$(rbenv init - --no-rehash bash)"' >> ~/.bashrc
RUN git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
RUN rbenv install 3.4.4 && \
rbenv global 3.4.4
# convenience aliases
RUN echo 'alias rspec="bundle exec rspec"' >> ~/.bashrc

View File

@@ -3,7 +3,9 @@
{
"name": "Ruby",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/ruby:1-3.4-bullseye",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers-extra/features/npm-package:1": {
"package": "backlog.md"
@@ -25,7 +27,6 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sudo apt update && sudo apt install --no-install-recommends --no-install-suggests -qy watchman",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.

1
.gitignore vendored
View File

@@ -6,6 +6,7 @@
/pkg/
/spec/reports/
/tmp/
/vendor/
# rspec failure tracking
.rspec_status

9
.vscode/launch.json vendored
View File

@@ -6,17 +6,14 @@
"configurations": [
{
"type": "rdbg",
"name": "Debug current file with rdbg",
"name": "rdbg - demo_functionality.rb",
"request": "launch",
"script": "${file}",
"askParameters": true,
"rdbgPath": "~/.rbenv/shims/rdbg"
"script": "demo_functionality.rb",
},
{
"type": "rdbg",
"name": "Attach with rdbg",
"name": "rdbg - attach to rspec",
"request": "attach",
"rdbgPath": "~/.rbenv/shims/rdbg"
}
]
}

View File

@@ -2,11 +2,13 @@
"editor.formatOnSave": true,
"workbench.editor.titleScrollbarSizing": "large",
"rubyLsp.formatter": "syntax_tree",
"rubyLsp.addonSettings": {
"Ruby LSP RSpec": {
"debug": true
}
},
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp"
},
"rubyLsp.rubyVersionManager": {
"rbenvExecutablePath": "/usr/local/share/rbenv/bin/rbenv",
},
"rdbg.useBundler": false,
}

View File

@@ -12,6 +12,7 @@ group :development do
gem "bundler-audit"
gem "lefthook"
gem "tapioca", "~> 0.17"
gem "ruby-lsp-rspec", require: false
end
group :development, :test do

View File

@@ -51,6 +51,7 @@ GEM
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
language_server-protocol (3.17.0.5)
lefthook (1.12.2)
logger (1.7.0)
method_source (1.1.0)
@@ -96,6 +97,12 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.4)
ruby-lsp (0.25.0)
language_server-protocol (~> 3.17.0)
prism (>= 1.2, < 2.0)
rbs (>= 3, < 5)
ruby-lsp-rspec (0.1.26)
ruby-lsp (~> 0.25.0)
securerandom (0.4.1)
sorbet (0.5.12222)
sorbet-static (= 0.5.12222)
@@ -148,6 +155,7 @@ DEPENDENCIES
pry
rake (~> 13.0)
rspec (~> 3.0)
ruby-lsp-rspec
sorbet-runtime
sorbet-static-and-runtime
sqlite3 (~> 1.4)

View File

@@ -0,0 +1,9 @@
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `language_server-protocol` gem.
# Please instead update this file by running `bin/tapioca gem language_server-protocol`.
# THIS IS AN EMPTY RBI FILE.
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem

View File

@@ -0,0 +1,15 @@
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `ruby-lsp-rspec` gem.
# Please instead update this file by running `bin/tapioca gem ruby-lsp-rspec`.
# source://ruby-lsp-rspec//lib/ruby_lsp_rspec/version.rb#4
module RubyLsp; end
# source://ruby-lsp-rspec//lib/ruby_lsp_rspec/version.rb#5
module RubyLsp::RSpec; end
# source://ruby-lsp-rspec//lib/ruby_lsp_rspec/version.rb#6
RubyLsp::RSpec::VERSION = T.let(T.unsafe(nil), String)

9
sorbet/rbi/gems/ruby-lsp@0.25.0.rbi generated Normal file
View File

@@ -0,0 +1,9 @@
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `ruby-lsp` gem.
# Please instead update this file by running `bin/tapioca gem ruby-lsp`.
# THIS IS AN EMPTY RBI FILE.
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem