diff --git a/extra/hanami_app/Gemfile b/extra/hanami_app/Gemfile deleted file mode 100644 index 005c85e..0000000 --- a/extra/hanami_app/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - -gem 'rack' -gem 'webrick' - -gem 'hanami-router' - -gem 'tiny_admin', path: '../../' diff --git a/extra/hanami_app/app.rb b/extra/hanami_app/app.rb deleted file mode 100644 index 1e10a96..0000000 --- a/extra/hanami_app/app.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'bundler' -Bundler.require - -require_relative '../tiny_admin_settings' - -app = Hanami::Router.new do - root to: ->(_env) { [200, {}, ['Root page']] } - - mount TinyAdmin::Router, at: '/admin' -end - -Rack::Server.new(app: app, Port: 3000).start if __FILE__ == $PROGRAM_NAME diff --git a/extra/hanami_app/config.ru b/extra/hanami_app/config.ru new file mode 100644 index 0000000..5aab0f1 --- /dev/null +++ b/extra/hanami_app/config.ru @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# => rackup -p 3000 + +require 'bundler/inline' + +gemfile(true) do + source 'https://rubygems.org' + + gem 'hanami-router' + gem 'webrick' + + gem 'tiny_admin', path: '../../' +end + +require 'hanami/router' + +require_relative '../tiny_admin_settings' + +app = Hanami::Router.new do + root to: ->(_env) { [200, {}, ['Root page - go to /admin for TinyAdmin']] } + + mount TinyAdmin::Router, at: '/admin' +end + +run app diff --git a/extra/rails_app/Gemfile b/extra/rails_app/Gemfile deleted file mode 100644 index 7a455aa..0000000 --- a/extra/rails_app/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - -gem 'rails', '~> 7.0' -gem 'webrick' - -gem 'tiny_admin', path: '../../' diff --git a/extra/rails_app/app.rb b/extra/rails_app/app.rb index 90fdd52..5f3ae03 100644 --- a/extra/rails_app/app.rb +++ b/extra/rails_app/app.rb @@ -1,18 +1,29 @@ # frozen_string_literal: true -require 'bundler' -Bundler.require +# => ruby app.rb + +require 'bundler/inline' + +gemfile(true) do + source 'https://rubygems.org' + + gem 'rails', '~> 7' + gem 'tiny_admin', path: '../../' +end require 'action_controller/railtie' require_relative '../tiny_admin_settings' class RailsApp < Rails::Application routes.append do - root to: proc { [200, {}, ['Root page']] } + root to: proc { [200, {}, ['Root page - go to /admin for TinyAdmin']] } mount TinyAdmin::Router => '/admin' end + config.action_dispatch.show_exceptions = :none + config.active_support.cache_format_version = 7.1 + config.consider_all_requests_local = false config.eager_load = false end diff --git a/extra/roda_app/Gemfile b/extra/roda_app/Gemfile deleted file mode 100644 index 651c01b..0000000 --- a/extra/roda_app/Gemfile +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - -gem 'rack' -gem 'rackup' -gem 'webrick' - -gem 'roda' - -gem 'tiny_admin', path: '../../' diff --git a/extra/roda_app/app.rb b/extra/roda_app/app.rb index 4fc2a32..3b73e6e 100644 --- a/extra/roda_app/app.rb +++ b/extra/roda_app/app.rb @@ -1,14 +1,23 @@ # frozen_string_literal: true -require 'bundler' -Bundler.require +# => ruby app.rb + +require 'bundler/inline' + +gemfile(true) do + source 'https://rubygems.org' + + gem 'rackup' + gem 'roda' + gem 'tiny_admin', path: '../../' +end require_relative '../tiny_admin_settings' class RodaApp < Roda route do |r| r.root do - 'Root page' + 'Root page - go to /admin for TinyAdmin' end r.on 'admin' do diff --git a/extra/sample_features_app/app.rb b/extra/sample_features_app/app.rb index 39cacd2..3105bcf 100644 --- a/extra/sample_features_app/app.rb +++ b/extra/sample_features_app/app.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +# => bundle exec ruby app.rb + require 'bundler' Bundler.require diff --git a/extra/standalone_app/Gemfile b/extra/standalone_app/Gemfile deleted file mode 100644 index 1d49483..0000000 --- a/extra/standalone_app/Gemfile +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - -gem 'rack' -gem 'rackup' -gem 'webrick' - -gem 'tiny_admin', path: '../../' diff --git a/extra/standalone_app/app.rb b/extra/standalone_app/app.rb index 72120ab..1f5aa74 100644 --- a/extra/standalone_app/app.rb +++ b/extra/standalone_app/app.rb @@ -1,7 +1,16 @@ # frozen_string_literal: true -require 'bundler' -Bundler.require +# => ruby app.rb + +require 'bundler/inline' + +gemfile(true) do + source 'https://rubygems.org' + + gem 'rackup' + + gem 'tiny_admin', path: '../../' +end require_relative '../tiny_admin_settings'