From 2dc8d0aa6c360a48e478f93bef050618e5bffc3e Mon Sep 17 00:00:00 2001 From: "Christopher M. Hobbs" Date: Sun, 13 Jul 2025 01:21:24 -0500 Subject: [PATCH] Add devcontainer template for Crystal. --- .devcontainer/Dockerfile | 17 +++++++++++++++++ .devcontainer/devcontainer.json | 13 +++++++++++++ README.md | 0 shard.yml | 18 ++++++++++++++++++ spec/spec_helper.cr | 1 + src/main.cr | 1 + 6 files changed, 50 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 README.md create mode 100644 shard.yml create mode 100644 spec/spec_helper.cr create mode 100644 src/main.cr diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..5aa0acb --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,17 @@ +FROM mcr.microsoft.com/devcontainers/base:ubuntu + +# Install packages +# libpcre3-dev is needed if you wish to use ameba +RUN apt-get update && apt-get install -y \ + git \ + build-essential \ + curl \ + libpcre3-dev \ + && rm -rf /var/lib/apt/lists/* + +# Install Crystal +RUN curl -fsSL https://crystal-lang.org/install.sh | bash + +# Switch to vscode user +USER vscode +WORKDIR /workspaces diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..9d36d82 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,13 @@ +{ + "name": "Crystal Development", + "build": { + "dockerfile": "Dockerfile" + }, + "remoteUser": "vscode", + "workspaceFolder": "/workspaces/PROJECT_NAME", + "customizations": { + "vscode": { + "extensions": ["crystal-lang-tools.crystal-lang"] + } + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/shard.yml b/shard.yml new file mode 100644 index 0000000..9bc6683 --- /dev/null +++ b/shard.yml @@ -0,0 +1,18 @@ +name: PROJECT_NAME +version: 0.1.0 + +authors: + - YOUR_NAME + +crystal: 1.0.0 + +license: MIT + +development_dependencies: + ameba: + github: crystal-ameba/ameba + version: ~> 1.6.0 + +targets: + PROJECT_NAME: + main: src/main.cr diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr new file mode 100644 index 0000000..1b73f5d --- /dev/null +++ b/spec/spec_helper.cr @@ -0,0 +1 @@ +# spec_helper.cr diff --git a/src/main.cr b/src/main.cr new file mode 100644 index 0000000..62aaaad --- /dev/null +++ b/src/main.cr @@ -0,0 +1 @@ +puts "Hello, PROJECT_NAME!"