Skip to content

Commit e14337f

Browse files
author
Colby Swandale
committed
add devcontainer setup
1 parent 604a7f8 commit e14337f

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ARG RUBY_VERSION=3.4.4
2+
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION
3+
4+
ENV BINDING="0.0.0.0"

.devcontainer/devcontainer.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name: RubyGems Guides",
3+
"dockerFile": "Dockerfile",
4+
"forwardPorts": [
5+
4000
6+
],
7+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
8+
"postCreateCommand": "bin/setup",
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"Shopify.ruby-lsp"
13+
]
14+
}
15+
}
16+
}

bin/jekyll

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'jekyll' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12+
13+
bundle_binstub = File.expand_path("bundle", __dir__)
14+
15+
if File.file?(bundle_binstub)
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17+
load(bundle_binstub)
18+
else
19+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21+
end
22+
end
23+
24+
require "rubygems"
25+
require "bundler/setup"
26+
27+
load Gem.bin_path("jekyll", "jekyll")

bin/setup

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env ruby
2+
3+
require "fileutils"
4+
5+
APP_ROOT = File.expand_path("..", __dir__)
6+
7+
def system!(*args)
8+
system(*args, exception: true)
9+
end
10+
11+
FileUtils.chdir APP_ROOT do
12+
puts "=== Installing dependencies ==="
13+
system("bundle check") || system!("bundle install")
14+
end

0 commit comments

Comments
 (0)