├── .github ├── FUNDING.yml └── workflows │ └── ci.yml ├── .gitignore ├── CHANGELOG.md ├── Gemfile ├── Gemfile.lock ├── MIT-LICENSE ├── README.md ├── Rakefile ├── app ├── assets │ ├── config │ │ └── signalman_manifest.js │ ├── images │ │ └── signalman │ │ │ └── .keep │ └── stylesheets │ │ └── signalman │ │ └── .keep ├── controllers │ ├── .keep │ ├── concerns │ │ └── .keep │ └── signalman │ │ ├── application_controller.rb │ │ ├── generators │ │ ├── models_controller.rb │ │ └── scaffolds_controller.rb │ │ ├── jobs_controller.rb │ │ ├── mails_controller.rb │ │ ├── queries_controller.rb │ │ ├── requests_controller.rb │ │ └── views_controller.rb ├── helpers │ ├── .keep │ └── signalman │ │ └── events_helper.rb ├── jobs │ └── .keep ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── concerns │ │ └── .keep │ ├── signalman.rb │ └── signalman │ │ └── event.rb └── views │ ├── .keep │ ├── layouts │ └── signalman │ │ └── application.html.erb │ └── signalman │ ├── generators │ ├── models │ │ ├── create.html.erb │ │ └── show.html.erb │ └── scaffolds │ │ ├── create.html.erb │ │ └── show.html.erb │ ├── jobs │ ├── index.html.erb │ └── show.html.erb │ ├── mails │ ├── index.html.erb │ └── show.html.erb │ ├── queries │ ├── index.html.erb │ └── show.html.erb │ ├── requests │ ├── index.html.erb │ └── show.html.erb │ ├── shared │ ├── _flash.html.erb │ └── _nav.html.erb │ └── views │ ├── index.html.erb │ └── show.html.erb ├── bin └── rails ├── config └── routes.rb ├── db └── migrate │ └── 20230729122215_create_signalman_events.rb ├── lib ├── signalman.rb ├── signalman │ ├── action_handler.rb │ ├── base_handler.rb │ ├── engine.rb │ ├── job_handler.rb │ ├── mail_handler.rb │ ├── query_handler.rb │ ├── version.rb │ └── view_handler.rb └── tasks │ └── signalman_tasks.rake ├── signalman.gemspec └── test ├── application_system_test_case.rb ├── controllers └── .keep ├── dummy ├── Rakefile ├── app │ ├── assets │ │ ├── config │ │ │ └── manifest.js │ │ ├── images │ │ │ └── .keep │ │ └── stylesheets │ │ │ └── application.css │ ├── channels │ │ └── application_cable │ │ │ ├── channel.rb │ │ │ └── connection.rb │ ├── controllers │ │ ├── application_controller.rb │ │ ├── concerns │ │ │ └── .keep │ │ └── main_controller.rb │ ├── helpers │ │ └── application_helper.rb │ ├── javascript │ │ └── application.js │ ├── jobs │ │ └── application_job.rb │ ├── mailers │ │ ├── application_mailer.rb │ │ └── user_mailer.rb │ ├── models │ │ ├── application_record.rb │ │ ├── concerns │ │ │ └── .keep │ │ └── user.rb │ └── views │ │ ├── layouts │ │ ├── application.html.erb │ │ ├── mailer.html.erb │ │ └── mailer.text.erb │ │ ├── main │ │ └── index.html.erb │ │ └── user_mailer │ │ ├── notification.html.erb │ │ └── notification.text.erb ├── bin │ ├── importmap │ ├── rails │ ├── rake │ └── setup ├── config.ru ├── config │ ├── application.rb │ ├── boot.rb │ ├── cable.yml │ ├── database.yml │ ├── environment.rb │ ├── environments │ │ ├── development.rb │ │ ├── production.rb │ │ └── test.rb │ ├── importmap.rb │ ├── initializers │ │ ├── assets.rb │ │ ├── content_security_policy.rb │ │ ├── filter_parameter_logging.rb │ │ ├── inflections.rb │ │ └── permissions_policy.rb │ ├── locales │ │ └── en.yml │ ├── puma.rb │ ├── routes.rb │ └── storage.yml ├── db │ ├── migrate │ │ └── 20230730020301_create_users.rb │ └── schema.rb ├── lib │ └── assets │ │ └── .keep ├── public │ ├── 404.html │ ├── 422.html │ ├── 500.html │ ├── apple-touch-icon-precomposed.png │ ├── apple-touch-icon.png │ └── favicon.ico ├── test │ ├── fixtures │ │ └── users.yml │ ├── mailers │ │ ├── previews │ │ │ └── user_mailer_preview.rb │ │ └── user_mailer_test.rb │ └── models │ │ └── user_test.rb └── vendor │ └── javascript │ └── .keep ├── fixtures ├── files │ └── .keep └── signalman │ └── events.yml ├── helpers └── .keep ├── integration ├── .keep └── navigation_test.rb ├── mailers └── .keep ├── models ├── .keep └── signalman │ └── event_test.rb ├── signalman_test.rb ├── system ├── jobs_test.rb ├── mails_test.rb ├── queries_test.rb ├── requests_test.rb └── views_test.rb └── test_helper.rb /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [excid3] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - '*' 7 | push: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | sqlite: 13 | runs-on: ubuntu-latest 14 | env: 15 | BUNDLE_PATH_RELATIVE_TO_CWD: true 16 | steps: 17 | - name: SQLite3 version 18 | run: sqlite3 --version 19 | - uses: actions/checkout@v3 20 | - name: Set up Ruby 21 | uses: ruby/setup-ruby@v1 22 | with: 23 | ruby-version: 3.2 24 | bundler: default 25 | bundler-cache: true 26 | rubygems: latest 27 | - name: StandardRb check 28 | run: bundle exec standardrb 29 | - name: Run tests 30 | env: 31 | DATABASE_URL: "sqlite3:signalman_test" 32 | run: | 33 | bin/rails db:test:prepare 34 | bin/rails test:all 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /doc/ 3 | /log/*.log 4 | /pkg/ 5 | /tmp/ 6 | /test/dummy/db/*.sqlite3 7 | /test/dummy/db/*.sqlite3-* 8 | /test/dummy/log/*.log 9 | /test/dummy/storage/ 10 | /test/dummy/tmp/ 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### Unreleased 2 | 3 | ### 0.1.2 4 | 5 | * Skip SQL events like CREATE_TABLE and ActiveRecord::InternalMetadata 6 | 7 | ### 0.1.1 8 | 9 | * Skip SchemaMigration SQL events 10 | * Safely ignore failures to create signalman_events when the table doesn't exist 11 | 12 | ### 0.1.0 13 | 14 | * Initial release with basic functionality 15 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | # Specify your gem's dependencies in signalman.gemspec. 5 | gemspec 6 | 7 | gem "puma" 8 | gem "sqlite3" 9 | gem "sprockets-rails" 10 | gem "turbo-rails" 11 | gem "importmap-rails" 12 | gem "redis" 13 | 14 | group :development, :test do 15 | gem "capybara" 16 | gem "selenium-webdriver" 17 | gem "standardrb", "~> 1.0" 18 | gem "debug", ">= 1.0.0" 19 | end 20 | 21 | group :development do 22 | gem "web-console" 23 | end 24 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | signalman (0.1.2) 5 | rails (>= 7.0.0) 6 | 7 | GEM 8 | remote: https://rubygems.org/ 9 | specs: 10 | actioncable (7.0.6) 11 | actionpack (= 7.0.6) 12 | activesupport (= 7.0.6) 13 | nio4r (~> 2.0) 14 | websocket-driver (>= 0.6.1) 15 | actionmailbox (7.0.6) 16 | actionpack (= 7.0.6) 17 | activejob (= 7.0.6) 18 | activerecord (= 7.0.6) 19 | activestorage (= 7.0.6) 20 | activesupport (= 7.0.6) 21 | mail (>= 2.7.1) 22 | net-imap 23 | net-pop 24 | net-smtp 25 | actionmailer (7.0.6) 26 | actionpack (= 7.0.6) 27 | actionview (= 7.0.6) 28 | activejob (= 7.0.6) 29 | activesupport (= 7.0.6) 30 | mail (~> 2.5, >= 2.5.4) 31 | net-imap 32 | net-pop 33 | net-smtp 34 | rails-dom-testing (~> 2.0) 35 | actionpack (7.0.6) 36 | actionview (= 7.0.6) 37 | activesupport (= 7.0.6) 38 | rack (~> 2.0, >= 2.2.4) 39 | rack-test (>= 0.6.3) 40 | rails-dom-testing (~> 2.0) 41 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 42 | actiontext (7.0.6) 43 | actionpack (= 7.0.6) 44 | activerecord (= 7.0.6) 45 | activestorage (= 7.0.6) 46 | activesupport (= 7.0.6) 47 | globalid (>= 0.6.0) 48 | nokogiri (>= 1.8.5) 49 | actionview (7.0.6) 50 | activesupport (= 7.0.6) 51 | builder (~> 3.1) 52 | erubi (~> 1.4) 53 | rails-dom-testing (~> 2.0) 54 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 55 | activejob (7.0.6) 56 | activesupport (= 7.0.6) 57 | globalid (>= 0.3.6) 58 | activemodel (7.0.6) 59 | activesupport (= 7.0.6) 60 | activerecord (7.0.6) 61 | activemodel (= 7.0.6) 62 | activesupport (= 7.0.6) 63 | activestorage (7.0.6) 64 | actionpack (= 7.0.6) 65 | activejob (= 7.0.6) 66 | activerecord (= 7.0.6) 67 | activesupport (= 7.0.6) 68 | marcel (~> 1.0) 69 | mini_mime (>= 1.1.0) 70 | activesupport (7.0.6) 71 | concurrent-ruby (~> 1.0, >= 1.0.2) 72 | i18n (>= 1.6, < 2) 73 | minitest (>= 5.1) 74 | tzinfo (~> 2.0) 75 | addressable (2.8.5) 76 | public_suffix (>= 2.0.2, < 6.0) 77 | ast (2.4.2) 78 | bindex (0.8.1) 79 | builder (3.2.4) 80 | capybara (3.39.2) 81 | addressable 82 | matrix 83 | mini_mime (>= 0.1.3) 84 | nokogiri (~> 1.8) 85 | rack (>= 1.6.0) 86 | rack-test (>= 0.6.3) 87 | regexp_parser (>= 1.5, < 3.0) 88 | xpath (~> 3.2) 89 | concurrent-ruby (1.2.2) 90 | connection_pool (2.4.1) 91 | crass (1.0.6) 92 | date (3.3.3) 93 | debug (1.8.0) 94 | irb (>= 1.5.0) 95 | reline (>= 0.3.1) 96 | erubi (1.12.0) 97 | globalid (1.1.0) 98 | activesupport (>= 5.0) 99 | i18n (1.14.1) 100 | concurrent-ruby (~> 1.0) 101 | importmap-rails (1.2.1) 102 | actionpack (>= 6.0.0) 103 | railties (>= 6.0.0) 104 | io-console (0.6.0) 105 | irb (1.7.4) 106 | reline (>= 0.3.6) 107 | json (2.6.3) 108 | language_server-protocol (3.17.0.3) 109 | lint_roller (1.1.0) 110 | loofah (2.21.3) 111 | crass (~> 1.0.2) 112 | nokogiri (>= 1.12.0) 113 | mail (2.8.1) 114 | mini_mime (>= 0.1.1) 115 | net-imap 116 | net-pop 117 | net-smtp 118 | marcel (1.0.2) 119 | matrix (0.4.2) 120 | method_source (1.0.0) 121 | mini_mime (1.1.2) 122 | minitest (5.19.0) 123 | net-imap (0.3.7) 124 | date 125 | net-protocol 126 | net-pop (0.1.2) 127 | net-protocol 128 | net-protocol (0.2.1) 129 | timeout 130 | net-smtp (0.3.3) 131 | net-protocol 132 | nio4r (2.5.9) 133 | nokogiri (1.15.3-aarch64-linux) 134 | racc (~> 1.4) 135 | nokogiri (1.15.3-arm64-darwin) 136 | racc (~> 1.4) 137 | nokogiri (1.15.3-x86_64-darwin) 138 | racc (~> 1.4) 139 | nokogiri (1.15.3-x86_64-linux) 140 | racc (~> 1.4) 141 | parallel (1.23.0) 142 | parser (3.2.2.3) 143 | ast (~> 2.4.1) 144 | racc 145 | public_suffix (5.0.3) 146 | puma (6.3.0) 147 | nio4r (~> 2.0) 148 | racc (1.7.1) 149 | rack (2.2.8) 150 | rack-test (2.1.0) 151 | rack (>= 1.3) 152 | rails (7.0.6) 153 | actioncable (= 7.0.6) 154 | actionmailbox (= 7.0.6) 155 | actionmailer (= 7.0.6) 156 | actionpack (= 7.0.6) 157 | actiontext (= 7.0.6) 158 | actionview (= 7.0.6) 159 | activejob (= 7.0.6) 160 | activemodel (= 7.0.6) 161 | activerecord (= 7.0.6) 162 | activestorage (= 7.0.6) 163 | activesupport (= 7.0.6) 164 | bundler (>= 1.15.0) 165 | railties (= 7.0.6) 166 | rails-dom-testing (2.2.0) 167 | activesupport (>= 5.0.0) 168 | minitest 169 | nokogiri (>= 1.6) 170 | rails-html-sanitizer (1.6.0) 171 | loofah (~> 2.21) 172 | nokogiri (~> 1.14) 173 | railties (7.0.6) 174 | actionpack (= 7.0.6) 175 | activesupport (= 7.0.6) 176 | method_source 177 | rake (>= 12.2) 178 | thor (~> 1.0) 179 | zeitwerk (~> 2.5) 180 | rainbow (3.1.1) 181 | rake (13.0.6) 182 | redis (5.0.6) 183 | redis-client (>= 0.9.0) 184 | redis-client (0.15.0) 185 | connection_pool 186 | regexp_parser (2.8.1) 187 | reline (0.3.7) 188 | io-console (~> 0.5) 189 | rexml (3.2.6) 190 | rubocop (1.52.1) 191 | json (~> 2.3) 192 | parallel (~> 1.10) 193 | parser (>= 3.2.2.3) 194 | rainbow (>= 2.2.2, < 4.0) 195 | regexp_parser (>= 1.8, < 3.0) 196 | rexml (>= 3.2.5, < 4.0) 197 | rubocop-ast (>= 1.28.0, < 2.0) 198 | ruby-progressbar (~> 1.7) 199 | unicode-display_width (>= 2.4.0, < 3.0) 200 | rubocop-ast (1.29.0) 201 | parser (>= 3.2.1.0) 202 | rubocop-performance (1.18.0) 203 | rubocop (>= 1.7.0, < 2.0) 204 | rubocop-ast (>= 0.4.0) 205 | ruby-progressbar (1.13.0) 206 | rubyzip (2.3.2) 207 | selenium-webdriver (4.11.0) 208 | rexml (~> 3.2, >= 3.2.5) 209 | rubyzip (>= 1.2.2, < 3.0) 210 | websocket (~> 1.0) 211 | sprockets (4.2.0) 212 | concurrent-ruby (~> 1.0) 213 | rack (>= 2.2.4, < 4) 214 | sprockets-rails (3.4.2) 215 | actionpack (>= 5.2) 216 | activesupport (>= 5.2) 217 | sprockets (>= 3.0.0) 218 | sqlite3 (1.6.3-aarch64-linux) 219 | sqlite3 (1.6.3-arm64-darwin) 220 | sqlite3 (1.6.3-x86_64-darwin) 221 | sqlite3 (1.6.3-x86_64-linux) 222 | standard (1.30.1) 223 | language_server-protocol (~> 3.17.0.2) 224 | lint_roller (~> 1.0) 225 | rubocop (~> 1.52.0) 226 | standard-custom (~> 1.0.0) 227 | standard-performance (~> 1.1.0) 228 | standard-custom (1.0.2) 229 | lint_roller (~> 1.0) 230 | rubocop (~> 1.50) 231 | standard-performance (1.1.2) 232 | lint_roller (~> 1.1) 233 | rubocop-performance (~> 1.18.0) 234 | standardrb (1.0.1) 235 | standard 236 | thor (1.2.2) 237 | timeout (0.4.0) 238 | turbo-rails (1.4.0) 239 | actionpack (>= 6.0.0) 240 | activejob (>= 6.0.0) 241 | railties (>= 6.0.0) 242 | tzinfo (2.0.6) 243 | concurrent-ruby (~> 1.0) 244 | unicode-display_width (2.4.2) 245 | web-console (4.2.0) 246 | actionview (>= 6.0.0) 247 | activemodel (>= 6.0.0) 248 | bindex (>= 0.4.0) 249 | railties (>= 6.0.0) 250 | websocket (1.2.9) 251 | websocket-driver (0.7.6) 252 | websocket-extensions (>= 0.1.0) 253 | websocket-extensions (0.1.5) 254 | xpath (3.2.0) 255 | nokogiri (~> 1.8) 256 | zeitwerk (2.6.11) 257 | 258 | PLATFORMS 259 | aarch64-linux 260 | arm64-darwin-22 261 | x86_64-darwin-22 262 | x86_64-linux 263 | 264 | DEPENDENCIES 265 | capybara 266 | debug (>= 1.0.0) 267 | importmap-rails 268 | puma 269 | redis 270 | selenium-webdriver 271 | signalman! 272 | sprockets-rails 273 | sqlite3 274 | standardrb (~> 1.0) 275 | turbo-rails 276 | web-console 277 | 278 | BUNDLED WITH 279 | 2.4.17 280 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2023 Chris Oliver 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Signalman 2 | A debug tool for Ruby on Rails application. 3 | 4 | [](https://github.com/excid3/signalman/actions/workflows/ci.yml) 5 | 6 | ## Usage 7 | How to use my plugin. 8 | 9 | ## Installation 10 | Add this line to your application's Gemfile: 11 | 12 | ```ruby 13 | bundle add "signalman" --group "development" 14 | ``` 15 | 16 | Add migrations 17 | ```ruby 18 | bin/rails signalman:install:migrations 19 | ``` 20 | 21 | Mount to the Rails routes 22 | ```ruby 23 | mount Signalman::Engine => "/signalman" if Rails.env.development? 24 | ``` 25 | 26 | ## Contributing 27 | Contribution directions go here. 28 | 29 | ## License 30 | The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). 31 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/setup" 2 | 3 | APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__) 4 | load "rails/tasks/engine.rake" 5 | 6 | load "rails/tasks/statistics.rake" 7 | 8 | require "bundler/gem_tasks" 9 | require "rake/testtask" 10 | 11 | Rake::TestTask.new("test:all") do |t| 12 | t.libs << "test" 13 | t.pattern = "test/**/*_test.rb" 14 | t.verbose = false 15 | end 16 | 17 | task default: "test:all" 18 | -------------------------------------------------------------------------------- /app/assets/config/signalman_manifest.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/assets/config/signalman_manifest.js -------------------------------------------------------------------------------- /app/assets/images/signalman/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/assets/images/signalman/.keep -------------------------------------------------------------------------------- /app/assets/stylesheets/signalman/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/assets/stylesheets/signalman/.keep -------------------------------------------------------------------------------- /app/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/controllers/.keep -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/signalman/application_controller.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | class ApplicationController < ActionController::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/signalman/generators/models_controller.rb: -------------------------------------------------------------------------------- 1 | require "open3" 2 | 3 | module Signalman 4 | class Generators::ModelsController < ApplicationController 5 | def show 6 | end 7 | 8 | def create 9 | @fields = params[:fields].map { |field| [field[:name], field[:type]].join(":") } 10 | Bundler.with_original_env do 11 | @stdout, @stderr, @status = Open3.capture3("rails", "generate", "model", params[:model_name], *@fields) 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/controllers/signalman/generators/scaffolds_controller.rb: -------------------------------------------------------------------------------- 1 | require "open3" 2 | 3 | module Signalman 4 | class Generators::ScaffoldsController < ApplicationController 5 | def show 6 | end 7 | 8 | def create 9 | @fields = params[:fields].map { |field| [field[:name], field[:type]].join(":") } 10 | Bundler.with_original_env do 11 | @stdout, @stderr, @status = Open3.capture3("rails", "generate", "scaffold", params[:model_name], *@fields) 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/controllers/signalman/jobs_controller.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | class JobsController < ApplicationController 3 | def index 4 | @events = Event.jobs.recent_first 5 | end 6 | 7 | def show 8 | @event = Event.jobs.find(params[:id]) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/controllers/signalman/mails_controller.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | class MailsController < ApplicationController 3 | def index 4 | @events = Event.mails.recent_first 5 | end 6 | 7 | def show 8 | @event = Event.mails.find(params[:id]) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/controllers/signalman/queries_controller.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | class QueriesController < ApplicationController 3 | def index 4 | @events = Event.queries.recent_first 5 | end 6 | 7 | def show 8 | @event = Event.queries.find(params[:id]) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/controllers/signalman/requests_controller.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | class RequestsController < ApplicationController 3 | def index 4 | @events = Event.requests.recent_first 5 | end 6 | 7 | def show 8 | @event = Event.requests.find(params[:id]) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/controllers/signalman/views_controller.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | class ViewsController < ApplicationController 3 | def index 4 | @events = Event.views.recent_first 5 | end 6 | 7 | def show 8 | @event = Event.views.find(params[:id]) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/helpers/.keep -------------------------------------------------------------------------------- /app/helpers/signalman/events_helper.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | module EventsHelper 3 | def signalman_path_for(event) 4 | block = Signalman.events.find { |key, _| key.match? event.name }.last[:path] 5 | instance_exec event, &block 6 | end 7 | 8 | def badge_for_request_duration(duration, &block) 9 | if duration <= 200 10 | tag.span "#{duration.round}ms", class: "bg-gray-100 text-gray-800 px-2 py-1 rounded text-xs" 11 | elsif duration <= 500 12 | tag.span "#{duration.round}ms", class: "bg-yellow-100 text-yellow-800 px-2 py-1 rounded text-xs" 13 | else 14 | tag.span "#{duration.round}ms", class: "bg-red-100 text-red-800 rounded px-2 py-1 text-xs" 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/jobs/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/jobs/.keep -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/mailers/.keep -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/models/.keep -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/signalman.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | def self.table_name_prefix 3 | "signalman_" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/signalman/event.rb: -------------------------------------------------------------------------------- 1 | class Signalman::Event < ApplicationRecord 2 | validates :name, presence: true 3 | 4 | scope :requests, -> { where(name: "process_action.action_controller") } 5 | scope :mails, -> { where(name: "deliver.action_mailer") } 6 | scope :queries, -> { where(name: "sql.active_record") } 7 | scope :views, -> { 8 | where(name: [ 9 | "render_template.action_view", 10 | "render_partial.action_view", 11 | "render_collection.action_view", 12 | "render_layout.action_view" 13 | ]) 14 | } 15 | scope :jobs, -> { 16 | where(name: [ 17 | "enqueue_at.active_job", 18 | "enqueue.active_job", 19 | "perform.active_job", 20 | "perform_start.active_job", 21 | "discard.active_job" 22 | ]) 23 | } 24 | 25 | scope :recent_first, -> { order(created_at: :desc) } 26 | end 27 | -------------------------------------------------------------------------------- /app/views/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/app/views/.keep -------------------------------------------------------------------------------- /app/views/layouts/signalman/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |2 | $ rails generate model <%= params[:model_name] %> <%= @fields.join(" ") %> 3 | <%= simple_format @stdout %> 4 | <%= simple_format @stderr %> 5 |6 | -------------------------------------------------------------------------------- /app/views/signalman/generators/models/show.html.erb: -------------------------------------------------------------------------------- 1 |
Visit <%= link_to "/#{params[:model_name].underscore.pluralize}", "/#{params[:model_name].underscore.pluralize}", target: :_blank %>
3 | <% end %> 4 | 5 |6 | $ rails generate scaffold <%= params[:model_name] %> <%= @fields.join(" ") %> 7 | <%= simple_format @stdout %> 8 | <%= simple_format @stderr %> 9 |10 | -------------------------------------------------------------------------------- /app/views/signalman/generators/scaffolds/show.html.erb: -------------------------------------------------------------------------------- 1 |
<%= @event.payload["id"] %>6 | 7 |
<%= @event.payload["queue_name"] %>9 | 10 |
<%= @event.payload["enqueued_at"] %>12 | 13 |
<%= @event.payload["scheduled_at"] || "nil" %>15 | 16 |
<%= @event.payload["args"] %>18 | -------------------------------------------------------------------------------- /app/views/signalman/mails/index.html.erb: -------------------------------------------------------------------------------- 1 |
<%= @event.payload["message_id"] %>6 | 7 |
<%= @event.payload["subject"] %>9 | 10 |
<%= @event.payload["to"] %>12 | 13 |
<%= @event.payload["from"] %>15 | 16 |
<%= @event.payload["mail"] %>18 | -------------------------------------------------------------------------------- /app/views/signalman/queries/index.html.erb: -------------------------------------------------------------------------------- 1 |
<%= @event.payload["sql"] %>6 | 7 |
<%= @event.payload["binds"] %>9 | 10 |
<%= @event.payload["type_casted_binds"] %>12 | 13 |
<%= @event.payload["statement_name"] %>15 | 16 |
<%= @event.payload["async"] %>18 | -------------------------------------------------------------------------------- /app/views/signalman/requests/index.html.erb: -------------------------------------------------------------------------------- 1 |
<%= @event.payload["controller"] %>#<%= @event.payload["action"] %>6 |
Completed in <%= @event.duration.round %>ms (Views: <%= @event.payload["view_runtime"].round %>ms | ActiveRecord: <%= @event.payload["db_runtime"].round %>ms)
7 | 8 |<%= @event.payload["status"] %> <%= Rack::Utils::HTTP_STATUS_CODES[@event.payload["status"]] %>10 | 11 |
<%= @event.payload["params"] %>13 | 14 |
16 | <% @event.payload["headers"].sort.each do |key, value| %> 17 | <%= key %>: <%= value %> 18 | <% end %> 19 |20 | -------------------------------------------------------------------------------- /app/views/signalman/shared/_flash.html.erb: -------------------------------------------------------------------------------- 1 | <% if notice %> 2 |
<%= notice %>
3 | <% end %> 4 | 5 | <% if alert %> 6 |<%= alert %>
7 | <% end %> 8 | -------------------------------------------------------------------------------- /app/views/signalman/shared/_nav.html.erb: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /app/views/signalman/views/index.html.erb: -------------------------------------------------------------------------------- 1 |<%= @event.payload["identifier"] %>6 | 7 | <% if @event.payload.has_key?("layout") %> 8 |
<%= @event.payload["layout"] %>10 | <% end %> 11 | 12 | <% if @event.payload.has_key?("count") %> 13 |
<%= @event.payload["count"] %>15 | <% end %> 16 | 17 | <% if @event.payload.has_key?("cache_hits") %> 18 |
<%= @event.payload["cache_hits"] %>20 | <% end %> 21 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails gems 3 | # installed from the root of your application. 4 | 5 | ENGINE_ROOT = File.expand_path("..", __dir__) 6 | ENGINE_PATH = File.expand_path("../lib/signalman/engine", __dir__) 7 | APP_PATH = File.expand_path("../test/dummy/config/application", __dir__) 8 | 9 | # Set up gems listed in the Gemfile. 10 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 11 | require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) 12 | 13 | require "rails/all" 14 | require "rails/engine/commands" 15 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Signalman::Engine.routes.draw do 2 | resources :requests 3 | resources :jobs 4 | resources :cache 5 | resources :exceptions 6 | resources :mails 7 | resources :queries 8 | resources :views 9 | 10 | namespace :generators do 11 | resource :scaffold 12 | resource :model 13 | end 14 | 15 | root "requests#index" 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20230729122215_create_signalman_events.rb: -------------------------------------------------------------------------------- 1 | class CreateSignalmanEvents < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :signalman_events do |t| 4 | t.string :name 5 | t.datetime :started_at 6 | t.datetime :finished_at 7 | t.float :duration 8 | t.json :payload 9 | 10 | t.timestamps 11 | end 12 | 13 | add_index :signalman_events, [:name, :duration] 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/signalman.rb: -------------------------------------------------------------------------------- 1 | require "signalman/version" 2 | require "signalman/engine" 3 | 4 | require "signalman/action_handler" 5 | require "signalman/job_handler" 6 | require "signalman/mail_handler" 7 | require "signalman/query_handler" 8 | require "signalman/view_handler" 9 | 10 | module Signalman 11 | cattr_accessor :events, default: { 12 | "process_action.action_controller" => { 13 | handler: ActionHandler, 14 | path: ->(event) { request_path(event) } 15 | }, 16 | /^\w+\.action_view/ => { 17 | handler: ViewHandler, 18 | path: ->(event) { view_path(event) } 19 | }, 20 | "sql.active_record" => { 21 | handler: QueryHandler, 22 | path: ->(event) { query_path(event) } 23 | }, 24 | "deliver.action_mailer" => { 25 | handler: MailHandler, 26 | path: ->(event) { mail_path(event) } 27 | }, 28 | /^\w+\.active_job/ => { 29 | handler: JobHandler, 30 | path: ->(event) { job_path(event) } 31 | } 32 | } 33 | 34 | def self.register_watchers 35 | events.each do |event_name, options| 36 | options[:subscriber] = add_watcher event_name, options[:handler] 37 | end 38 | end 39 | 40 | def self.add_watcher(event_name, handler) 41 | ActiveSupport::Notifications.subscribe event_name, handler 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /lib/signalman/action_handler.rb: -------------------------------------------------------------------------------- 1 | require "signalman/base_handler" 2 | 3 | module Signalman 4 | class ActionHandler < BaseHandler 5 | def process 6 | headers = {} 7 | event.payload.fetch(:headers, {}).each do |name, value| 8 | headers[name] = value if name.start_with?("HTTP") 9 | headers[name] = value if ActionDispatch::Http::Headers::CGI_VARIABLES.include?(name) 10 | 11 | [ 12 | "action_dispatch.request_id" 13 | ].each do |header_name| 14 | headers[name] = value if name == header_name 15 | end 16 | end 17 | 18 | create_event event.payload.slice( 19 | :method, 20 | :path, 21 | :controller, 22 | :action, 23 | :params, 24 | :format, 25 | :status, 26 | :db_runtime, 27 | :view_runtime 28 | ).merge(headers: headers) 29 | end 30 | 31 | def skip? 32 | event.payload[:controller].start_with?("Signalman::") 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/signalman/base_handler.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | class BaseHandler 3 | attr_reader :current_time, :event 4 | 5 | def self.call(event) 6 | current_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond) 7 | new(event, current_time).start 8 | end 9 | 10 | def initialize(event, current_time) 11 | @event, @current_time = event, current_time 12 | end 13 | 14 | def start 15 | process unless skip? 16 | end 17 | 18 | def process 19 | create_event 20 | end 21 | 22 | def skip? 23 | false 24 | end 25 | 26 | def create_event(payload = nil) 27 | payload ||= event.payload 28 | 29 | Event.create( 30 | name: event.name, 31 | started_at: started_at, 32 | finished_at: finished_at, 33 | duration: event.duration, 34 | payload: payload 35 | ) 36 | rescue ActiveRecord::StatementInvalid => e 37 | Rails.logger.error "[Signalman] #{e.message}" 38 | end 39 | 40 | # Time measure since system boot with 41 | # Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond) 42 | def started_at 43 | Time.current - ((current_time - event.time) / 1_000) 44 | end 45 | 46 | def finished_at 47 | Time.current - ((current_time - event.end) / 1_000) 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /lib/signalman/engine.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | class Engine < ::Rails::Engine 3 | isolate_namespace Signalman 4 | 5 | initializer "signalman.register_watchers" do 6 | Signalman.register_watchers 7 | end 8 | 9 | # helpers must be accessible anywhere for Turbo broadcasts 10 | initializer "signalman.helpers" do 11 | ActiveSupport.on_load :action_controller do 12 | helper Signalman::EventsHelper 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/signalman/job_handler.rb: -------------------------------------------------------------------------------- 1 | require "signalman/base_handler" 2 | 3 | module Signalman 4 | class JobHandler < BaseHandler 5 | def process 6 | job = event.payload[:job] 7 | create_event( 8 | class: job.class.name, 9 | id: job.job_id, 10 | enqueued_at: job.enqueued_at, 11 | scheduled_at: scheduled_at(event), 12 | queue_name: queue_name(event), 13 | args: args_info(job) 14 | ) 15 | end 16 | 17 | # From ActiveJob::LogSubscriber 18 | def queue_name(event) 19 | # Rails 7.1 -> ActiveJob.adapter_name(event.payload[:adapter]) + "(#{event.payload[:job].queue_name})" 20 | event.payload[:adapter].class.name.demodulize.remove("Adapter") + "(#{event.payload[:job].queue_name})" 21 | end 22 | 23 | def args_info(job) 24 | if job.class.log_arguments? && job.arguments.any? 25 | " with arguments: " + 26 | job.arguments.map { |arg| format(arg).inspect }.join(", ") 27 | else 28 | "" 29 | end 30 | end 31 | 32 | def format(arg) 33 | case arg 34 | when Hash 35 | arg.transform_values { |value| format(value) } 36 | when Array 37 | arg.map { |value| format(value) } 38 | when GlobalID::Identification 39 | begin 40 | arg.to_global_id 41 | rescue 42 | arg 43 | end 44 | else 45 | arg 46 | end 47 | end 48 | 49 | def scheduled_at(event) 50 | return unless event.payload[:job].scheduled_at 51 | Time.at(event.payload[:job].scheduled_at).utc 52 | end 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /lib/signalman/mail_handler.rb: -------------------------------------------------------------------------------- 1 | require "signalman/base_handler" 2 | 3 | module Signalman 4 | class MailHandler < BaseHandler 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/signalman/query_handler.rb: -------------------------------------------------------------------------------- 1 | require "signalman/base_handler" 2 | 3 | module Signalman 4 | class QueryHandler < BaseHandler 5 | IGNORED_QUERIES = [ 6 | "SCHEMA", 7 | "TRANSACTION", 8 | "ActiveRecord::SchemaMigration", 9 | "ActiveRecord::InternalMetadata", 10 | /^Signalman/ 11 | ] 12 | 13 | # CREATE_TABLE queries have nil for `name` 14 | def skip? 15 | return if event.payload[:name].blank? 16 | IGNORED_QUERIES.any? { |q| q.match? event.payload[:name] } 17 | end 18 | 19 | def process 20 | create_event event.payload.except(:connection) 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/signalman/version.rb: -------------------------------------------------------------------------------- 1 | module Signalman 2 | VERSION = "0.1.2" 3 | end 4 | -------------------------------------------------------------------------------- /lib/signalman/view_handler.rb: -------------------------------------------------------------------------------- 1 | require "signalman/base_handler" 2 | 3 | module Signalman 4 | class ViewHandler < BaseHandler 5 | def skip? 6 | event.payload[:identifier].include?("app/views/signalman/") 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/tasks/signalman_tasks.rake: -------------------------------------------------------------------------------- 1 | # desc "Explaining what the task does" 2 | # task :signalman do 3 | # # Task goes here 4 | # end 5 | -------------------------------------------------------------------------------- /signalman.gemspec: -------------------------------------------------------------------------------- 1 | require_relative "lib/signalman/version" 2 | 3 | Gem::Specification.new do |spec| 4 | spec.name = "signalman" 5 | spec.version = Signalman::VERSION 6 | spec.authors = ["Chris Oliver"] 7 | spec.email = ["excid3@gmail.com"] 8 | spec.homepage = "https://github.com/excid3/signalman" 9 | spec.summary = "Development tools for Ruby on Rails" 10 | spec.description = "Development tools for Ruby on Rails" 11 | spec.license = "MIT" 12 | 13 | spec.metadata["homepage_uri"] = spec.homepage 14 | spec.metadata["source_code_uri"] = "https://github.com/excid3/signalman" 15 | spec.metadata["changelog_uri"] = "https://github.com/excid3/signalman/blob/main/CHANGELOG.md" 16 | 17 | spec.files = Dir.chdir(File.expand_path(__dir__)) do 18 | Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] 19 | end 20 | 21 | spec.add_dependency "rails", ">= 7.0.0" 22 | end 23 | -------------------------------------------------------------------------------- /test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :headless_chrome 5 | end 6 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/test/controllers/.keep -------------------------------------------------------------------------------- /test/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /test/dummy/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | //= link_tree ../../javascript .js 4 | //= link_tree ../../../vendor/javascript .js 5 | -------------------------------------------------------------------------------- /test/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/test/dummy/app/assets/images/.keep -------------------------------------------------------------------------------- /test/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 10 | * files in this directory. Styles in this file should be added after the last require_* statement. 11 | * It is generally better to create a new file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /test/dummy/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /test/dummy/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /test/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | def current_user 3 | @current_user ||= User.where(name: "Bob", email: "bob@example.org").first_or_create 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /test/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/test/dummy/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /test/dummy/app/controllers/main_controller.rb: -------------------------------------------------------------------------------- 1 | class MainController < ApplicationController 2 | before_action :current_user 3 | 4 | def index 5 | end 6 | 7 | def send_mail 8 | UserMailer.notification.deliver 9 | head :ok 10 | end 11 | 12 | def enqueue_mail 13 | UserMailer.notification.deliver_later 14 | head :ok 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /test/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /test/dummy/app/javascript/application.js: -------------------------------------------------------------------------------- 1 | // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails 2 | import "@hotwired/turbo-rails" 3 | -------------------------------------------------------------------------------- /test/dummy/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /test/dummy/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: "from@example.com" 3 | layout "mailer" 4 | end 5 | -------------------------------------------------------------------------------- /test/dummy/app/mailers/user_mailer.rb: -------------------------------------------------------------------------------- 1 | class UserMailer < ApplicationMailer 2 | # Subject can be set in your I18n file at config/locales/en.yml 3 | # with the following lookup: 4 | # 5 | # en.user_mailer.notification.subject 6 | # 7 | def notification 8 | @greeting = "Hi" 9 | 10 | mail to: "to@example.org" 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/dummy/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | primary_abstract_class 3 | end 4 | -------------------------------------------------------------------------------- /test/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/test/dummy/app/models/concerns/.keep -------------------------------------------------------------------------------- /test/dummy/app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ApplicationRecord 2 | end 3 | -------------------------------------------------------------------------------- /test/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
4 | <%= @greeting %>, find me in app/views/user_mailer/notification.html.erb 5 |
6 | -------------------------------------------------------------------------------- /test/dummy/app/views/user_mailer/notification.text.erb: -------------------------------------------------------------------------------- 1 | User#notification 2 | 3 | <%= @greeting %>, find me in app/views/user_mailer/notification.text.erb 4 | -------------------------------------------------------------------------------- /test/dummy/bin/importmap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require_relative "../config/application" 4 | require "importmap/commands" 5 | -------------------------------------------------------------------------------- /test/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /test/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /test/dummy/bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path("..", __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts "== Installing dependencies ==" 17 | system! "gem install bundler --conservative" 18 | system("bundle check") || system!("bundle install") 19 | 20 | # puts "\n== Copying sample files ==" 21 | # unless File.exist?("config/database.yml") 22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml" 23 | # end 24 | 25 | puts "\n== Preparing database ==" 26 | system! "bin/rails db:prepare" 27 | 28 | puts "\n== Removing old logs and tempfiles ==" 29 | system! "bin/rails log:clear tmp:clear" 30 | 31 | puts "\n== Restarting application server ==" 32 | system! "bin/rails restart" 33 | end 34 | -------------------------------------------------------------------------------- /test/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /test/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | require "signalman" 9 | 10 | module Dummy 11 | class Application < Rails::Application 12 | config.load_defaults Rails::VERSION::STRING.to_f 13 | 14 | # For compatibility with applications that use this config 15 | config.action_controller.include_all_helpers = false 16 | 17 | # Configuration for the application, engines, and railties goes here. 18 | # 19 | # These settings can be overridden in specific environments using the files 20 | # in config/environments, which are processed later. 21 | # 22 | # config.time_zone = "Central Time (US & Canada)" 23 | # config.eager_load_paths << Rails.root.join("extras") 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /test/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__) 3 | 4 | require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) 5 | $LOAD_PATH.unshift File.expand_path("../../../lib", __dir__) 6 | -------------------------------------------------------------------------------- /test/dummy/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: redis 3 | url: redis://localhost:6379/1 4 | 5 | test: 6 | adapter: test 7 | 8 | production: 9 | adapter: redis 10 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 11 | channel_prefix: dummy_production 12 | -------------------------------------------------------------------------------- /test/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite. Versions 3.8.0 and up are supported. 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem "sqlite3" 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /test/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /test/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # In the development environment your application's code is reloaded any time 7 | # it changes. This slows down response time but is perfect for development 8 | # since you don't have to restart the web server when you make code changes. 9 | config.cache_classes = false 10 | 11 | # Do not eager load code on boot. 12 | config.eager_load = false 13 | 14 | # Show full error reports. 15 | config.consider_all_requests_local = true 16 | 17 | # Enable server timing 18 | config.server_timing = true 19 | 20 | # Enable/disable caching. By default caching is disabled. 21 | # Run rails dev:cache to toggle caching. 22 | if Rails.root.join("tmp/caching-dev.txt").exist? 23 | config.action_controller.perform_caching = true 24 | config.action_controller.enable_fragment_cache_logging = true 25 | 26 | config.cache_store = :memory_store 27 | config.public_file_server.headers = { 28 | "Cache-Control" => "public, max-age=#{2.days.to_i}" 29 | } 30 | else 31 | config.action_controller.perform_caching = false 32 | 33 | config.cache_store = :null_store 34 | end 35 | 36 | # Store uploaded files on the local file system (see config/storage.yml for options). 37 | config.active_storage.service = :local 38 | 39 | # Don't care if the mailer can't send. 40 | config.action_mailer.raise_delivery_errors = false 41 | 42 | config.action_mailer.perform_caching = false 43 | 44 | # Print deprecation notices to the Rails logger. 45 | config.active_support.deprecation = :log 46 | 47 | # Raise exceptions for disallowed deprecations. 48 | config.active_support.disallowed_deprecation = :raise 49 | 50 | # Tell Active Support which deprecation messages to disallow. 51 | config.active_support.disallowed_deprecation_warnings = [] 52 | 53 | # Raise an error on page load if there are pending migrations. 54 | config.active_record.migration_error = :page_load 55 | 56 | # Highlight code that triggered database queries in logs. 57 | config.active_record.verbose_query_logs = true 58 | 59 | # Suppress logger output for asset requests. 60 | config.assets.quiet = true 61 | 62 | # Raises error for missing translations. 63 | # config.i18n.raise_on_missing_translations = true 64 | 65 | # Annotate rendered view with file names. 66 | # config.action_view.annotate_rendered_view_with_filenames = true 67 | 68 | # Uncomment if you wish to allow Action Cable access from any origin. 69 | # config.action_cable.disable_request_forgery_protection = true 70 | end 71 | -------------------------------------------------------------------------------- /test/dummy/config/environments/production.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # Code is not reloaded between requests. 7 | config.cache_classes = true 8 | 9 | # Eager load code on boot. This eager loads most of Rails and 10 | # your application in memory, allowing both threaded web servers 11 | # and those relying on copy on write to perform better. 12 | # Rake tasks automatically ignore this option for performance. 13 | config.eager_load = true 14 | 15 | # Full error reports are disabled and caching is turned on. 16 | config.consider_all_requests_local = false 17 | config.action_controller.perform_caching = true 18 | 19 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 20 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 21 | # config.require_master_key = true 22 | 23 | # Disable serving static files from the `/public` folder by default since 24 | # Apache or NGINX already handles this. 25 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? 26 | 27 | # Compress CSS using a preprocessor. 28 | # config.assets.css_compressor = :sass 29 | 30 | # Do not fallback to assets pipeline if a precompiled asset is missed. 31 | config.assets.compile = false 32 | 33 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 34 | # config.asset_host = "http://assets.example.com" 35 | 36 | # Specifies the header that your server uses for sending files. 37 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache 38 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX 39 | 40 | # Store uploaded files on the local file system (see config/storage.yml for options). 41 | config.active_storage.service = :local 42 | 43 | # Mount Action Cable outside main process or domain. 44 | # config.action_cable.mount_path = nil 45 | # config.action_cable.url = "wss://example.com/cable" 46 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] 47 | 48 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 49 | # config.force_ssl = true 50 | 51 | # Include generic and useful information about system operation, but avoid logging too much 52 | # information to avoid inadvertent exposure of personally identifiable information (PII). 53 | config.log_level = :info 54 | 55 | # Prepend all log lines with the following tags. 56 | config.log_tags = [:request_id] 57 | 58 | # Use a different cache store in production. 59 | # config.cache_store = :mem_cache_store 60 | 61 | # Use a real queuing backend for Active Job (and separate queues per environment). 62 | # config.active_job.queue_adapter = :resque 63 | # config.active_job.queue_name_prefix = "dummy_production" 64 | 65 | config.action_mailer.perform_caching = false 66 | 67 | # Ignore bad email addresses and do not raise email delivery errors. 68 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 69 | # config.action_mailer.raise_delivery_errors = false 70 | 71 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 72 | # the I18n.default_locale when a translation cannot be found). 73 | config.i18n.fallbacks = true 74 | 75 | # Don't log any deprecations. 76 | config.active_support.report_deprecations = false 77 | 78 | # Use default logging formatter so that PID and timestamp are not suppressed. 79 | config.log_formatter = ::Logger::Formatter.new 80 | 81 | # Use a different logger for distributed setups. 82 | # require "syslog/logger" 83 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") 84 | 85 | if ENV["RAILS_LOG_TO_STDOUT"].present? 86 | logger = ActiveSupport::Logger.new($stdout) 87 | logger.formatter = config.log_formatter 88 | config.logger = ActiveSupport::TaggedLogging.new(logger) 89 | end 90 | 91 | # Do not dump schema after migrations. 92 | config.active_record.dump_schema_after_migration = false 93 | end 94 | -------------------------------------------------------------------------------- /test/dummy/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | # The test environment is used exclusively to run your application's 4 | # test suite. You never need to work with it otherwise. Remember that 5 | # your test database is "scratch space" for the test suite and is wiped 6 | # and recreated between test runs. Don't rely on the data there! 7 | 8 | Rails.application.configure do 9 | # Settings specified here will take precedence over those in config/application.rb. 10 | 11 | # Turn false under Spring and add config.action_view.cache_template_loading = true. 12 | config.cache_classes = true 13 | 14 | # Eager loading loads your whole application. When running a single test locally, 15 | # this probably isn't necessary. It's a good idea to do in a continuous integration 16 | # system, or in some way before deploying your code. 17 | config.eager_load = ENV["CI"].present? 18 | 19 | # Configure public file server for tests with Cache-Control for performance. 20 | config.public_file_server.enabled = true 21 | config.public_file_server.headers = { 22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}" 23 | } 24 | 25 | # Show full error reports and disable caching. 26 | config.consider_all_requests_local = true 27 | config.action_controller.perform_caching = false 28 | config.cache_store = :null_store 29 | 30 | # Raise exceptions instead of rendering exception templates. 31 | config.action_dispatch.show_exceptions = false 32 | 33 | # Disable request forgery protection in test environment. 34 | config.action_controller.allow_forgery_protection = false 35 | 36 | # Store uploaded files on the local file system in a temporary directory. 37 | config.active_storage.service = :test 38 | 39 | config.action_mailer.perform_caching = false 40 | 41 | # Tell Action Mailer not to deliver emails to the real world. 42 | # The :test delivery method accumulates sent emails in the 43 | # ActionMailer::Base.deliveries array. 44 | config.action_mailer.delivery_method = :test 45 | 46 | # Print deprecation notices to the stderr. 47 | config.active_support.deprecation = :stderr 48 | 49 | # Raise exceptions for disallowed deprecations. 50 | config.active_support.disallowed_deprecation = :raise 51 | 52 | # Tell Active Support which deprecation messages to disallow. 53 | config.active_support.disallowed_deprecation_warnings = [] 54 | 55 | # Raises error for missing translations. 56 | # config.i18n.raise_on_missing_translations = true 57 | 58 | # Annotate rendered view with file names. 59 | # config.action_view.annotate_rendered_view_with_filenames = true 60 | end 61 | -------------------------------------------------------------------------------- /test/dummy/config/importmap.rb: -------------------------------------------------------------------------------- 1 | # Pin npm packages by running ./bin/importmap 2 | 3 | pin "application", preload: true 4 | pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true 5 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = "1.0" 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in the app/assets 11 | # folder are already added. 12 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 13 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide content security policy. 4 | # See the Securing Rails Applications Guide for more information: 5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header 6 | 7 | # Rails.application.configure do 8 | # config.content_security_policy do |policy| 9 | # policy.default_src :self, :https 10 | # policy.font_src :self, :https, :data 11 | # policy.img_src :self, :https, :data 12 | # policy.object_src :none 13 | # policy.script_src :self, :https 14 | # policy.style_src :self, :https 15 | # # Specify URI for violation reports 16 | # # policy.report_uri "/csp-violation-report-endpoint" 17 | # end 18 | # 19 | # # Generate session nonces for permitted importmap and inline scripts 20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } 21 | # config.content_security_policy_nonce_directives = %w(script-src) 22 | # 23 | # # Report violations without enforcing the policy. 24 | # # config.content_security_policy_report_only = true 25 | # end 26 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of 4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported 5 | # notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 8 | ] 9 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, "\\1en" 8 | # inflect.singular /^(ox)en/i, "\\1" 9 | # inflect.irregular "person", "people" 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym "RESTful" 16 | # end 17 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /test/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t "hello" 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t("hello") %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # "true": "foo" 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /test/dummy/config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers: a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum; this matches the default thread size of Active Record. 6 | # 7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } 8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } 9 | threads min_threads_count, max_threads_count 10 | 11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before 12 | # terminating a worker in development environments. 13 | # 14 | worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" 15 | 16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 17 | # 18 | port ENV.fetch("PORT") { 3000 } 19 | 20 | # Specifies the `environment` that Puma will run in. 21 | # 22 | environment ENV.fetch("RAILS_ENV") { "development" } 23 | 24 | # Specifies the `pidfile` that Puma will use. 25 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } 26 | 27 | # Specifies the number of `workers` to boot in clustered mode. 28 | # Workers are forked web server processes. If using threads and workers together 29 | # the concurrency of the application would be max `threads` * `workers`. 30 | # Workers do not work on JRuby or Windows (both of which do not support 31 | # processes). 32 | # 33 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 34 | 35 | # Use the `preload_app!` method when specifying a `workers` number. 36 | # This directive tells Puma to first boot the application and load code 37 | # before forking the application. This takes advantage of Copy On Write 38 | # process behavior so workers use less memory. 39 | # 40 | # preload_app! 41 | 42 | # Allow puma to be restarted by `bin/rails restart` command. 43 | plugin :tmp_restart 44 | -------------------------------------------------------------------------------- /test/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html 3 | 4 | mount Signalman::Engine => "signalman" 5 | 6 | scope controller: :main do 7 | get :send_mail 8 | get :enqueue_mail 9 | end 10 | 11 | root "main#index" 12 | end 13 | -------------------------------------------------------------------------------- /test/dummy/config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket-<%= Rails.env %> 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket-<%= Rails.env %> 23 | 24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name-<%= Rails.env %> 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /test/dummy/db/migrate/20230730020301_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration[7.0] 2 | def change 3 | create_table :users do |t| 4 | t.string :name 5 | t.string :email 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /test/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema[7.0].define(version: 2023_07_30_020301) do 14 | create_table "signalman_events", force: :cascade do |t| 15 | t.string "name", null: false 16 | t.datetime "started_at" 17 | t.datetime "finished_at" 18 | t.float "duration" 19 | t.json "payload" 20 | t.datetime "created_at", null: false 21 | t.datetime "updated_at", null: false 22 | end 23 | 24 | create_table "users", force: :cascade do |t| 25 | t.string "name" 26 | t.string "email" 27 | t.datetime "created_at", null: false 28 | t.datetime "updated_at", null: false 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /test/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excid3/signalman/75277440f3aa99931ddef94f567e428922a13e9f/test/dummy/lib/assets/.keep -------------------------------------------------------------------------------- /test/dummy/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |You may have mistyped the address or the page may have moved.
63 |If you are the application owner check the logs for more information.
65 |Maybe you tried to change something you didn't have access to.
63 |If you are the application owner check the logs for more information.
65 |If you are the application owner check the logs for more information.
64 |