Create Rack and Bootsnap application
This commit is contained in:
parent
1bb92e1c2e
commit
fb8c14d1fa
|
@ -0,0 +1,2 @@
|
||||||
|
/tmp/*
|
||||||
|
!/tmp/.keep
|
4
Gemfile
4
Gemfile
|
@ -1,3 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
gem 'activesupport', '~> 6.0'
|
||||||
|
gem 'bootsnap', '~> 1.4', require: false
|
||||||
|
gem 'rack', '~> 2.2'
|
||||||
|
|
21
Gemfile.lock
21
Gemfile.lock
|
@ -1,11 +1,32 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
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
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
activesupport (~> 6.0)
|
||||||
|
bootsnap (~> 1.4)
|
||||||
|
rack (~> 2.2)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.1.2
|
2.1.2
|
||||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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,
|
||||||
|
)
|
|
@ -0,0 +1,7 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# Load the application.
|
||||||
|
require_relative 'application'
|
||||||
|
|
||||||
|
# Initialize the application.
|
||||||
|
Fedihub::Webapp.initialize!
|
Reference in New Issue