# frozen_string_literal: true require "mobilis/generic_project" require "mobilis/os" module Mobilis class RackProject < GenericProject def name @data[:name] end def generate Dir.mkdir name Dir.chdir name do generate_config_ru generate_Gemfile generate_Gemfile_lock generate_Dockerfile end end def generate_config_ru set_file_contents "config.ru", < "text/html" }, ["Hello, Rack"] ] } run app CONFIG_RU end def generate_Gemfile set_file_contents "Gemfile", < 0.2.2" GEMFILE end def generate_Gemfile_lock set_file_contents "Gemfile.lock", <= 3.0.0.beta1) webrick webrick (1.7.0) PLATFORMS x64-mingw-ucrt DEPENDENCIES rack (= 3.0.0.beta1) rackup (~> 0.2.2) BUNDLED WITH 2.3.16 GEMFILE_LOCK end def generate_Dockerfile set_file_contents "Dockerfile", <