From b629e8f32a0aace6bbf42d81253ac2669371cee1 Mon Sep 17 00:00:00 2001 From: Manuel Fittko Date: Fri, 8 Nov 2024 12:29:48 +0100 Subject: [PATCH 1/2] Add Ruby development container setup with Rubocop integration --- .devcontainer/Dockerfile | 30 +++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 21 +++++++++++++++++++ Gemfile | 3 +++ Gemfile.lock | 36 +++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..ac6aa1f --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,30 @@ +FROM ruby:3.3 + +RUN apt-get update && apt-get install -y \ + build-essential \ + libssl-dev \ + libreadline-dev \ + zlib1g-dev \ + && rm -rf /var/lib/apt/lists/* + +RUN useradd -ms /bin/bash vscode + +WORKDIR /workspace + +RUN gem install bundler + +COPY . . + +RUN bundle install + +ENV RACK_ENV=development + +RUN apt-get update && apt-get install -y \ + vim \ + git \ + jq \ + && rm -rf /var/lib/apt/lists/* + +USER vscode + +CMD ["bash"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..a9a64e3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ + "name": "Ruby Development Container", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + "postCreateCommand": "bundle install", + "extensions": [ + "rebornix.ruby", + "castwide.solargraph", + "wingrunr21.vscode-ruby", + "misogi.ruby-rubocop" + ], + "remoteUser": "vscode", + "remoteEnv": { + "RACK_ENV": "development" + } +} diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..e076bda --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'rubocop' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..c9eec6e --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,36 @@ +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.2) + json (2.7.2) + language_server-protocol (3.17.0.3) + parallel (1.26.3) + parser (3.3.5.0) + ast (~> 2.4.1) + racc + racc (1.8.1) + rainbow (3.1.1) + regexp_parser (2.9.2) + rubocop (1.67.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.4, < 3.0) + rubocop-ast (>= 1.32.2, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.32.3) + parser (>= 3.3.1.0) + ruby-progressbar (1.13.0) + unicode-display_width (2.6.0) + +PLATFORMS + ruby + +DEPENDENCIES + rubocop + +BUNDLED WITH + 2.5.7 From 30ef5372f3e4ef4ec8c906a23aa4769a68e3297b Mon Sep 17 00:00:00 2001 From: Manuel Fittko Date: Sat, 9 Nov 2024 10:36:38 +0100 Subject: [PATCH 2/2] update bundle --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c9eec6e..bc1d204 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,16 +2,16 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.2) - json (2.7.2) + json (2.8.1) language_server-protocol (3.17.0.3) parallel (1.26.3) - parser (3.3.5.0) + parser (3.3.6.0) ast (~> 2.4.1) racc racc (1.8.1) rainbow (3.1.1) regexp_parser (2.9.2) - rubocop (1.67.0) + rubocop (1.68.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -21,7 +21,7 @@ GEM rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + rubocop-ast (1.34.1) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) unicode-display_width (2.6.0) @@ -33,4 +33,4 @@ DEPENDENCIES rubocop BUNDLED WITH - 2.5.7 + 2.5.23