diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..578ce5f0 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,29 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/ruby/.devcontainer/base.Dockerfile + +# [Choice] Ruby version: 3, 3.0, 2, 2.7, 2.6 +ARG VARIANT="2.7" +FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT} + +# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 +ARG NODE_VERSION="10" +RUN if [ "${NODE_VERSION}" != "none" ]; then \ + su vscode -c "umask 0002 \ + && . /usr/local/share/nvm/nvm.sh \ + && nvm install ${NODE_VERSION} 2>&1"; \ +fi + +# Install PhantomJS dependencies +RUN export DEBIAN_FRONTEND=noninteractive \ + && apt-get update \ + && apt-get -y install --no-install-recommends \ + libfontconfig + +# Fix for Phantomjs OpenSSL issue +# https://github.com/ariya/phantomjs/issues/15449 +RUN echo 'export OPENSSL_CONF=/etc/ssl' >> /etc/bash.bashrc + +# Install teh right version of bundler +RUN gem install bundler:2.2.22 + +# [Optional] Uncomment this line to install global node packages. +# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g [...]" 2>&1 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..db719687 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/ruby +{ + "name": "Ruby", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update 'VARIANT' to pick a Ruby version: 3, 3.0, 2, 2.7, 2.6 + "VARIANT": "2.7", + // Options + "NODE_VERSION": "10", + } + }, + + // Set *default* container specific settings.json values on container create. + "settings": {}, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "rebornix.Ruby" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "echo 'export OPENSSL_CONF=/etc/ssl' >> /etc/bash.bashrc", + + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" + +} \ No newline at end of file diff --git a/example/Gemfile b/example/Gemfile index 0d4908e1..3dbf4164 100644 --- a/example/Gemfile +++ b/example/Gemfile @@ -1,3 +1,9 @@ source "https://rubygems.org" gem "govuk_tech_docs", path: ".." + +gem "rake", "~> 13.0" + +gem "rspec", "~> 3.10" + +gem "jasmine", "~> 3.9"