diff --git a/examples/rails_app/Gemfile b/examples/rails_app/Gemfile
index 04ac3bf0..1b089da2 100644
--- a/examples/rails_app/Gemfile
+++ b/examples/rails_app/Gemfile
@@ -40,3 +40,5 @@ group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end
+
+gem "weather", path: "engines/weather"
diff --git a/examples/rails_app/Gemfile.lock b/examples/rails_app/Gemfile.lock
index 37b3de6c..bdf849ea 100644
--- a/examples/rails_app/Gemfile.lock
+++ b/examples/rails_app/Gemfile.lock
@@ -1,12 +1,18 @@
PATH
remote: ../..
specs:
- openapi_first (2.7.1)
+ openapi_first (2.11.1)
hana (~> 1.3)
json_schemer (>= 2.1, < 3.0)
- openapi_parameters (>= 0.3.3, < 2.0)
+ openapi_parameters (>= 0.7.0, < 2.0)
rack (>= 2.2, < 4.0)
+PATH
+ remote: engines/weather
+ specs:
+ weather (0.1.0)
+ rails (>= 7.2.2.1)
+
GEM
remote: https://rubygems.org/
specs:
@@ -148,7 +154,7 @@ GEM
racc (~> 1.4)
nokogiri (1.18.8-x86_64-linux-gnu)
racc (~> 1.4)
- openapi_parameters (0.5.0)
+ openapi_parameters (0.8.0)
rack (>= 2.2)
pp (0.6.2)
prettyprint
@@ -231,6 +237,7 @@ DEPENDENCIES
puma (>= 5.0)
rails (~> 7.2.0)
tzinfo-data
+ weather!
RUBY VERSION
ruby 3.3.0p0
diff --git a/examples/rails_app/config/routes.rb b/examples/rails_app/config/routes.rb
index 99c7569a..a9bb05ff 100644
--- a/examples/rails_app/config/routes.rb
+++ b/examples/rails_app/config/routes.rb
@@ -12,4 +12,6 @@
get '/trips', to: 'trips#index'
resources :attachments, only: :show
+
+ mount Weather::Engine, at: '/weather', as: "weather_engine"
end
diff --git a/examples/rails_app/engines/weather/Gemfile b/examples/rails_app/engines/weather/Gemfile
new file mode 100644
index 00000000..4eddb2e3
--- /dev/null
+++ b/examples/rails_app/engines/weather/Gemfile
@@ -0,0 +1,16 @@
+source "https://rubygems.org"
+
+# Specify your gem's dependencies in weather.gemspec.
+gemspec
+
+gem "puma"
+
+gem "sqlite3"
+
+gem "sprockets-rails"
+
+# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
+gem "rubocop-rails-omakase", require: false
+
+# Start debugger with binding.b [https://github.com/ruby/debug]
+# gem "debug", ">= 1.0.0"
diff --git a/examples/rails_app/engines/weather/Rakefile b/examples/rails_app/engines/weather/Rakefile
new file mode 100644
index 00000000..e7793b5c
--- /dev/null
+++ b/examples/rails_app/engines/weather/Rakefile
@@ -0,0 +1,8 @@
+require "bundler/setup"
+
+APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
+load "rails/tasks/engine.rake"
+
+load "rails/tasks/statistics.rake"
+
+require "bundler/gem_tasks"
diff --git a/examples/rails_app/engines/weather/app/assets/config/weather_manifest.js b/examples/rails_app/engines/weather/app/assets/config/weather_manifest.js
new file mode 100644
index 00000000..b1c17f10
--- /dev/null
+++ b/examples/rails_app/engines/weather/app/assets/config/weather_manifest.js
@@ -0,0 +1 @@
+//= link_directory ../stylesheets/weather .css
diff --git a/examples/rails_app/engines/weather/app/assets/images/weather/.keep b/examples/rails_app/engines/weather/app/assets/images/weather/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/app/assets/stylesheets/weather/application.css b/examples/rails_app/engines/weather/app/assets/stylesheets/weather/application.css
new file mode 100644
index 00000000..0ebd7fe8
--- /dev/null
+++ b/examples/rails_app/engines/weather/app/assets/stylesheets/weather/application.css
@@ -0,0 +1,15 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
+ * files in this directory. Styles in this file should be added after the last require_* statement.
+ * It is generally better to create a new file per style scope.
+ *
+ *= require_tree .
+ *= require_self
+ */
diff --git a/examples/rails_app/engines/weather/app/controllers/concerns/.keep b/examples/rails_app/engines/weather/app/controllers/concerns/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/app/controllers/weather/application_controller.rb b/examples/rails_app/engines/weather/app/controllers/weather/application_controller.rb
new file mode 100644
index 00000000..5cb64278
--- /dev/null
+++ b/examples/rails_app/engines/weather/app/controllers/weather/application_controller.rb
@@ -0,0 +1,4 @@
+module Weather
+ class ApplicationController < ActionController::Base
+ end
+end
diff --git a/examples/rails_app/engines/weather/app/controllers/weather/temperature_controller.rb b/examples/rails_app/engines/weather/app/controllers/weather/temperature_controller.rb
new file mode 100644
index 00000000..db4dc7c9
--- /dev/null
+++ b/examples/rails_app/engines/weather/app/controllers/weather/temperature_controller.rb
@@ -0,0 +1,17 @@
+module Weather
+ class TemperatureController < ApplicationController
+ def index
+ render json: {
+ latitude:, longitude:, temperature: {
+ celsius: "11.94",
+ fahenheit: "53.5"
+ }
+ }
+ end
+
+ private
+
+ def latitude = params.require(:latitude)
+ def longitude = params.require(:longitude)
+ end
+end
diff --git a/examples/rails_app/engines/weather/app/helpers/weather/application_helper.rb b/examples/rails_app/engines/weather/app/helpers/weather/application_helper.rb
new file mode 100644
index 00000000..a5d69598
--- /dev/null
+++ b/examples/rails_app/engines/weather/app/helpers/weather/application_helper.rb
@@ -0,0 +1,4 @@
+module Weather
+ module ApplicationHelper
+ end
+end
diff --git a/examples/rails_app/engines/weather/app/jobs/weather/application_job.rb b/examples/rails_app/engines/weather/app/jobs/weather/application_job.rb
new file mode 100644
index 00000000..98edcab4
--- /dev/null
+++ b/examples/rails_app/engines/weather/app/jobs/weather/application_job.rb
@@ -0,0 +1,4 @@
+module Weather
+ class ApplicationJob < ActiveJob::Base
+ end
+end
diff --git a/examples/rails_app/engines/weather/app/mailers/weather/application_mailer.rb b/examples/rails_app/engines/weather/app/mailers/weather/application_mailer.rb
new file mode 100644
index 00000000..bac5a95a
--- /dev/null
+++ b/examples/rails_app/engines/weather/app/mailers/weather/application_mailer.rb
@@ -0,0 +1,6 @@
+module Weather
+ class ApplicationMailer < ActionMailer::Base
+ default from: "from@example.com"
+ layout "mailer"
+ end
+end
diff --git a/examples/rails_app/engines/weather/app/models/concerns/.keep b/examples/rails_app/engines/weather/app/models/concerns/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/app/models/weather/application_record.rb b/examples/rails_app/engines/weather/app/models/weather/application_record.rb
new file mode 100644
index 00000000..a5d1c13a
--- /dev/null
+++ b/examples/rails_app/engines/weather/app/models/weather/application_record.rb
@@ -0,0 +1,5 @@
+module Weather
+ class ApplicationRecord < ActiveRecord::Base
+ self.abstract_class = true
+ end
+end
diff --git a/examples/rails_app/engines/weather/app/views/layouts/weather/application.html.erb b/examples/rails_app/engines/weather/app/views/layouts/weather/application.html.erb
new file mode 100644
index 00000000..251ee28e
--- /dev/null
+++ b/examples/rails_app/engines/weather/app/views/layouts/weather/application.html.erb
@@ -0,0 +1,17 @@
+
+
+
+ Weather
+ <%= csrf_meta_tags %>
+ <%= csp_meta_tag %>
+
+ <%= yield :head %>
+
+ <%= stylesheet_link_tag "weather/application", media: "all" %>
+
+
+
+<%= yield %>
+
+
+
diff --git a/examples/rails_app/engines/weather/bin/rails b/examples/rails_app/engines/weather/bin/rails
new file mode 100755
index 00000000..8caf6413
--- /dev/null
+++ b/examples/rails_app/engines/weather/bin/rails
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails gems
+# installed from the root of your application.
+
+ENGINE_ROOT = File.expand_path("..", __dir__)
+ENGINE_PATH = File.expand_path("../lib/weather/engine", __dir__)
+APP_PATH = File.expand_path("../test/dummy/config/application", __dir__)
+
+# Set up gems listed in the Gemfile.
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
+require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
+
+require "rails/all"
+require "rails/engine/commands"
diff --git a/examples/rails_app/engines/weather/bin/rubocop b/examples/rails_app/engines/weather/bin/rubocop
new file mode 100755
index 00000000..40330c0f
--- /dev/null
+++ b/examples/rails_app/engines/weather/bin/rubocop
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require "rubygems"
+require "bundler/setup"
+
+# explicit rubocop config increases performance slightly while avoiding config confusion.
+ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
+
+load Gem.bin_path("rubocop", "rubocop")
diff --git a/examples/rails_app/engines/weather/config/routes.rb b/examples/rails_app/engines/weather/config/routes.rb
new file mode 100644
index 00000000..7ff38414
--- /dev/null
+++ b/examples/rails_app/engines/weather/config/routes.rb
@@ -0,0 +1,3 @@
+Weather::Engine.routes.draw do
+ get "temperature", to: "temperature#index"
+end
diff --git a/examples/rails_app/engines/weather/lib/tasks/weather_tasks.rake b/examples/rails_app/engines/weather/lib/tasks/weather_tasks.rake
new file mode 100644
index 00000000..0b00414d
--- /dev/null
+++ b/examples/rails_app/engines/weather/lib/tasks/weather_tasks.rake
@@ -0,0 +1,4 @@
+# desc "Explaining what the task does"
+# task :weather do
+# # Task goes here
+# end
diff --git a/examples/rails_app/engines/weather/lib/weather.rb b/examples/rails_app/engines/weather/lib/weather.rb
new file mode 100644
index 00000000..8cd96cf0
--- /dev/null
+++ b/examples/rails_app/engines/weather/lib/weather.rb
@@ -0,0 +1,6 @@
+require "weather/version"
+require "weather/engine"
+
+module Weather
+ # Your code goes here...
+end
diff --git a/examples/rails_app/engines/weather/lib/weather/engine.rb b/examples/rails_app/engines/weather/lib/weather/engine.rb
new file mode 100644
index 00000000..a3f03013
--- /dev/null
+++ b/examples/rails_app/engines/weather/lib/weather/engine.rb
@@ -0,0 +1,6 @@
+module Weather
+ class Engine < ::Rails::Engine
+ isolate_namespace Weather
+ config.generators.api_only = true
+ end
+end
diff --git a/examples/rails_app/engines/weather/lib/weather/version.rb b/examples/rails_app/engines/weather/lib/weather/version.rb
new file mode 100644
index 00000000..ad569e48
--- /dev/null
+++ b/examples/rails_app/engines/weather/lib/weather/version.rb
@@ -0,0 +1,3 @@
+module Weather
+ VERSION = "0.1.0"
+end
diff --git a/examples/rails_app/engines/weather/test/controllers/.keep b/examples/rails_app/engines/weather/test/controllers/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/controllers/temperature_controller_test.rb b/examples/rails_app/engines/weather/test/controllers/temperature_controller_test.rb
new file mode 100644
index 00000000..55c8fb22
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/controllers/temperature_controller_test.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+require "test_helper"
+
+class Weather::TemperatureControllerTest < ActionDispatch::IntegrationTest
+ test "it returns temperature data for given latitude and longitude" do
+ get weather_engine.temperature_path, params: { latitude: "37.7749", longitude: "-122.4194" }
+
+ assert_response :success
+ json_response = JSON.parse(response.body)
+
+ assert_equal "37.7749", json_response["latitude"]
+ assert_equal "-122.4194", json_response["longitude"]
+ assert_equal "11.94", json_response["temperature"]["celsius"]
+ assert_equal "53.5", json_response["temperature"]["fahenheit"]
+ end
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/Rakefile b/examples/rails_app/engines/weather/test/dummy/Rakefile
new file mode 100644
index 00000000..9a5ea738
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/Rakefile
@@ -0,0 +1,6 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require_relative "config/application"
+
+Rails.application.load_tasks
diff --git a/examples/rails_app/engines/weather/test/dummy/app/assets/config/manifest.js b/examples/rails_app/engines/weather/test/dummy/app/assets/config/manifest.js
new file mode 100644
index 00000000..b2fbeeae
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/assets/config/manifest.js
@@ -0,0 +1,3 @@
+//= link_tree ../images
+//= link_directory ../stylesheets .css
+//= link weather_manifest.js
diff --git a/examples/rails_app/engines/weather/test/dummy/app/assets/images/.keep b/examples/rails_app/engines/weather/test/dummy/app/assets/images/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/dummy/app/assets/stylesheets/application.css b/examples/rails_app/engines/weather/test/dummy/app/assets/stylesheets/application.css
new file mode 100644
index 00000000..0ebd7fe8
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/assets/stylesheets/application.css
@@ -0,0 +1,15 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
+ * files in this directory. Styles in this file should be added after the last require_* statement.
+ * It is generally better to create a new file per style scope.
+ *
+ *= require_tree .
+ *= require_self
+ */
diff --git a/examples/rails_app/engines/weather/test/dummy/app/channels/application_cable/channel.rb b/examples/rails_app/engines/weather/test/dummy/app/channels/application_cable/channel.rb
new file mode 100644
index 00000000..d6726972
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/channels/application_cable/channel.rb
@@ -0,0 +1,4 @@
+module ApplicationCable
+ class Channel < ActionCable::Channel::Base
+ end
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/app/channels/application_cable/connection.rb b/examples/rails_app/engines/weather/test/dummy/app/channels/application_cable/connection.rb
new file mode 100644
index 00000000..0ff5442f
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/channels/application_cable/connection.rb
@@ -0,0 +1,4 @@
+module ApplicationCable
+ class Connection < ActionCable::Connection::Base
+ end
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/app/controllers/application_controller.rb b/examples/rails_app/engines/weather/test/dummy/app/controllers/application_controller.rb
new file mode 100644
index 00000000..0d95db22
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/controllers/application_controller.rb
@@ -0,0 +1,4 @@
+class ApplicationController < ActionController::Base
+ # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
+ allow_browser versions: :modern
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/app/controllers/concerns/.keep b/examples/rails_app/engines/weather/test/dummy/app/controllers/concerns/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/dummy/app/helpers/application_helper.rb b/examples/rails_app/engines/weather/test/dummy/app/helpers/application_helper.rb
new file mode 100644
index 00000000..de6be794
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/app/jobs/application_job.rb b/examples/rails_app/engines/weather/test/dummy/app/jobs/application_job.rb
new file mode 100644
index 00000000..d394c3d1
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/jobs/application_job.rb
@@ -0,0 +1,7 @@
+class ApplicationJob < ActiveJob::Base
+ # Automatically retry jobs that encountered a deadlock
+ # retry_on ActiveRecord::Deadlocked
+
+ # Most jobs are safe to ignore if the underlying records are no longer available
+ # discard_on ActiveJob::DeserializationError
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/app/mailers/application_mailer.rb b/examples/rails_app/engines/weather/test/dummy/app/mailers/application_mailer.rb
new file mode 100644
index 00000000..3c34c814
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/mailers/application_mailer.rb
@@ -0,0 +1,4 @@
+class ApplicationMailer < ActionMailer::Base
+ default from: "from@example.com"
+ layout "mailer"
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/app/models/application_record.rb b/examples/rails_app/engines/weather/test/dummy/app/models/application_record.rb
new file mode 100644
index 00000000..b63caeb8
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/models/application_record.rb
@@ -0,0 +1,3 @@
+class ApplicationRecord < ActiveRecord::Base
+ primary_abstract_class
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/app/models/concerns/.keep b/examples/rails_app/engines/weather/test/dummy/app/models/concerns/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/dummy/app/views/layouts/application.html.erb b/examples/rails_app/engines/weather/test/dummy/app/views/layouts/application.html.erb
new file mode 100644
index 00000000..9c59674b
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/views/layouts/application.html.erb
@@ -0,0 +1,22 @@
+
+
+
+ <%= content_for(:title) || "Dummy" %>
+
+
+ <%= csrf_meta_tags %>
+ <%= csp_meta_tag %>
+
+ <%= yield :head %>
+
+
+
+
+
+ <%= stylesheet_link_tag "application" %>
+
+
+
+ <%= yield %>
+
+
diff --git a/examples/rails_app/engines/weather/test/dummy/app/views/layouts/mailer.html.erb b/examples/rails_app/engines/weather/test/dummy/app/views/layouts/mailer.html.erb
new file mode 100644
index 00000000..3aac9002
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/views/layouts/mailer.html.erb
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+ <%= yield %>
+
+
diff --git a/examples/rails_app/engines/weather/test/dummy/app/views/layouts/mailer.text.erb b/examples/rails_app/engines/weather/test/dummy/app/views/layouts/mailer.text.erb
new file mode 100644
index 00000000..37f0bddb
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/views/layouts/mailer.text.erb
@@ -0,0 +1 @@
+<%= yield %>
diff --git a/examples/rails_app/engines/weather/test/dummy/app/views/pwa/manifest.json.erb b/examples/rails_app/engines/weather/test/dummy/app/views/pwa/manifest.json.erb
new file mode 100644
index 00000000..a3c046e4
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/views/pwa/manifest.json.erb
@@ -0,0 +1,22 @@
+{
+ "name": "Dummy",
+ "icons": [
+ {
+ "src": "/icon.png",
+ "type": "image/png",
+ "sizes": "512x512"
+ },
+ {
+ "src": "/icon.png",
+ "type": "image/png",
+ "sizes": "512x512",
+ "purpose": "maskable"
+ }
+ ],
+ "start_url": "/",
+ "display": "standalone",
+ "scope": "/",
+ "description": "Dummy.",
+ "theme_color": "red",
+ "background_color": "red"
+}
diff --git a/examples/rails_app/engines/weather/test/dummy/app/views/pwa/service-worker.js b/examples/rails_app/engines/weather/test/dummy/app/views/pwa/service-worker.js
new file mode 100644
index 00000000..b3a13fb7
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/app/views/pwa/service-worker.js
@@ -0,0 +1,26 @@
+// Add a service worker for processing Web Push notifications:
+//
+// self.addEventListener("push", async (event) => {
+// const { title, options } = await event.data.json()
+// event.waitUntil(self.registration.showNotification(title, options))
+// })
+//
+// self.addEventListener("notificationclick", function(event) {
+// event.notification.close()
+// event.waitUntil(
+// clients.matchAll({ type: "window" }).then((clientList) => {
+// for (let i = 0; i < clientList.length; i++) {
+// let client = clientList[i]
+// let clientPath = (new URL(client.url)).pathname
+//
+// if (clientPath == event.notification.data.path && "focus" in client) {
+// return client.focus()
+// }
+// }
+//
+// if (clients.openWindow) {
+// return clients.openWindow(event.notification.data.path)
+// }
+// })
+// )
+// })
diff --git a/examples/rails_app/engines/weather/test/dummy/bin/rails b/examples/rails_app/engines/weather/test/dummy/bin/rails
new file mode 100755
index 00000000..efc03774
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/bin/rails
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+APP_PATH = File.expand_path("../config/application", __dir__)
+require_relative "../config/boot"
+require "rails/commands"
diff --git a/examples/rails_app/engines/weather/test/dummy/bin/rake b/examples/rails_app/engines/weather/test/dummy/bin/rake
new file mode 100755
index 00000000..4fbf10b9
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/bin/rake
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require_relative "../config/boot"
+require "rake"
+Rake.application.run
diff --git a/examples/rails_app/engines/weather/test/dummy/bin/setup b/examples/rails_app/engines/weather/test/dummy/bin/setup
new file mode 100755
index 00000000..027ead2e
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/bin/setup
@@ -0,0 +1,37 @@
+#!/usr/bin/env ruby
+require "fileutils"
+
+APP_ROOT = File.expand_path("..", __dir__)
+APP_NAME = "dummy"
+
+def system!(*args)
+ system(*args, exception: true)
+end
+
+FileUtils.chdir APP_ROOT do
+ # This script is a way to set up or update your development environment automatically.
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
+ # Add necessary setup steps to this file.
+
+ puts "== Installing dependencies =="
+ system! "gem install bundler --conservative"
+ system("bundle check") || system!("bundle install")
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?("config/database.yml")
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
+ # end
+
+ puts "\n== Preparing database =="
+ system! "bin/rails db:prepare"
+
+ puts "\n== Removing old logs and tempfiles =="
+ system! "bin/rails log:clear tmp:clear"
+
+ puts "\n== Restarting application server =="
+ system! "bin/rails restart"
+
+ # puts "\n== Configuring puma-dev =="
+ # system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
+ # system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/config.ru b/examples/rails_app/engines/weather/test/dummy/config.ru
new file mode 100644
index 00000000..4a3c09a6
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config.ru
@@ -0,0 +1,6 @@
+# This file is used by Rack-based servers to start the application.
+
+require_relative "config/environment"
+
+run Rails.application
+Rails.application.load_server
diff --git a/examples/rails_app/engines/weather/test/dummy/config/application.rb b/examples/rails_app/engines/weather/test/dummy/config/application.rb
new file mode 100644
index 00000000..6e61f6bf
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/application.rb
@@ -0,0 +1,29 @@
+require_relative "boot"
+
+require "rails/all"
+
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(*Rails.groups)
+
+module Dummy
+ class Application < Rails::Application
+ config.load_defaults Rails::VERSION::STRING.to_f
+
+ # For compatibility with applications that use this config
+ config.action_controller.include_all_helpers = false
+
+ # Please, add to the `ignore` list any other `lib` subdirectories that do
+ # not contain `.rb` files, or that should not be reloaded or eager loaded.
+ # Common ones are `templates`, `generators`, or `middleware`, for example.
+ config.autoload_lib(ignore: %w[assets tasks])
+
+ # Configuration for the application, engines, and railties goes here.
+ #
+ # These settings can be overridden in specific environments using the files
+ # in config/environments, which are processed later.
+ #
+ # config.time_zone = "Central Time (US & Canada)"
+ # config.eager_load_paths << Rails.root.join("extras")
+ end
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/config/boot.rb b/examples/rails_app/engines/weather/test/dummy/config/boot.rb
new file mode 100644
index 00000000..116591a4
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/boot.rb
@@ -0,0 +1,5 @@
+# Set up gems listed in the Gemfile.
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
+
+require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
+$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
diff --git a/examples/rails_app/engines/weather/test/dummy/config/cable.yml b/examples/rails_app/engines/weather/test/dummy/config/cable.yml
new file mode 100644
index 00000000..98367f89
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/cable.yml
@@ -0,0 +1,10 @@
+development:
+ adapter: async
+
+test:
+ adapter: test
+
+production:
+ adapter: redis
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
+ channel_prefix: dummy_production
diff --git a/examples/rails_app/engines/weather/test/dummy/config/database.yml b/examples/rails_app/engines/weather/test/dummy/config/database.yml
new file mode 100644
index 00000000..01bebb50
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/database.yml
@@ -0,0 +1,32 @@
+# SQLite. Versions 3.8.0 and up are supported.
+# gem install sqlite3
+#
+# Ensure the SQLite 3 gem is defined in your Gemfile
+# gem "sqlite3"
+#
+default: &default
+ adapter: sqlite3
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
+ timeout: 5000
+
+development:
+ <<: *default
+ database: storage/development.sqlite3
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ <<: *default
+ database: storage/test.sqlite3
+
+
+# SQLite3 write its data on the local filesystem, as such it requires
+# persistent disks. If you are deploying to a managed service, you should
+# make sure it provides disk persistence, as many don't.
+#
+# Similarly, if you deploy your application as a Docker container, you must
+# ensure the database is located in a persisted volume.
+production:
+ <<: *default
+ # database: path/to/persistent/storage/production.sqlite3
diff --git a/examples/rails_app/engines/weather/test/dummy/config/environment.rb b/examples/rails_app/engines/weather/test/dummy/config/environment.rb
new file mode 100644
index 00000000..cac53157
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the Rails application.
+require_relative "application"
+
+# Initialize the Rails application.
+Rails.application.initialize!
diff --git a/examples/rails_app/engines/weather/test/dummy/config/environments/development.rb b/examples/rails_app/engines/weather/test/dummy/config/environments/development.rb
new file mode 100644
index 00000000..c0a54a6d
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/environments/development.rb
@@ -0,0 +1,78 @@
+require "active_support/core_ext/integer/time"
+
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # In the development environment your application's code is reloaded any time
+ # it changes. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
+ config.enable_reloading = true
+
+ # Do not eager load code on boot.
+ config.eager_load = false
+
+ # Show full error reports.
+ config.consider_all_requests_local = true
+
+ # Enable server timing.
+ config.server_timing = true
+
+ # Enable/disable caching. By default caching is disabled.
+ # Run rails dev:cache to toggle caching.
+ if Rails.root.join("tmp/caching-dev.txt").exist?
+ config.action_controller.perform_caching = true
+ config.action_controller.enable_fragment_cache_logging = true
+
+ config.cache_store = :memory_store
+ config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
+ else
+ config.action_controller.perform_caching = false
+
+ config.cache_store = :null_store
+ end
+
+ # Store uploaded files on the local file system (see config/storage.yml for options).
+ config.active_storage.service = :local
+
+ # Don't care if the mailer can't send.
+ config.action_mailer.raise_delivery_errors = false
+
+ # Disable caching for Action Mailer templates even if Action Controller
+ # caching is enabled.
+ config.action_mailer.perform_caching = false
+
+ config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
+
+ # Print deprecation notices to the Rails logger.
+ config.active_support.deprecation = :log
+
+ # Raise exceptions for disallowed deprecations.
+ config.active_support.disallowed_deprecation = :raise
+
+ # Tell Active Support which deprecation messages to disallow.
+ config.active_support.disallowed_deprecation_warnings = []
+
+ # Raise an error on page load if there are pending migrations.
+ config.active_record.migration_error = :page_load
+
+ # Highlight code that triggered database queries in logs.
+ config.active_record.verbose_query_logs = true
+
+ # Highlight code that enqueued background job in logs.
+ config.active_job.verbose_enqueue_logs = true
+
+ # Suppress logger output for asset requests.
+ config.assets.quiet = true
+
+ # Raises error for missing translations.
+ # config.i18n.raise_on_missing_translations = true
+
+ # Annotate rendered view with file names.
+ config.action_view.annotate_rendered_view_with_filenames = true
+
+ # Uncomment if you wish to allow Action Cable access from any origin.
+ # config.action_cable.disable_request_forgery_protection = true
+
+ # Raise error when a before_action's only/except options reference missing actions.
+ config.action_controller.raise_on_missing_callback_actions = true
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/config/environments/production.rb b/examples/rails_app/engines/weather/test/dummy/config/environments/production.rb
new file mode 100644
index 00000000..d8c97560
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/environments/production.rb
@@ -0,0 +1,105 @@
+require "active_support/core_ext/integer/time"
+
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # Code is not reloaded between requests.
+ config.enable_reloading = false
+
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both threaded web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
+ # Full error reports are disabled and caching is turned on.
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
+ # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
+ # config.require_master_key = true
+
+ # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
+ # config.public_file_server.enabled = false
+
+ # Compress CSS using a preprocessor.
+ # config.assets.css_compressor = :sass
+
+ # Do not fall back to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = false
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
+ # config.asset_host = "http://assets.example.com"
+
+ # Specifies the header that your server uses for sending files.
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
+
+ # Store uploaded files on the local file system (see config/storage.yml for options).
+ config.active_storage.service = :local
+
+ # Mount Action Cable outside main process or domain.
+ # config.action_cable.mount_path = nil
+ # config.action_cable.url = "wss://example.com/cable"
+ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
+
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
+ # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
+ # config.assume_ssl = true
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ config.force_ssl = true
+
+ # Skip http-to-https redirect for the default health check endpoint.
+ # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
+
+ # Log to STDOUT by default
+ config.logger = ActiveSupport::Logger.new(STDOUT)
+ .tap { |logger| logger.formatter = ::Logger::Formatter.new }
+ .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
+
+ # Prepend all log lines with the following tags.
+ config.log_tags = [ :request_id ]
+
+ # "info" includes generic and useful information about system operation, but avoids logging too much
+ # information to avoid inadvertent exposure of personally identifiable information (PII). If you
+ # want to log everything, set the level to "debug".
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
+
+ # Use a different cache store in production.
+ # config.cache_store = :mem_cache_store
+
+ # Use a real queuing backend for Active Job (and separate queues per environment).
+ # config.active_job.queue_adapter = :resque
+ # config.active_job.queue_name_prefix = "dummy_production"
+
+ # Disable caching for Action Mailer templates even if Action Controller
+ # caching is enabled.
+ config.action_mailer.perform_caching = false
+
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation cannot be found).
+ config.i18n.fallbacks = true
+
+ # Don't log any deprecations.
+ config.active_support.report_deprecations = false
+
+ # Do not dump schema after migrations.
+ config.active_record.dump_schema_after_migration = false
+
+ # Only use :id for inspections in production.
+ config.active_record.attributes_for_inspect = [ :id ]
+
+ # Enable DNS rebinding protection and other `Host` header attacks.
+ # config.hosts = [
+ # "example.com", # Allow requests from example.com
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
+ # ]
+ # Skip DNS rebinding protection for the default health check endpoint.
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/config/environments/test.rb b/examples/rails_app/engines/weather/test/dummy/config/environments/test.rb
new file mode 100644
index 00000000..0c616a1b
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/environments/test.rb
@@ -0,0 +1,67 @@
+require "active_support/core_ext/integer/time"
+
+# The test environment is used exclusively to run your application's
+# test suite. You never need to work with it otherwise. Remember that
+# your test database is "scratch space" for the test suite and is wiped
+# and recreated between test runs. Don't rely on the data there!
+
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # While tests run files are not watched, reloading is not necessary.
+ config.enable_reloading = false
+
+ # Eager loading loads your entire application. When running a single test locally,
+ # this is usually not necessary, and can slow down your test suite. However, it's
+ # recommended that you enable it in continuous integration systems to ensure eager
+ # loading is working properly before deploying your code.
+ config.eager_load = ENV["CI"].present?
+
+ # Configure public file server for tests with Cache-Control for performance.
+ config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+ config.cache_store = :null_store
+
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
+ config.action_dispatch.show_exceptions = :rescuable
+
+ # Disable request forgery protection in test environment.
+ config.action_controller.allow_forgery_protection = false
+
+ # Store uploaded files on the local file system in a temporary directory.
+ config.active_storage.service = :test
+
+ # Disable caching for Action Mailer templates even if Action Controller
+ # caching is enabled.
+ config.action_mailer.perform_caching = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Unlike controllers, the mailer instance doesn't have any context about the
+ # incoming request so you'll need to provide the :host parameter yourself.
+ config.action_mailer.default_url_options = { host: "www.example.com" }
+
+ # Print deprecation notices to the stderr.
+ config.active_support.deprecation = :stderr
+
+ # Raise exceptions for disallowed deprecations.
+ config.active_support.disallowed_deprecation = :raise
+
+ # Tell Active Support which deprecation messages to disallow.
+ config.active_support.disallowed_deprecation_warnings = []
+
+ # Raises error for missing translations.
+ # config.i18n.raise_on_missing_translations = true
+
+ # Annotate rendered view with file names.
+ # config.action_view.annotate_rendered_view_with_filenames = true
+
+ # Raise error when a before_action's only/except options reference missing actions.
+ config.action_controller.raise_on_missing_callback_actions = true
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/config/initializers/assets.rb b/examples/rails_app/engines/weather/test/dummy/config/initializers/assets.rb
new file mode 100644
index 00000000..bd5bcd2b
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/initializers/assets.rb
@@ -0,0 +1,12 @@
+# Be sure to restart your server when you modify this file.
+
+# Version of your assets, change this if you want to expire all your assets.
+Rails.application.config.assets.version = "1.0"
+
+# Add additional assets to the asset load path.
+# Rails.application.config.assets.paths << Emoji.images_path
+
+# Precompile additional assets.
+# application.js, application.css, and all non-JS/CSS in the app/assets
+# folder are already added.
+# Rails.application.config.assets.precompile += %w[ admin.js admin.css ]
diff --git a/examples/rails_app/engines/weather/test/dummy/config/initializers/content_security_policy.rb b/examples/rails_app/engines/weather/test/dummy/config/initializers/content_security_policy.rb
new file mode 100644
index 00000000..b3076b38
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/initializers/content_security_policy.rb
@@ -0,0 +1,25 @@
+# Be sure to restart your server when you modify this file.
+
+# Define an application-wide content security policy.
+# See the Securing Rails Applications Guide for more information:
+# https://guides.rubyonrails.org/security.html#content-security-policy-header
+
+# Rails.application.configure do
+# config.content_security_policy do |policy|
+# policy.default_src :self, :https
+# policy.font_src :self, :https, :data
+# policy.img_src :self, :https, :data
+# policy.object_src :none
+# policy.script_src :self, :https
+# policy.style_src :self, :https
+# # Specify URI for violation reports
+# # policy.report_uri "/csp-violation-report-endpoint"
+# end
+#
+# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
+# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
+# config.content_security_policy_nonce_directives = %w(script-src style-src)
+#
+# # Report violations without enforcing the policy.
+# # config.content_security_policy_report_only = true
+# end
diff --git a/examples/rails_app/engines/weather/test/dummy/config/initializers/filter_parameter_logging.rb b/examples/rails_app/engines/weather/test/dummy/config/initializers/filter_parameter_logging.rb
new file mode 100644
index 00000000..c010b83d
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
+# Use this to limit dissemination of sensitive information.
+# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
+Rails.application.config.filter_parameters += [
+ :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
+]
diff --git a/examples/rails_app/engines/weather/test/dummy/config/initializers/inflections.rb b/examples/rails_app/engines/weather/test/dummy/config/initializers/inflections.rb
new file mode 100644
index 00000000..3860f659
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/initializers/inflections.rb
@@ -0,0 +1,16 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.plural /^(ox)$/i, "\\1en"
+# inflect.singular /^(ox)en/i, "\\1"
+# inflect.irregular "person", "people"
+# inflect.uncountable %w( fish sheep )
+# end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.acronym "RESTful"
+# end
diff --git a/examples/rails_app/engines/weather/test/dummy/config/initializers/permissions_policy.rb b/examples/rails_app/engines/weather/test/dummy/config/initializers/permissions_policy.rb
new file mode 100644
index 00000000..7db3b957
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/initializers/permissions_policy.rb
@@ -0,0 +1,13 @@
+# Be sure to restart your server when you modify this file.
+
+# Define an application-wide HTTP permissions policy. For further
+# information see: https://developers.google.com/web/updates/2018/06/feature-policy
+
+# Rails.application.config.permissions_policy do |policy|
+# policy.camera :none
+# policy.gyroscope :none
+# policy.microphone :none
+# policy.usb :none
+# policy.fullscreen :self
+# policy.payment :self, "https://secure.example.com"
+# end
diff --git a/examples/rails_app/engines/weather/test/dummy/config/locales/en.yml b/examples/rails_app/engines/weather/test/dummy/config/locales/en.yml
new file mode 100644
index 00000000..6c349ae5
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/locales/en.yml
@@ -0,0 +1,31 @@
+# Files in the config/locales directory are used for internationalization and
+# are automatically loaded by Rails. If you want to use locales other than
+# English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+# I18n.t "hello"
+#
+# In views, this is aliased to just `t`:
+#
+# <%= t("hello") %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+# I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more about the API, please read the Rails Internationalization guide
+# at https://guides.rubyonrails.org/i18n.html.
+#
+# Be aware that YAML interprets the following case-insensitive strings as
+# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
+# must be quoted to be interpreted as strings. For example:
+#
+# en:
+# "yes": yup
+# enabled: "ON"
+
+en:
+ hello: "Hello world"
diff --git a/examples/rails_app/engines/weather/test/dummy/config/puma.rb b/examples/rails_app/engines/weather/test/dummy/config/puma.rb
new file mode 100644
index 00000000..03c166f4
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/puma.rb
@@ -0,0 +1,34 @@
+# This configuration file will be evaluated by Puma. The top-level methods that
+# are invoked here are part of Puma's configuration DSL. For more information
+# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
+
+# Puma starts a configurable number of processes (workers) and each process
+# serves each request in a thread from an internal thread pool.
+#
+# The ideal number of threads per worker depends both on how much time the
+# application spends waiting for IO operations and on how much you wish to
+# to prioritize throughput over latency.
+#
+# As a rule of thumb, increasing the number of threads will increase how much
+# traffic a given process can handle (throughput), but due to CRuby's
+# Global VM Lock (GVL) it has diminishing returns and will degrade the
+# response time (latency) of the application.
+#
+# The default is set to 3 threads as it's deemed a decent compromise between
+# throughput and latency for the average Rails application.
+#
+# Any libraries that use a connection pool or another resource pool should
+# be configured to provide at least as many connections as the number of
+# threads. This includes Active Record's `pool` parameter in `database.yml`.
+threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
+threads threads_count, threads_count
+
+# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
+port ENV.fetch("PORT", 3000)
+
+# Allow puma to be restarted by `bin/rails restart` command.
+plugin :tmp_restart
+
+# Specify the PID file. Defaults to tmp/pids/server.pid in development.
+# In other environments, only set the PID file if requested.
+pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
diff --git a/examples/rails_app/engines/weather/test/dummy/config/routes.rb b/examples/rails_app/engines/weather/test/dummy/config/routes.rb
new file mode 100644
index 00000000..11dba841
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/routes.rb
@@ -0,0 +1,3 @@
+Rails.application.routes.draw do
+ mount Weather::Engine => "/weather"
+end
diff --git a/examples/rails_app/engines/weather/test/dummy/config/storage.yml b/examples/rails_app/engines/weather/test/dummy/config/storage.yml
new file mode 100644
index 00000000..4942ab66
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/config/storage.yml
@@ -0,0 +1,34 @@
+test:
+ service: Disk
+ root: <%= Rails.root.join("tmp/storage") %>
+
+local:
+ service: Disk
+ root: <%= Rails.root.join("storage") %>
+
+# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
+# amazon:
+# service: S3
+# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
+# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
+# region: us-east-1
+# bucket: your_own_bucket-<%= Rails.env %>
+
+# Remember not to checkin your GCS keyfile to a repository
+# google:
+# service: GCS
+# project: your_project
+# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
+# bucket: your_own_bucket-<%= Rails.env %>
+
+# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
+# microsoft:
+# service: AzureStorage
+# storage_account_name: your_account_name
+# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
+# container: your_container_name-<%= Rails.env %>
+
+# mirror:
+# service: Mirror
+# primary: local
+# mirrors: [ amazon, google, microsoft ]
diff --git a/examples/rails_app/engines/weather/test/dummy/lib/assets/.keep b/examples/rails_app/engines/weather/test/dummy/lib/assets/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/dummy/log/.keep b/examples/rails_app/engines/weather/test/dummy/log/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/dummy/public/404.html b/examples/rails_app/engines/weather/test/dummy/public/404.html
new file mode 100644
index 00000000..2be3af26
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/public/404.html
@@ -0,0 +1,67 @@
+
+
+
+ The page you were looking for doesn't exist (404)
+
+
+
+
+
+
+
+
+
The page you were looking for doesn't exist.
+
You may have mistyped the address or the page may have moved.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/examples/rails_app/engines/weather/test/dummy/public/406-unsupported-browser.html b/examples/rails_app/engines/weather/test/dummy/public/406-unsupported-browser.html
new file mode 100644
index 00000000..7cf1e168
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/public/406-unsupported-browser.html
@@ -0,0 +1,66 @@
+
+
+
+ Your browser is not supported (406)
+
+
+
+
+
+
+
+
+
Your browser is not supported.
+
Please upgrade your browser to continue.
+
+
+
+
diff --git a/examples/rails_app/engines/weather/test/dummy/public/422.html b/examples/rails_app/engines/weather/test/dummy/public/422.html
new file mode 100644
index 00000000..c08eac0d
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/public/422.html
@@ -0,0 +1,67 @@
+
+
+
+ The change you wanted was rejected (422)
+
+
+
+
+
+
+
+
+
The change you wanted was rejected.
+
Maybe you tried to change something you didn't have access to.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/examples/rails_app/engines/weather/test/dummy/public/500.html b/examples/rails_app/engines/weather/test/dummy/public/500.html
new file mode 100644
index 00000000..78a030af
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/public/500.html
@@ -0,0 +1,66 @@
+
+
+
+ We're sorry, but something went wrong (500)
+
+
+
+
+
+
+
+
+
We're sorry, but something went wrong.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/examples/rails_app/engines/weather/test/dummy/public/icon.png b/examples/rails_app/engines/weather/test/dummy/public/icon.png
new file mode 100644
index 00000000..f3b5abcb
Binary files /dev/null and b/examples/rails_app/engines/weather/test/dummy/public/icon.png differ
diff --git a/examples/rails_app/engines/weather/test/dummy/public/icon.svg b/examples/rails_app/engines/weather/test/dummy/public/icon.svg
new file mode 100644
index 00000000..78307ccd
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/dummy/public/icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/examples/rails_app/engines/weather/test/dummy/storage/.keep b/examples/rails_app/engines/weather/test/dummy/storage/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/dummy/tmp/.keep b/examples/rails_app/engines/weather/test/dummy/tmp/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/dummy/tmp/pids/.keep b/examples/rails_app/engines/weather/test/dummy/tmp/pids/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/dummy/tmp/storage/.keep b/examples/rails_app/engines/weather/test/dummy/tmp/storage/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/fixtures/files/.keep b/examples/rails_app/engines/weather/test/fixtures/files/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/helpers/.keep b/examples/rails_app/engines/weather/test/helpers/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/integration/.keep b/examples/rails_app/engines/weather/test/integration/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/integration/navigation_test.rb b/examples/rails_app/engines/weather/test/integration/navigation_test.rb
new file mode 100644
index 00000000..ebbc098a
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/integration/navigation_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class NavigationTest < ActionDispatch::IntegrationTest
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/examples/rails_app/engines/weather/test/mailers/.keep b/examples/rails_app/engines/weather/test/mailers/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/models/.keep b/examples/rails_app/engines/weather/test/models/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/rails_app/engines/weather/test/test_helper.rb b/examples/rails_app/engines/weather/test/test_helper.rb
new file mode 100644
index 00000000..cf669c89
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/test_helper.rb
@@ -0,0 +1,15 @@
+# Configure Rails Environment
+ENV["RAILS_ENV"] = "test"
+
+require_relative "../test/dummy/config/environment"
+ActiveRecord::Migrator.migrations_paths = [ File.expand_path("../test/dummy/db/migrate", __dir__) ]
+ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__)
+require "rails/test_help"
+
+# Load fixtures from the engine
+if ActiveSupport::TestCase.respond_to?(:fixture_paths=)
+ ActiveSupport::TestCase.fixture_paths = [ File.expand_path("fixtures", __dir__) ]
+ ActionDispatch::IntegrationTest.fixture_paths = ActiveSupport::TestCase.fixture_paths
+ ActiveSupport::TestCase.file_fixture_path = File.expand_path("fixtures", __dir__) + "/files"
+ ActiveSupport::TestCase.fixtures :all
+end
diff --git a/examples/rails_app/engines/weather/test/weather_test.rb b/examples/rails_app/engines/weather/test/weather_test.rb
new file mode 100644
index 00000000..b35a5c10
--- /dev/null
+++ b/examples/rails_app/engines/weather/test/weather_test.rb
@@ -0,0 +1,7 @@
+require "test_helper"
+
+class WeatherTest < ActiveSupport::TestCase
+ test "it has a version number" do
+ assert Weather::VERSION
+ end
+end
diff --git a/examples/rails_app/engines/weather/weather.gemspec b/examples/rails_app/engines/weather/weather.gemspec
new file mode 100644
index 00000000..88cf5877
--- /dev/null
+++ b/examples/rails_app/engines/weather/weather.gemspec
@@ -0,0 +1,24 @@
+require_relative "lib/weather/version"
+
+Gem::Specification.new do |spec|
+ spec.name = "weather"
+ spec.version = Weather::VERSION
+ spec.authors = [ "Joshua Studt" ]
+ spec.email = [ "fake.email@example.com" ]
+ spec.homepage = "http://mygemserver.com"
+ spec.summary = "Summary of Weather."
+ spec.description = "Description of Weather."
+
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
+ spec.metadata["allowed_push_host"] = "Set to 'http://mygemserver.com'"
+
+ spec.metadata["homepage_uri"] = spec.homepage
+ spec.metadata["source_code_uri"] = "http://mygemserver.com"
+
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
+ Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
+ end
+
+ spec.add_dependency "rails", ">= 7.2.2.1"
+end
diff --git a/examples/rails_app/test/test_helper.rb b/examples/rails_app/test/test_helper.rb
index 1bce6720..e134534d 100644
--- a/examples/rails_app/test/test_helper.rb
+++ b/examples/rails_app/test/test_helper.rb
@@ -1,5 +1,8 @@
ENV['RAILS_ENV'] ||= 'test'
+require_relative '../config/environment'
+require 'rails/test_help'
+
require 'openapi_first'
OpenapiFirst::Test.setup do |test|
test.register Rails.root.join('../../spec/data/train-travel-api/openapi.yaml')
@@ -7,9 +10,6 @@
test.coverage_formatter_options = { verbose: true }
end
-require_relative '../config/environment'
-require 'rails/test_help'
-
module ActiveSupport
class TestCase
# Run tests in parallel with specified workers