Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ruby development container setup with Rubocop integration #130

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
21 changes: 21 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

Check warning on line 1 in Gemfile

View workflow job for this annotation

GitHub Actions / test-skip-install-and-use-bundler

[rubocop] reported by reviewdog 🐶 Missing frozen string literal comment. Raw Output: Gemfile:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just need to add this to resolve the remaining Rubocop warning.

Suggested change
source 'https://rubygems.org'
# frozen_string_literal: true
source 'https://rubygems.org'


gem 'rubocop'
36 changes: 36 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
json (2.8.1)
language_server-protocol (3.17.0.3)
parallel (1.26.3)
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.68.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.34.1)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
unicode-display_width (2.6.0)

PLATFORMS
ruby

DEPENDENCIES
rubocop

BUNDLED WITH
2.5.23