From a4af293c325e4d6dce7e087bc4e4a84ab31b0d5a Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Wed, 29 Apr 2020 13:35:13 -0700 Subject: [PATCH] add rack/puma for live review apps --- Gemfile | 4 +++- Gemfile.lock | 10 ++++++++++ Procfile | 1 + app.json | 12 ++++++++++++ bin/puma | 29 +++++++++++++++++++++++++++++ bin/pumactl | 29 +++++++++++++++++++++++++++++ config.ru | 3 +++ 7 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 Procfile create mode 100644 app.json create mode 100755 bin/puma create mode 100755 bin/pumactl create mode 100644 config.ru diff --git a/Gemfile b/Gemfile index 17d5b24..8bab1b1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,8 @@ source 'https://rubygems.org' +gem 'coffee-script' gem 'github-pages' +gem 'puma', '~> 4.3' +gem 'rack-jekyll', '~> 0.5.0' gem 'rake' gem 'sass' -gem 'coffee-script' diff --git a/Gemfile.lock b/Gemfile.lock index 418cf0c..7c9338c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -204,6 +204,7 @@ GEM jekyll-seo-tag (~> 2.1) minitest (5.14.0) multipart-post (2.1.1) + nio4r (2.5.2) nokogiri (1.10.8) mini_portile2 (~> 2.4.0) octokit (4.16.0) @@ -212,6 +213,13 @@ GEM pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (3.1.1) + puma (4.3.3) + nio4r (~> 2.0) + rack (1.6.13) + rack-jekyll (0.5.0) + jekyll (>= 1.3) + listen (>= 1.3) + rack (~> 1.5) rake (13.0.1) rb-fsevent (0.10.3) rb-inotify (0.10.1) @@ -245,6 +253,8 @@ PLATFORMS DEPENDENCIES coffee-script github-pages + puma (~> 4.3) + rack-jekyll (~> 0.5.0) rake sass diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..1c53585 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: bin/puma -p $PORT diff --git a/app.json b/app.json new file mode 100644 index 0000000..4892bb2 --- /dev/null +++ b/app.json @@ -0,0 +1,12 @@ +{ + "name": "rubygems-blog", + "scripts": { + }, + "env": { + "LANG": "en_US.UTF-8", + "RACK_ENV": "production" + }, + "addons": [ + + ] +} diff --git a/bin/puma b/bin/puma new file mode 100755 index 0000000..880935b --- /dev/null +++ b/bin/puma @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'puma' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("puma", "puma") diff --git a/bin/pumactl b/bin/pumactl new file mode 100755 index 0000000..b698e6e --- /dev/null +++ b/bin/pumactl @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'pumactl' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("puma", "pumactl") diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..145ec30 --- /dev/null +++ b/config.ru @@ -0,0 +1,3 @@ +require "rack/jekyll" + +run Rack::Jekyll.new \ No newline at end of file