Skip to content

Commit cf8bd52

Browse files
committed
πŸ§‘β€πŸ’» Improve bundler setup for Devcontainer
1 parent e0b9c25 commit cf8bd52

File tree

7 files changed

+45
-17
lines changed

7 files changed

+45
-17
lines changed

β€Ž.devcontainer/2.5/apt-install/devcontainer-feature.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

β€Ž.devcontainer/2.5/apt-install/install.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Bundle Config",
3+
"id": "bundle-config",
4+
"version": "1.0.0",
5+
"description": "Bundle Config",
6+
"install": {
7+
"script": "install.sh"
8+
}
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
RUBYGEMS_VERSION=3.3.27
3+
gem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1 &&
4+
update_rubygems > /dev/null 2>&1
5+
# Ensure we use the right Gemfile
6+
echo 'export BUNDLE_GEMFILE=Gemfile-ruby2_5.gemfile' >> ~/.bashrc

β€Ž.devcontainer/2.5/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
{
44
"name": "Ruby 2.5 on Debian",
55
"image": "ruby:2.5-buster",
6-
"postCreateCommand": "RUBYGEMS_VERSION=3.3.27\ngem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1 &&\nupdate_rubygems > /dev/null 2>&1 &&\nbundle install",
6+
"postCreateCommand": "bundle install",
77

88
// Features to add to the dev container. More info: https://containers.dev/features.
99
// Features run during the image build, and thus before the lifecycle hooks in this file, e.g., postCreateCommand
1010
"features": {
11-
"./apt-install": {}
11+
"./bundle-config": {}
1212
},
1313

1414
// Configure tool-specific properties.

β€ŽGemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
66
gemspec
77

88
group :development do
9-
gem "bundler"
109
# This is for suppressing the following warning:
1110
#
1211
# warning: ostruct was loaded from the standard library, but will

β€ŽGemfile-ruby2_5.gemfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
source "https://rubygems.org"
2+
3+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4+
5+
# Specify your gem's dependencies in rexml.gemspec
6+
gemspec
7+
8+
group :development do
9+
# This is for suppressing the following warning:
10+
#
11+
# warning: ostruct was loaded from the standard library, but will
12+
# no longer be part of the default gems starting from Ruby 3.5.0.
13+
#
14+
# This should be part of "json". We can remove this when "json"
15+
# depends on "ostruct" explicitly.
16+
gem "ostruct"
17+
gem "rake"
18+
gem "rdoc"
19+
end
20+
21+
group :benchmark do
22+
gem "benchmark_driver"
23+
end
24+
25+
group :test do
26+
gem "test-unit"
27+
gem "test-unit-ruby-core"
28+
end

0 commit comments

Comments
Β (0)