1
0
Fork 0

Create Rack and Bootsnap application

This commit is contained in:
Alex Kotov 2020-10-05 11:02:03 +05:00
parent 1bb92e1c2e
commit fb8c14d1fa
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
8 changed files with 84 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/tmp/*
!/tmp/.keep

View File

@ -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'

View File

@ -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

7
config.ru Normal file
View File

@ -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

17
config/application.rb Normal file
View File

@ -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

26
config/boot.rb Normal file
View File

@ -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,
)

7
config/environment.rb Normal file
View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
# Load the application.
require_relative 'application'
# Initialize the application.
Fedihub::Webapp.initialize!

0
tmp/.keep Normal file
View File