diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0cd05d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/tmp/* +!/tmp/.keep diff --git a/Gemfile b/Gemfile index ebc4588..56b1ffb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,7 @@ # frozen_string_literal: true source 'https://rubygems.org' + +gem 'activesupport', '~> 6.0' +gem 'bootsnap', '~> 1.4', require: false +gem 'rack', '~> 2.2' diff --git a/Gemfile.lock b/Gemfile.lock index 01af620..17010bd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,32 @@ GEM remote: https://rubygems.org/ specs: + activesupport (6.0.3.3) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + bootsnap (1.4.8) + msgpack (~> 1.0) + concurrent-ruby (1.1.7) + i18n (1.8.5) + concurrent-ruby (~> 1.0) + minitest (5.14.2) + msgpack (1.3.3) + rack (2.2.3) + thread_safe (0.3.6) + tzinfo (1.2.7) + thread_safe (~> 0.1) + zeitwerk (2.4.0) PLATFORMS ruby DEPENDENCIES + activesupport (~> 6.0) + bootsnap (~> 1.4) + rack (~> 2.2) BUNDLED WITH 2.1.2 diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..6c42584 --- /dev/null +++ b/config.ru @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Fedihub::Webapp.application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..b335efa --- /dev/null +++ b/config/application.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require_relative 'boot' + +# Require the gems listed in Gemfile. +Bundler.require + +module Fedihub + module Webapp + class << self + attr_reader :application + + def initialize! + end + end + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..f8916c2 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +Warning[:deprecated] = false + +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__).freeze + +require 'bundler/setup' # Set up gems listed in the Gemfile. + +require 'bootsnap' + +cache_dir = File.join(File.expand_path('..', __dir__), 'tmp', 'cache').freeze + +env = ENV['RACK_ENV'].freeze + +development_mode = ['', nil, 'development'].include?(env) +test_mode = env == 'test' + +Bootsnap.setup( + cache_dir: cache_dir, + development_mode: development_mode, + load_path_cache: true, + autoload_paths_cache: true, + disable_trace: false, + compile_cache_iseq: test_mode, + compile_cache_yaml: true, +) diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..88649db --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# Load the application. +require_relative 'application' + +# Initialize the application. +Fedihub::Webapp.initialize! diff --git a/tmp/.keep b/tmp/.keep new file mode 100644 index 0000000..e69de29