From 7819505c8cfb8de60a3117229baec4e50a3b3b7c Mon Sep 17 00:00:00 2001 From: Bryan Liff Date: Thu, 12 Apr 2018 18:30:40 -0400 Subject: [PATCH 1/3] Updated gems and Ruby version --- .ruby-version | 2 +- Gemfile | 2 +- Gemfile.lock | 156 ++++++++++++++++++++++++++++---------------------- 3 files changed, 91 insertions(+), 69 deletions(-) diff --git a/.ruby-version b/.ruby-version index 8e17352..951d42f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-1.9.3-p448 +ruby-2.4.2 diff --git a/Gemfile b/Gemfile index 4110e8d..26c53be 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ gem 'thin' gem 'liquid' gem 'pdf-forms' gem 'prawn' -gem 'json', "1.7.7" +gem 'json' gem 'markdown' group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index 0cda910..51f89cb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,73 +1,92 @@ GEM remote: https://rubygems.org/ specs: - Ascii85 (1.0.2) - afm (0.2.0) - coderay (1.0.9) - daemons (1.1.9) - diff-lcs (1.2.4) - eventmachine (1.0.3) - hashery (2.1.0) - json (1.7.7) - kramdown (1.1.0) - liquid (2.5.0) - logutils (0.6.0) - markdown (1.1.1) - kramdown (>= 1.0.2) - props (>= 1.0.0) - textutils (>= 0.6.4) - method_source (0.8.1) - mini_portile (0.5.1) - multi_json (1.7.7) - nokogiri (1.6.0) - mini_portile (~> 0.5.0) - pdf-forms (0.5.5) - pdf-reader (1.3.3) - Ascii85 (~> 1.0.0) - afm (~> 0.2.0) - hashery (~> 2.0) - ruby-rc4 - ttfunk - prawn (0.12.0) - pdf-reader (>= 0.9.0) - ttfunk (~> 1.0.2) - props (1.0.0) - pry (0.9.12.2) - coderay (~> 1.0.5) - method_source (~> 0.8) - slop (~> 3.4) - rack (1.5.2) - rack-protection (1.5.0) + activesupport (5.2.0) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + cliver (0.3.2) + coderay (1.1.2) + concurrent-ruby (1.0.5) + daemons (1.2.6) + diff-lcs (1.3) + docile (1.3.0) + eventmachine (1.2.5) + i18n (1.0.0) + concurrent-ruby (~> 1.0) + iniparser (0.1.0) + json (2.1.0) + kramdown (1.16.2) + liquid (4.0.0) + logutils (0.6.1) + markdown (1.2.0) + kramdown (>= 1.5.0) + props (>= 1.1.2) + textutils (>= 0.10.0) + method_source (0.9.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + mustermann (1.0.2) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + pdf-core (0.7.0) + pdf-forms (1.1.1) + cliver (~> 0.3.2) + safe_shell (>= 1.0.3, < 2.0) + prawn (2.2.2) + pdf-core (~> 0.7.0) + ttfunk (~> 1.5) + props (1.2.0) + iniparser (>= 0.1.0) + pry (0.11.3) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + rack (2.0.4) + rack-protection (2.0.1) rack - rack-test (0.6.2) - rack (>= 1.0) - rake (10.1.0) - rspec (2.14.1) - rspec-core (~> 2.14.0) - rspec-expectations (~> 2.14.0) - rspec-mocks (~> 2.14.0) - rspec-core (2.14.2) - rspec-expectations (2.14.0) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.1) - ruby-rc4 (0.1.5) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) - sinatra (1.4.3) - rack (~> 1.4) - rack-protection (~> 1.4) - tilt (~> 1.3, >= 1.3.4) - slop (3.4.5) - textutils (0.6.6) - logutils (~> 0.5) - thin (1.5.1) - daemons (>= 1.0.9) - eventmachine (>= 0.12.6) - rack (>= 1.0.0) - tilt (1.4.1) - ttfunk (1.0.3) + rack-test (1.0.0) + rack (>= 1.0, < 3) + rake (12.3.1) + rspec (3.7.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-core (3.7.1) + rspec-support (~> 3.7.0) + rspec-expectations (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-mocks (3.7.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.7.0) + rspec-support (3.7.1) + rubyzip (1.2.1) + safe_shell (1.1.0) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + sinatra (2.0.1) + mustermann (~> 1.0) + rack (~> 2.0) + rack-protection (= 2.0.1) + tilt (~> 2.0) + textutils (1.4.0) + activesupport + logutils (>= 0.6.1) + props (>= 1.1.2) + rubyzip (>= 1.0.0) + thin (1.7.2) + daemons (~> 1.0, >= 1.0.9) + eventmachine (~> 1.0, >= 1.0.4) + rack (>= 1, < 3) + thread_safe (0.3.6) + tilt (2.0.8) + ttfunk (1.5.1) + tzinfo (1.2.5) + thread_safe (~> 0.1) webrat (0.7.3) nokogiri (>= 1.2.0) rack (>= 1.0) @@ -77,7 +96,7 @@ PLATFORMS ruby DEPENDENCIES - json (= 1.7.7) + json liquid markdown pdf-forms @@ -90,3 +109,6 @@ DEPENDENCIES sinatra thin webrat + +BUNDLED WITH + 1.16.0 From 33e3bc041235529c2377821d0165aed72e4024cc Mon Sep 17 00:00:00 2001 From: Bryan Liff Date: Fri, 13 Apr 2018 14:22:54 -0400 Subject: [PATCH 2/3] Dockerization --- .dockerignore | 5 +++++ Dockerfile | 13 +++++++++++++ docker-compose.yml | 12 ++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5ac2d59 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +Dockerfile +docker-compose.yml +.git* +log/* +tmp/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3e85e6a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ruby:2.5-alpine + +WORKDIR /app + +COPY . /app + +RUN apk update && apk upgrade \ + && apk add pdftk \ + && gem install bundler \ + && apk add git openssh-client pdftk musl-dev make g++ \ + && bundle install + +EXPOSE 4567 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..42bf3c9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3" +services: + pdf_filler: + build: . + image: pdf-filler + volumes: + - .:/app + ports: + - "4567:4567" + command: ruby /app/app.rb -o '0.0.0.0' + tty: true + stdin_open: true From 1c76b9d5e2cb9d8593f83528513b14b64f9e52b5 Mon Sep 17 00:00:00 2001 From: Bryan Liff Date: Fri, 13 Apr 2018 15:11:46 -0400 Subject: [PATCH 3/3] README updates for Docker --- views/index.md | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/views/index.md b/views/index.md index 1255a65..0b5f77a 100755 --- a/views/index.md +++ b/views/index.md @@ -61,31 +61,34 @@ Structuring the HTML Form Data can be submitted programmatically (e.g. via an API) or as a standard web-based form. For example, to structure an HTML form, you may do so as follows: -```html +```html
- +