├── .dockerignore ├── .envkey ├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ └── deploy.yml ├── .ruby-version ├── Gemfile ├── Gemfile.lock ├── LICENSE.txt ├── Procfile.dev ├── README.md ├── Rakefile ├── app ├── assets │ ├── images │ │ ├── favicon.ico │ │ ├── favicons │ │ │ ├── github.png │ │ │ ├── rubygems.png │ │ │ └── website.png │ │ ├── icon.png │ │ ├── logo.png │ │ └── logo.svg │ └── stylesheets │ │ ├── application.scss │ │ └── partials │ │ └── _basics.scss ├── controllers │ └── application_controller.rb ├── helpers │ └── application_helper.rb ├── javascript │ └── application.js ├── mailers │ └── application_mailer.rb ├── models │ └── application_record.rb ├── services │ └── report_error.rb └── views │ ├── home.html.haml │ ├── layouts │ ├── application.html.haml │ └── mailer.text.erb │ └── shared │ └── _header.html.haml ├── bin ├── build ├── bundle ├── deploy ├── dev ├── importmap ├── prod-console ├── rails ├── rake └── setup ├── config.ru ├── config ├── application.rb ├── boot.rb ├── credentials.yml.enc ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── importmap.rb ├── initializers │ ├── assets.rb │ ├── content_security_policy.rb │ ├── filter_parameter_logging.rb │ ├── friendly_id.rb │ ├── inflections.rb │ ├── permissions_policy.rb │ ├── postmark.rb │ └── sentry.rb ├── locales │ └── en.yml ├── puma.rb ├── redis │ └── shared.yml ├── routes.rb ├── sitemap.rb └── storage.yml ├── public ├── 404.html ├── 422.html ├── 500.html └── robots.txt └── stuff.rb /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | tmp 3 | !tmp/pids 4 | log 5 | public/assets 6 | public/packs 7 | .bundle 8 | 9 | db/*.sqlite3 10 | db/*.sqlite3-* 11 | 12 | storage 13 | config/master.key 14 | config/credentials/*.key 15 | 16 | node_modules 17 | -------------------------------------------------------------------------------- /.envkey: -------------------------------------------------------------------------------- 1 | {"appId":"dc79d60e-4907-47c6-b2e5-06bc34f60e38","orgId":"64f5bc8e-8013-40df-92d2-6befb315d3ec"} -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: manuelmeurer 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | concurrency: deploy 3 | 4 | on: 5 | workflow_dispatch: 6 | push: 7 | branches: 8 | - deploy 9 | 10 | jobs: 11 | 12 | deploy: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: hatchboxio/github-hatchbox-deploy-action@v2 17 | with: 18 | deploy_key: ${{ secrets.HATCHBOX_DEPLOY_KEY }} 19 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.3.4 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | ruby file: ".ruby-version" 4 | 5 | gem "activerecord-enhancedsqlite3-adapter", "~> 0.5" 6 | gem "amazing_print", "~> 1.5" 7 | gem "aws-sdk-s3", "~> 1.8", require: false 8 | gem "baseline", github: "manuelmeurer/baseline" 9 | gem "bootsnap", "~> 1.17", require: false 10 | gem "bootstrap", "~> 5.3" 11 | gem "dartsass-rails", "~> 0.5" 12 | gem "friendly_id", "~> 5.5" 13 | gem "haml", "~> 6.0" 14 | gem "importmap-rails", "~> 2.0" 15 | gem "kredis", "~> 1.2" 16 | gem "octopoller", "~> 0.3" 17 | gem "postmark-rails", "~> 0.22" 18 | gem "propshaft", "~> 0.8" 19 | gem "pry-rails", "~> 0.3" 20 | gem "puma", "~> 6.4" 21 | gem "rails_bootstrap_navbar", "~> 3.0" 22 | gem "rails-i18n", "~> 7.0" 23 | gem "rails", "~> 7.1.2" 24 | gem "redis-namespace", "~> 1.11" 25 | gem "redis", "~> 5.0" 26 | gem "sdoc", github: "rails/sdoc" # TODO: use released version when 3.x is released 27 | gem "sentry-rails", "~> 5.5" 28 | gem "sitemap_generator", "~> 6.3" 29 | gem "sqlite3", "~> 2.0" 30 | gem "stimulus-rails", "~> 1.3" 31 | gem "turbo-rails", "~> 2.0" 32 | 33 | group :development do 34 | gem "annotaterb", "~> 4.4", require: false 35 | gem "better_errors", "~> 2.8" 36 | gem "binding_of_caller", "~> 1.0" 37 | end 38 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: https://github.com/manuelmeurer/baseline.git 3 | revision: 89ae0e0e9336ce82b35992f24288979f5bec4d3b 4 | specs: 5 | baseline (1.0) 6 | 7 | GIT 8 | remote: https://github.com/rails/sdoc.git 9 | revision: 242686d0a55cd1f7c1c8b9e96ec85518c5e169a1 10 | specs: 11 | sdoc (3.0.0.alpha) 12 | nokogiri 13 | rdoc (>= 5.0) 14 | rouge 15 | 16 | GEM 17 | remote: https://rubygems.org/ 18 | specs: 19 | actioncable (7.1.4) 20 | actionpack (= 7.1.4) 21 | activesupport (= 7.1.4) 22 | nio4r (~> 2.0) 23 | websocket-driver (>= 0.6.1) 24 | zeitwerk (~> 2.6) 25 | actionmailbox (7.1.4) 26 | actionpack (= 7.1.4) 27 | activejob (= 7.1.4) 28 | activerecord (= 7.1.4) 29 | activestorage (= 7.1.4) 30 | activesupport (= 7.1.4) 31 | mail (>= 2.7.1) 32 | net-imap 33 | net-pop 34 | net-smtp 35 | actionmailer (7.1.4) 36 | actionpack (= 7.1.4) 37 | actionview (= 7.1.4) 38 | activejob (= 7.1.4) 39 | activesupport (= 7.1.4) 40 | mail (~> 2.5, >= 2.5.4) 41 | net-imap 42 | net-pop 43 | net-smtp 44 | rails-dom-testing (~> 2.2) 45 | actionpack (7.1.4) 46 | actionview (= 7.1.4) 47 | activesupport (= 7.1.4) 48 | nokogiri (>= 1.8.5) 49 | racc 50 | rack (>= 2.2.4) 51 | rack-session (>= 1.0.1) 52 | rack-test (>= 0.6.3) 53 | rails-dom-testing (~> 2.2) 54 | rails-html-sanitizer (~> 1.6) 55 | actiontext (7.1.4) 56 | actionpack (= 7.1.4) 57 | activerecord (= 7.1.4) 58 | activestorage (= 7.1.4) 59 | activesupport (= 7.1.4) 60 | globalid (>= 0.6.0) 61 | nokogiri (>= 1.8.5) 62 | actionview (7.1.4) 63 | activesupport (= 7.1.4) 64 | builder (~> 3.1) 65 | erubi (~> 1.11) 66 | rails-dom-testing (~> 2.2) 67 | rails-html-sanitizer (~> 1.6) 68 | activejob (7.1.4) 69 | activesupport (= 7.1.4) 70 | globalid (>= 0.3.6) 71 | activemodel (7.1.4) 72 | activesupport (= 7.1.4) 73 | activerecord (7.1.4) 74 | activemodel (= 7.1.4) 75 | activesupport (= 7.1.4) 76 | timeout (>= 0.4.0) 77 | activerecord-enhancedsqlite3-adapter (0.8.0) 78 | activerecord (>= 7.1) 79 | sqlite3 (>= 1.6) 80 | activestorage (7.1.4) 81 | actionpack (= 7.1.4) 82 | activejob (= 7.1.4) 83 | activerecord (= 7.1.4) 84 | activesupport (= 7.1.4) 85 | marcel (~> 1.0) 86 | activesupport (7.1.4) 87 | base64 88 | bigdecimal 89 | concurrent-ruby (~> 1.0, >= 1.0.2) 90 | connection_pool (>= 2.2.5) 91 | drb 92 | i18n (>= 1.6, < 2) 93 | minitest (>= 5.1) 94 | mutex_m 95 | tzinfo (~> 2.0) 96 | amazing_print (1.6.0) 97 | annotaterb (4.12.0) 98 | autoprefixer-rails (10.4.19.0) 99 | execjs (~> 2) 100 | aws-eventstream (1.3.0) 101 | aws-partitions (1.988.0) 102 | aws-sdk-core (3.209.1) 103 | aws-eventstream (~> 1, >= 1.3.0) 104 | aws-partitions (~> 1, >= 1.651.0) 105 | aws-sigv4 (~> 1.9) 106 | jmespath (~> 1, >= 1.6.1) 107 | aws-sdk-kms (1.94.0) 108 | aws-sdk-core (~> 3, >= 3.207.0) 109 | aws-sigv4 (~> 1.5) 110 | aws-sdk-s3 (1.167.0) 111 | aws-sdk-core (~> 3, >= 3.207.0) 112 | aws-sdk-kms (~> 1) 113 | aws-sigv4 (~> 1.5) 114 | aws-sigv4 (1.10.0) 115 | aws-eventstream (~> 1, >= 1.0.2) 116 | base64 (0.2.0) 117 | better_errors (2.10.1) 118 | erubi (>= 1.0.0) 119 | rack (>= 0.9.0) 120 | rouge (>= 1.0.0) 121 | bigdecimal (3.1.8) 122 | binding_of_caller (1.0.1) 123 | debug_inspector (>= 1.2.0) 124 | bootsnap (1.18.4) 125 | msgpack (~> 1.2) 126 | bootstrap (5.3.3) 127 | autoprefixer-rails (>= 9.1.0) 128 | popper_js (>= 2.11.8, < 3) 129 | bootstrap-navbar (3.2.2) 130 | gem_config (~> 0.3) 131 | builder (3.3.0) 132 | coderay (1.1.3) 133 | concurrent-ruby (1.3.4) 134 | connection_pool (2.4.1) 135 | crass (1.0.6) 136 | dartsass-rails (0.5.1) 137 | railties (>= 6.0.0) 138 | sass-embedded (~> 1.63) 139 | date (3.3.4) 140 | debug_inspector (1.2.0) 141 | drb (2.2.1) 142 | erubi (1.13.0) 143 | execjs (2.9.1) 144 | friendly_id (5.5.1) 145 | activerecord (>= 4.0.0) 146 | gem_config (0.3.2) 147 | globalid (1.2.1) 148 | activesupport (>= 6.1) 149 | google-protobuf (4.28.2-arm64-darwin) 150 | bigdecimal 151 | rake (>= 13) 152 | google-protobuf (4.28.2-x86_64-linux) 153 | bigdecimal 154 | rake (>= 13) 155 | haml (6.3.0) 156 | temple (>= 0.8.2) 157 | thor 158 | tilt 159 | i18n (1.14.6) 160 | concurrent-ruby (~> 1.0) 161 | importmap-rails (2.0.2) 162 | actionpack (>= 6.0.0) 163 | activesupport (>= 6.0.0) 164 | railties (>= 6.0.0) 165 | io-console (0.7.2) 166 | irb (1.14.1) 167 | rdoc (>= 4.0.0) 168 | reline (>= 0.4.2) 169 | jmespath (1.6.2) 170 | json (2.7.2) 171 | kredis (1.7.0) 172 | activemodel (>= 6.0.0) 173 | activesupport (>= 6.0.0) 174 | redis (>= 4.2, < 6) 175 | loofah (2.22.0) 176 | crass (~> 1.0.2) 177 | nokogiri (>= 1.12.0) 178 | mail (2.8.1) 179 | mini_mime (>= 0.1.1) 180 | net-imap 181 | net-pop 182 | net-smtp 183 | marcel (1.0.4) 184 | method_source (1.1.0) 185 | mini_mime (1.1.5) 186 | minitest (5.25.1) 187 | msgpack (1.7.3) 188 | mutex_m (0.2.0) 189 | net-imap (0.4.16) 190 | date 191 | net-protocol 192 | net-pop (0.1.2) 193 | net-protocol 194 | net-protocol (0.2.2) 195 | timeout 196 | net-smtp (0.5.0) 197 | net-protocol 198 | nio4r (2.7.3) 199 | nokogiri (1.16.7-arm64-darwin) 200 | racc (~> 1.4) 201 | nokogiri (1.16.7-x86_64-linux) 202 | racc (~> 1.4) 203 | octopoller (0.3.1) 204 | popper_js (2.11.8) 205 | postmark (1.25.1) 206 | json 207 | postmark-rails (0.22.1) 208 | actionmailer (>= 3.0.0) 209 | postmark (>= 1.21.3, < 2.0) 210 | propshaft (0.9.1) 211 | actionpack (>= 7.0.0) 212 | activesupport (>= 7.0.0) 213 | rack 214 | railties (>= 7.0.0) 215 | pry (0.14.2) 216 | coderay (~> 1.1) 217 | method_source (~> 1.0) 218 | pry-rails (0.3.11) 219 | pry (>= 0.13.0) 220 | psych (5.1.2) 221 | stringio 222 | puma (6.4.3) 223 | nio4r (~> 2.0) 224 | racc (1.8.1) 225 | rack (3.1.7) 226 | rack-session (2.0.0) 227 | rack (>= 3.0.0) 228 | rack-test (2.1.0) 229 | rack (>= 1.3) 230 | rackup (2.1.0) 231 | rack (>= 3) 232 | webrick (~> 1.8) 233 | rails (7.1.4) 234 | actioncable (= 7.1.4) 235 | actionmailbox (= 7.1.4) 236 | actionmailer (= 7.1.4) 237 | actionpack (= 7.1.4) 238 | actiontext (= 7.1.4) 239 | actionview (= 7.1.4) 240 | activejob (= 7.1.4) 241 | activemodel (= 7.1.4) 242 | activerecord (= 7.1.4) 243 | activestorage (= 7.1.4) 244 | activesupport (= 7.1.4) 245 | bundler (>= 1.15.0) 246 | railties (= 7.1.4) 247 | rails-dom-testing (2.2.0) 248 | activesupport (>= 5.0.0) 249 | minitest 250 | nokogiri (>= 1.6) 251 | rails-html-sanitizer (1.6.0) 252 | loofah (~> 2.21) 253 | nokogiri (~> 1.14) 254 | rails-i18n (7.0.9) 255 | i18n (>= 0.7, < 2) 256 | railties (>= 6.0.0, < 8) 257 | rails_bootstrap_navbar (3.0.0) 258 | bootstrap-navbar (~> 3.0) 259 | rails (>= 3.0.0) 260 | railties (7.1.4) 261 | actionpack (= 7.1.4) 262 | activesupport (= 7.1.4) 263 | irb 264 | rackup (>= 1.0.0) 265 | rake (>= 12.2) 266 | thor (~> 1.0, >= 1.2.2) 267 | zeitwerk (~> 2.6) 268 | rake (13.2.1) 269 | rdoc (6.7.0) 270 | psych (>= 4.0.0) 271 | redis (5.3.0) 272 | redis-client (>= 0.22.0) 273 | redis-client (0.22.2) 274 | connection_pool 275 | redis-namespace (1.11.0) 276 | redis (>= 4) 277 | reline (0.5.10) 278 | io-console (~> 0.5) 279 | rouge (4.4.0) 280 | sass-embedded (1.79.4-arm64-darwin) 281 | google-protobuf (~> 4.27) 282 | sass-embedded (1.79.4-x86_64-linux-gnu) 283 | google-protobuf (~> 4.27) 284 | sentry-rails (5.21.0) 285 | railties (>= 5.0) 286 | sentry-ruby (~> 5.21.0) 287 | sentry-ruby (5.21.0) 288 | bigdecimal 289 | concurrent-ruby (~> 1.0, >= 1.0.2) 290 | sitemap_generator (6.3.0) 291 | builder (~> 3.0) 292 | sqlite3 (2.1.0-arm64-darwin) 293 | sqlite3 (2.1.0-x86_64-linux-gnu) 294 | stimulus-rails (1.3.4) 295 | railties (>= 6.0.0) 296 | stringio (3.1.1) 297 | temple (0.10.3) 298 | thor (1.3.2) 299 | tilt (2.4.0) 300 | timeout (0.4.1) 301 | turbo-rails (2.0.10) 302 | actionpack (>= 6.0.0) 303 | railties (>= 6.0.0) 304 | tzinfo (2.0.6) 305 | concurrent-ruby (~> 1.0) 306 | webrick (1.8.2) 307 | websocket-driver (0.7.6) 308 | websocket-extensions (>= 0.1.0) 309 | websocket-extensions (0.1.5) 310 | zeitwerk (2.6.18) 311 | 312 | PLATFORMS 313 | arm64-darwin-23 314 | x86_64-linux 315 | 316 | DEPENDENCIES 317 | activerecord-enhancedsqlite3-adapter (~> 0.5) 318 | amazing_print (~> 1.5) 319 | annotaterb (~> 4.4) 320 | aws-sdk-s3 (~> 1.8) 321 | baseline! 322 | better_errors (~> 2.8) 323 | binding_of_caller (~> 1.0) 324 | bootsnap (~> 1.17) 325 | bootstrap (~> 5.3) 326 | dartsass-rails (~> 0.5) 327 | friendly_id (~> 5.5) 328 | haml (~> 6.0) 329 | importmap-rails (~> 2.0) 330 | kredis (~> 1.2) 331 | octopoller (~> 0.3) 332 | postmark-rails (~> 0.22) 333 | propshaft (~> 0.8) 334 | pry-rails (~> 0.3) 335 | puma (~> 6.4) 336 | rails (~> 7.1.2) 337 | rails-i18n (~> 7.0) 338 | rails_bootstrap_navbar (~> 3.0) 339 | redis (~> 5.0) 340 | redis-namespace (~> 1.11) 341 | sdoc! 342 | sentry-rails (~> 5.5) 343 | sitemap_generator (~> 6.3) 344 | sqlite3 (~> 2.0) 345 | stimulus-rails (~> 1.3) 346 | turbo-rails (~> 2.0) 347 | 348 | RUBY VERSION 349 | ruby 3.3.4p94 350 | 351 | BUNDLED WITH 352 | 2.5.21 353 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Manuel Meurer 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Procfile.dev: -------------------------------------------------------------------------------- 1 | web: bin/rails server -p 3000 2 | css: bin/rails dartsass:watch 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RubyDocs 2 | 3 | RubyDocs lets you create fast and searchable docs for any Ruby project by using the [sdoc](https://github.com/zzak/sdoc) documentation tool. 4 | 5 | The application is live at https://rubydocs.org/ 6 | 7 | If you find a bug or have an idea for a new feature, please [open an issue](https://github.com/manuelmeurer/rubydocs/issues/new)! 8 | 9 | ## Contributing 10 | 11 | 1. Fork it 12 | 2. Create your feature branch (`git checkout -b my-new-feature`) 13 | 3. Commit your changes (`git commit -am 'Add some feature'`) 14 | 4. Push to the branch (`git push origin my-new-feature`) 15 | 5. Create new Pull Request 16 | 17 | ## Support 18 | 19 | If you find RubyDocs useful and would like to support the ongoing development, [buy me a coffee](https://www.buymeacoffee.com/279lcDtbF) or [become a sponsor](https://github.com/sponsors/manuelmeurer)! 20 | 21 | ## License 22 | 23 | This project is licensed under the MIT License - see the LICENSE.txt file for details. 24 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require_relative "config/application" 2 | 3 | Rails.application.load_tasks 4 | -------------------------------------------------------------------------------- /app/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubydocs/app/66428e866c9c206279468451cf17eacb15b4cd17/app/assets/images/favicon.ico -------------------------------------------------------------------------------- /app/assets/images/favicons/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubydocs/app/66428e866c9c206279468451cf17eacb15b4cd17/app/assets/images/favicons/github.png -------------------------------------------------------------------------------- /app/assets/images/favicons/rubygems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubydocs/app/66428e866c9c206279468451cf17eacb15b4cd17/app/assets/images/favicons/rubygems.png -------------------------------------------------------------------------------- /app/assets/images/favicons/website.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubydocs/app/66428e866c9c206279468451cf17eacb15b4cd17/app/assets/images/favicons/website.png -------------------------------------------------------------------------------- /app/assets/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubydocs/app/66428e866c9c206279468451cf17eacb15b4cd17/app/assets/images/icon.png -------------------------------------------------------------------------------- /app/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubydocs/app/66428e866c9c206279468451cf17eacb15b4cd17/app/assets/images/logo.png -------------------------------------------------------------------------------- /app/assets/images/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 17 | 20 | 23 | 25 | 27 | 30 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | @import "bootstrap"; 2 | @import "partials/basics"; 3 | -------------------------------------------------------------------------------- /app/assets/stylesheets/partials/_basics.scss: -------------------------------------------------------------------------------- 1 | header { 2 | margin-bottom: 3rem; 3 | } 4 | 5 | // main { 6 | // padding-bottom: 3rem; 7 | 8 | // img { 9 | // @extend .img-fluid; 10 | // } 11 | 12 | // a:not(.btn) { 13 | // text-decoration: none; 14 | 15 | // &:hover { 16 | // text-decoration: underline; 17 | // } 18 | // } 19 | 20 | // section + section { 21 | // margin-top: 3rem; 22 | // } 23 | // } 24 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | include Baseline::ControllerExtensions 3 | 4 | def home 5 | render "/home" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | include Baseline::Helper 3 | end 4 | -------------------------------------------------------------------------------- /app/javascript/application.js: -------------------------------------------------------------------------------- 1 | import "@hotwired/turbo-rails" 2 | import "popper" 3 | import "bootstrap" 4 | 5 | import { Application } from "@hotwired/stimulus" 6 | import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" 7 | 8 | const application = Application.start() 9 | 10 | application.debug = false 11 | window.Stimulus = application 12 | 13 | eagerLoadControllersFrom("controllers", application) 14 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default \ 3 | from: "RubyDocs ", 4 | template_path: "mailers", 5 | message_stream: :outbound 6 | 7 | layout "mailer" 8 | end 9 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | include Baseline::ModelExtensions 3 | primary_abstract_class 4 | end 5 | -------------------------------------------------------------------------------- /app/services/report_error.rb: -------------------------------------------------------------------------------- 1 | ReportError = Baseline::ReportError 2 | -------------------------------------------------------------------------------- /app/views/home.html.haml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubydocs/app/66428e866c9c206279468451cf17eacb15b4cd17/app/views/home.html.haml -------------------------------------------------------------------------------- /app/views/layouts/application.html.haml: -------------------------------------------------------------------------------- 1 | !!! 2 | 3 | %html 4 | %head 5 | %title 6 | RubyDocs 7 | 8 | = csrf_meta_tags 9 | = csp_meta_tag 10 | 11 | %meta{ charset: "utf-8" } 12 | 13 | %meta{ "http-equiv": "X-UA-Compatible", content: "IE=edge,chrome=1" } 14 | %meta{ "http-equiv": "Content-Type", content: "text/html; charset=utf-8" } 15 | 16 | %meta{ name: "viewport", content: "width=device-width,initial-scale=1" } 17 | 18 | = stylesheet_link_tag :application, data: { turbo_track: "reload" }, media: "all" 19 | 20 | = javascript_include_tag "https://kit.fontawesome.com/0d43dadb44.js", crossorigin: "anonymous" 21 | = javascript_importmap_tags 22 | 23 | - if Rails.env.production? 24 | = javascript_include_tag "/qwerty/js/script.js", defer: true, data: { domain: "rubydocs.org", api: "/qwerty/api/event" } 25 | 26 | %body{ class: page_classes } 27 | = render "shared/header" 28 | %main.container-lg 29 | = flashes 30 | = yield 31 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/views/shared/_header.html.haml: -------------------------------------------------------------------------------- 1 | %header 2 | = navbar container: "lg", expand_at: "md", bg: "dark", brand: inline_svg("logo.svg") do 3 | = navbar_collapse class: "justify-content-end" do 4 | = navbar_group do 5 | = navbar_item tag.i(class: %w(fab fa-xl fa-github)), "https://github.com/rubydocs/app", {}, target: "_blank" 6 | -------------------------------------------------------------------------------- /bin/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | bundle install -j $(nproc) 4 | 5 | $(bundle show baseline)/bin/build 6 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This file was generated by Bundler. 4 | # 5 | # The application 'bundle' is installed as part of a gem, and 6 | # this file is here to facilitate running it. 7 | # 8 | 9 | require "rubygems" 10 | 11 | m = Module.new do 12 | module_function 13 | 14 | def invoked_as_script? 15 | File.expand_path($0) == File.expand_path(__FILE__) 16 | end 17 | 18 | def env_var_version 19 | ENV["BUNDLER_VERSION"] 20 | end 21 | 22 | def cli_arg_version 23 | return unless invoked_as_script? # don't want to hijack other binstubs 24 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` 25 | bundler_version = nil 26 | update_index = nil 27 | ARGV.each_with_index do |a, i| 28 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN 29 | bundler_version = a 30 | end 31 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ 32 | bundler_version = $1 33 | update_index = i 34 | end 35 | bundler_version 36 | end 37 | 38 | def gemfile 39 | gemfile = ENV["BUNDLE_GEMFILE"] 40 | return gemfile if gemfile && !gemfile.empty? 41 | 42 | File.expand_path("../Gemfile", __dir__) 43 | end 44 | 45 | def lockfile 46 | lockfile = 47 | case File.basename(gemfile) 48 | when "gems.rb" then gemfile.sub(/\.rb$/, ".locked") 49 | else "#{gemfile}.lock" 50 | end 51 | File.expand_path(lockfile) 52 | end 53 | 54 | def lockfile_version 55 | return unless File.file?(lockfile) 56 | lockfile_contents = File.read(lockfile) 57 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ 58 | Regexp.last_match(1) 59 | end 60 | 61 | def bundler_requirement 62 | @bundler_requirement ||= 63 | env_var_version || 64 | cli_arg_version || 65 | bundler_requirement_for(lockfile_version) 66 | end 67 | 68 | def bundler_requirement_for(version) 69 | return "#{Gem::Requirement.default}.a" unless version 70 | 71 | bundler_gem_version = Gem::Version.new(version) 72 | 73 | bundler_gem_version.approximate_recommendation 74 | end 75 | 76 | def load_bundler! 77 | ENV["BUNDLE_GEMFILE"] ||= gemfile 78 | 79 | activate_bundler 80 | end 81 | 82 | def activate_bundler 83 | gem_error = activation_error_handling do 84 | gem "bundler", bundler_requirement 85 | end 86 | return if gem_error.nil? 87 | require_error = activation_error_handling do 88 | require "bundler/version" 89 | end 90 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) 91 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" 92 | exit 42 93 | end 94 | 95 | def activation_error_handling 96 | yield 97 | nil 98 | rescue StandardError, LoadError => e 99 | e 100 | end 101 | end 102 | 103 | m.load_bundler! 104 | 105 | if m.invoked_as_script? 106 | load Gem.bin_path("bundler", "bundle") 107 | end 108 | -------------------------------------------------------------------------------- /bin/deploy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | $(bundle show baseline)/bin/deploy 4 | -------------------------------------------------------------------------------- /bin/dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | if ! gem list foreman -i --silent; then 4 | echo "Installing foreman..." 5 | gem install foreman 6 | fi 7 | 8 | exec foreman start -f Procfile.dev "$@" 9 | -------------------------------------------------------------------------------- /bin/importmap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require_relative "../config/application" 4 | require "importmap/commands" 5 | -------------------------------------------------------------------------------- /bin/prod-console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | $(bundle show baseline)/bin/prod-console many-apps rubydocs 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /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, exception: true) 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 | # Install JavaScript dependencies 21 | system!("bun install") 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?("config/database.yml") 25 | # FileUtils.cp "config/database.yml.sample", "config/database.yml" 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! "bin/rails db:prepare" 30 | 31 | puts "\n== Removing old logs and tempfiles ==" 32 | system! "bin/rails log:clear tmp:clear" 33 | 34 | puts "\n== Restarting application server ==" 35 | system! "bin/rails restart" 36 | end 37 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | require_relative "config/environment" 2 | 3 | run Rails.application 4 | 5 | Rails.application.load_server 6 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | Bundler.require(*Rails.groups) 6 | 7 | module RubyDocs 8 | class Application < Rails::Application 9 | config.load_defaults 7.1 10 | config.autoload_lib ignore: %w(assets tasks) 11 | 12 | config.time_zone = "Berlin" 13 | config.revision = begin 14 | ENV.fetch("HATCHBOX_REVISION") 15 | rescue KeyError 16 | `git rev-parse HEAD 2> /dev/null`.chomp 17 | end.presence or raise "Could not load revision." 18 | 19 | config.action_mailer.delivery_method = :postmark 20 | config.active_record.query_log_tags_enabled = true 21 | config.active_record.sqlite3_production_warning = false 22 | 23 | config.assets.excluded_paths.concat [ 24 | Rails.root.join("app", "assets", "stylesheets") 25 | ] 26 | 27 | config.i18n.raise_on_missing_translations = true 28 | 29 | config.middleware.insert 0, Rack::Deflater 30 | 31 | Rails.application.routes.default_url_options = 32 | config.action_mailer.default_url_options = { 33 | host: Rails.application.env_credentials.host!, 34 | protocol: "https" 35 | } 36 | 37 | if Rails.version >= "7.2" 38 | raise "this is not needed anymore, yjit should be enabled by default in rails 7.2." 39 | end 40 | config.after_initialize do 41 | RubyVM::YJIT.enable 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" 4 | require "bootsnap/setup" 5 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | zcOYNkMxVjWIwksZA7kr3v1unPiESj6NDwSqxT6ApBgJY8wWyhENRsThu2mEWVIiaClgiK8OzuMLn3MbnJc4RMoSTEbglkTXz/VHHEhTxXQzhErSilOgsygcKx92k0FmzOCwCXf2EGD4Ct1ADXroFAU7j6131VJTPWYQBShl97la0Z0RonR3v2JvYdNKrnMLglGttgEK4JwDxgwKP9FLn2WFIZRexWK2uFb4Jnp2rSUTQ91zkTGox7U1+djiE4HsZCDPezlncpwAuh7J+vwCkQ8teEa8ayloEItelQitg15HUPJLqtNXBP5kgfmwh+/IMXOtt20ojmuRaHIsXUaR1owCTfcyKOcdyfb0WBws2XHUEIS1v2XsyBVmnDJuF6LnGHgeQMtQh6dR8wfu1Ac3aSnPxkcv9nIsJPpfQWtTTkytvSM842vg153I7777rWU5u5NV7Cd48MNh8fQnB7935p63yrkkoHXvFDxV4J5YfxGtzkPAVNy/1vOaHo5O7IaS++ai9TC0nzBXNrs9EghP22ihzkGBczIdQrO+37LPRfOFJ02zDHkwBUmHxkpZwk8Y9ddKmhWLgrp3OXKVoq3HJQAKaGg3sbZoXYBf832a/i+XYx+cfb7d6Ou4lcB3A/AL0127YbdjnoH/XEW4mm15G4nF21O79n38agFtIdkD5FKEXh4q4aKzc1nIe4tJQCSxi1bUlBZCws5i0RHyOhsJ7YnfLAkLL3bNiqX8Ql1zEoIoGOs8yrhONoTf1HPAfpyf2ZdecnKHOWEfrZonhnaVGmBpVy+m4BeQGIZHABtUUWLsgOd9Xmgzy3pKMAZRk1CaA5gkxLE7GAkl91ut6SrL4lPz3tRJ035EGy/lMqY4NHwFHvbl7FvReMcqq0DIKcdBkbuKMrCNuzlNT4S+BTKKT7X7ogAOQ/2Bru9q/rqdKRQxob6VIVpeuDVLo6sgZz6BUZ3Znv4+EZpephDXEhkjUozRTgiEWWHS0kw5KsI1KLmGbcTwRoT6rWL7zUDvpEeg1uCepvtPDH1mBNb2U7DMRUzbHb3U6ECZGvuYnh8BDIbaBH2i1NgwU+hPO37+3GXRypnGVid4sAthkQezVzqXo1jpbaaJkypMeYUaalAgSzRkpiEOgW+ABgsD6AWplVYeT9uhGVX/w9+stOR5uSvuwn2+Sq+mNQjRNXxalnvfqLYVbSxt+F0qZffQDaSxejiSnP9MPboMUp4FH+hlLTN9H2SFoLAfKsWRcVm/WBgMDHxdKYuokeI2j/JXWbKIeGsyWU3Eb5ERbo/1OmY5cS94va6pUjJimeZ+11aFt6BFDgcW0IF83hweflr02EneESqsFyZijGa0gJe4NPOp9tDuOpoIVFuZvWy9WdEAJ7JkmiGTKUGX1i2WtdSj8UfFUWBTA0mROMblSS6LlJPlg2JR9fC31oBkYJB9dw==--00LkbjnMEjszSwSU--JgA6GWTLoAzst2fj8nmnKw== -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | adapter: sqlite3 3 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 4 | timeout: 5000 5 | 6 | development: 7 | <<: *default 8 | database: storage/development.sqlite3 9 | 10 | test: 11 | <<: *default 12 | database: storage/test.sqlite3 13 | 14 | production: 15 | <<: *default 16 | database: storage/production.sqlite3 17 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | require_relative "application" 2 | 3 | Rails.application.initialize! 4 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # In the development environment your application's code is reloaded any time 5 | # it changes. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.enable_reloading = true 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports. 13 | config.consider_all_requests_local = true 14 | 15 | # Enable server timing 16 | config.server_timing = true 17 | 18 | # Enable/disable caching. By default caching is disabled. 19 | # Run rails dev:cache to toggle caching. 20 | if Rails.root.join("tmp/caching-dev.txt").exist? 21 | config.action_controller.perform_caching = true 22 | config.action_controller.enable_fragment_cache_logging = true 23 | 24 | config.cache_store = :memory_store 25 | config.public_file_server.headers = { 26 | "Cache-Control" => "public, max-age=#{2.days.to_i}" 27 | } 28 | else 29 | config.action_controller.perform_caching = false 30 | 31 | config.cache_store = :null_store 32 | end 33 | 34 | # Store uploaded files on the local file system (see config/storage.yml for options). 35 | config.active_storage.service = :local 36 | 37 | # Don't care if the mailer can't send. 38 | config.action_mailer.raise_delivery_errors = false 39 | 40 | config.action_mailer.perform_caching = false 41 | 42 | # Print deprecation notices to the Rails logger. 43 | config.active_support.deprecation = :log 44 | 45 | # Raise exceptions for disallowed deprecations. 46 | config.active_support.disallowed_deprecation = :raise 47 | 48 | # Tell Active Support which deprecation messages to disallow. 49 | config.active_support.disallowed_deprecation_warnings = [] 50 | 51 | # Raise an error on page load if there are pending migrations. 52 | config.active_record.migration_error = :page_load 53 | 54 | # Highlight code that triggered database queries in logs. 55 | config.active_record.verbose_query_logs = true 56 | 57 | # Highlight code that enqueued background job in logs. 58 | config.active_job.verbose_enqueue_logs = true 59 | 60 | # Raises error for missing translations. 61 | # config.i18n.raise_on_missing_translations = true 62 | 63 | # Annotate rendered view with file names. 64 | # config.action_view.annotate_rendered_view_with_filenames = true 65 | 66 | # Uncomment if you wish to allow Action Cable access from any origin. 67 | # config.action_cable.disable_request_forgery_protection = true 68 | 69 | # Raise error when a before_action's only/except options reference missing actions 70 | config.action_controller.raise_on_missing_callback_actions = true 71 | 72 | config.hosts << /([a-z]+\.)?#{Rails.application.env_credentials.host!}/ 73 | end 74 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Code is not reloaded between requests. 5 | config.enable_reloading = false 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment 18 | # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). 19 | # config.require_master_key = true 20 | 21 | # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. 22 | # config.public_file_server.enabled = false 23 | 24 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 25 | # config.asset_host = "http://assets.example.com" 26 | 27 | # Specifies the header that your server uses for sending files. 28 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache 29 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX 30 | 31 | # Store uploaded files on the local file system (see config/storage.yml for options). 32 | config.active_storage.service = :cloudflare 33 | 34 | # Mount Action Cable outside main process or domain. 35 | # config.action_cable.mount_path = nil 36 | # config.action_cable.url = "wss://example.com/cable" 37 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] 38 | 39 | # Assume all access to the app is happening through a SSL-terminating reverse proxy. 40 | # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. 41 | # config.assume_ssl = true 42 | 43 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 44 | config.force_ssl = true 45 | 46 | # Log to STDOUT by default 47 | config.logger = ActiveSupport::Logger.new(STDOUT) 48 | .tap { |logger| logger.formatter = ::Logger::Formatter.new } 49 | .then { |logger| ActiveSupport::TaggedLogging.new(logger) } 50 | 51 | if Rails.version > "7.1.4" 52 | raise "enable multiple loggers when this bug is fixed: https://github.com/rails/rails/issues/49745" 53 | end 54 | # Log to STDOUT and production.log. 55 | # config.logger = [STDOUT, "log/production.log"].map do |destination| 56 | # ActiveSupport::Logger.new(destination, formatter: ::Logger::Formatter.new) 57 | # .then { ActiveSupport::TaggedLogging.new _1 } 58 | # end.then { ActiveSupport::BroadcastLogger.new(*_1) } 59 | 60 | # Prepend all log lines with the following tags. 61 | config.log_tags = [:request_id] 62 | 63 | # Info include generic and useful information about system operation, but avoids logging too much 64 | # information to avoid inadvertent exposure of personally identifiable information (PII). If you 65 | # want to log everything, set the level to "debug". 66 | config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") 67 | 68 | # Use a different cache store in production. 69 | config.cache_store = :redis_cache_store, { 70 | url: Baseline::RedisURL.fetch, 71 | namespace: "cache", 72 | expires_in: 1.month, 73 | reconnect_attempts: 1, 74 | error_handler: -> (method:, returning:, exception:) { 75 | ReportError.call exception, method: method, returning: returning 76 | } 77 | } 78 | 79 | # Use a real queuing backend for Active Job (and separate queues per environment). 80 | # config.active_job.queue_adapter = :resque 81 | # config.active_job.queue_name_prefix = "rubydocs_production" 82 | 83 | config.action_mailer.perform_caching = false 84 | 85 | # Ignore bad email addresses and do not raise email delivery errors. 86 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 87 | config.action_mailer.raise_delivery_errors = true 88 | 89 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 90 | # the I18n.default_locale when a translation cannot be found). 91 | config.i18n.fallbacks = true 92 | 93 | # Don't log any deprecations. 94 | config.active_support.report_deprecations = false 95 | 96 | # Do not dump schema after migrations. 97 | config.active_record.dump_schema_after_migration = false 98 | 99 | # Enable DNS rebinding protection and other `Host` header attacks. 100 | # config.hosts = [ 101 | # "example.com", # Allow requests from example.com 102 | # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` 103 | # ] 104 | # Skip DNS rebinding protection for the default health check endpoint. 105 | # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } 106 | end 107 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # While tests run files are not watched, reloading is not necessary. 5 | config.enable_reloading = false 6 | 7 | # Eager loading loads your entire application. When running a single test locally, 8 | # this is usually not necessary, and can slow down your test suite. However, it's 9 | # recommended that you enable it in continuous integration systems to ensure eager 10 | # loading is working properly before deploying your code. 11 | config.eager_load = ENV["CI"].present? 12 | 13 | # Configure public file server for tests with Cache-Control for performance. 14 | config.public_file_server.enabled = true 15 | config.public_file_server.headers = { 16 | "Cache-Control" => "public, max-age=#{1.hour.to_i}" 17 | } 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | config.cache_store = :null_store 23 | 24 | # Render exception templates for rescuable exceptions and raise for other exceptions. 25 | config.action_dispatch.show_exceptions = :rescuable 26 | 27 | # Disable request forgery protection in test environment. 28 | config.action_controller.allow_forgery_protection = false 29 | 30 | # Store uploaded files on the local file system in a temporary directory. 31 | config.active_storage.service = :test 32 | 33 | config.action_mailer.perform_caching = false 34 | 35 | # Tell Action Mailer not to deliver emails to the real world. 36 | # The :test delivery method accumulates sent emails in the 37 | # ActionMailer::Base.deliveries array. 38 | config.action_mailer.delivery_method = :test 39 | 40 | # Print deprecation notices to the stderr. 41 | config.active_support.deprecation = :stderr 42 | 43 | # Raise exceptions for disallowed deprecations. 44 | config.active_support.disallowed_deprecation = :raise 45 | 46 | # Tell Active Support which deprecation messages to disallow. 47 | config.active_support.disallowed_deprecation_warnings = [] 48 | 49 | # Raises error for missing translations. 50 | # config.i18n.raise_on_missing_translations = true 51 | 52 | # Annotate rendered view with file names. 53 | # config.action_view.annotate_rendered_view_with_filenames = true 54 | 55 | # Raise error when a before_action's only/except options reference missing actions 56 | config.action_controller.raise_on_missing_callback_actions = true 57 | end 58 | -------------------------------------------------------------------------------- /config/importmap.rb: -------------------------------------------------------------------------------- 1 | pin "application" 2 | 3 | pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" 4 | pin "@hotwired/stimulus", to: "stimulus.min.js" 5 | pin "@hotwired/turbo-rails", to: "turbo.min.js" 6 | pin "bootstrap", to: "bootstrap.min.js" 7 | pin "popper", to: "popper.js" 8 | 9 | pin_all_from "app/javascript/controllers", under: "controllers" 10 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Version of your assets, change this if you want to expire all your assets. 2 | Rails.application.config.assets.version = "1.0" 3 | 4 | # Add additional assets to the asset load path. 5 | # Rails.application.config.assets.paths << Emoji.images_path 6 | -------------------------------------------------------------------------------- /config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide content security policy. 2 | # See the Securing Rails Applications Guide for more information: 3 | # https://guides.rubyonrails.org/security.html#content-security-policy-header 4 | 5 | # Rails.application.configure do 6 | # config.content_security_policy do |policy| 7 | # policy.default_src :self, :https 8 | # policy.font_src :self, :https, :data 9 | # policy.img_src :self, :https, :data 10 | # policy.object_src :none 11 | # policy.script_src :self, :https 12 | # policy.style_src :self, :https 13 | # # Specify URI for violation reports 14 | # # policy.report_uri "/csp-violation-report-endpoint" 15 | # end 16 | # 17 | # # Generate session nonces for permitted importmap, inline scripts, and inline styles. 18 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } 19 | # config.content_security_policy_nonce_directives = %w(script-src style-src) 20 | # 21 | # # Report violations without enforcing the policy. 22 | # # config.content_security_policy_report_only = true 23 | # end 24 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. 2 | # Use this to limit dissemination of sensitive information. 3 | # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. 4 | Rails.application.config.filter_parameters += [ 5 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 6 | ] 7 | -------------------------------------------------------------------------------- /config/initializers/friendly_id.rb: -------------------------------------------------------------------------------- 1 | FriendlyId.defaults do |config| 2 | config.use :reserved 3 | config.reserved_words = %w(new edit index session login logout users admin stylesheets assets javascripts images) 4 | end 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Add new inflection rules using the following format. Inflections 2 | # are locale specific, and you may define rules for as many different 3 | # locales as you wish. All of these examples are active by default: 4 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 5 | # inflect.plural /^(ox)$/i, "\\1en" 6 | # inflect.singular /^(ox)en/i, "\\1" 7 | # inflect.irregular "person", "people" 8 | # inflect.uncountable %w( fish sheep ) 9 | # end 10 | 11 | ActiveSupport::Inflector.inflections :en do |inflect| 12 | inflect.acronym "API" 13 | end 14 | -------------------------------------------------------------------------------- /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 |policy| 5 | # policy.camera :none 6 | # policy.gyroscope :none 7 | # policy.microphone :none 8 | # policy.usb :none 9 | # policy.fullscreen :self 10 | # policy.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /config/initializers/postmark.rb: -------------------------------------------------------------------------------- 1 | require "postmark" 2 | 3 | Postmark.api_token = Rails.application.env_credentials.postmark_api_token 4 | -------------------------------------------------------------------------------- /config/initializers/sentry.rb: -------------------------------------------------------------------------------- 1 | Sentry.init do |config| 2 | config.breadcrumbs_logger = %i(active_support_logger http_logger) 3 | config.include_local_variables = true 4 | config.release = Rails.configuration.revision 5 | config.send_default_pii = true 6 | end 7 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | en: 2 | please_wait: Please wait... 3 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) 4 | threads threads_count, threads_count 5 | 6 | port ENV.fetch("PORT", 3000) 7 | pidfile ENV.fetch("PIDFILE", "tmp/pids/server.pid") 8 | 9 | plugin :tmp_restart 10 | 11 | # Recommendation from https://github.com/Shopify/autotuner 12 | before_fork do 13 | 3.times { GC.start } 14 | GC.compact 15 | end 16 | 17 | preload_app! 18 | -------------------------------------------------------------------------------- /config/redis/shared.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | url: <%= Baseline::RedisURL.fetch %> 3 | timeout: 1 4 | 5 | development: 6 | <<: *default 7 | 8 | test: 9 | <<: *default 10 | 11 | production: 12 | <<: *default 13 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root "application#home" 3 | 4 | get "up" => "rails/health#show", as: :rails_health_check 5 | end 6 | -------------------------------------------------------------------------------- /config/sitemap.rb: -------------------------------------------------------------------------------- 1 | require "sitemap_generator" 2 | 3 | SitemapGenerator::Sitemap.default_host = root_url 4 | 5 | SitemapGenerator::Sitemap.create do 6 | end 7 | -------------------------------------------------------------------------------- /config/storage.yml: -------------------------------------------------------------------------------- 1 | local: 2 | service: Disk 3 | root: <%= Rails.root.join("storage") %> 4 | 5 | test: 6 | service: Disk 7 | root: <%= Rails.root.join("tmp", "storage") %> 8 | 9 | cloudflare: 10 | service: S3 11 | access_key_id: <%= Rails.application.env_credentials.cloudflare.r2.access_key_id! %> 12 | secret_access_key: <%= Rails.application.env_credentials.cloudflare.r2.secret_access_key! %> 13 | endpoint: https://<%= Rails.application.env_credentials.cloudflare.account_id! %>.r2.cloudflarestorage.com 14 | bucket: <%= Rails.application.env_credentials.cloudflare.r2.bucket %> 15 | region: auto 16 | force_path_style: true 17 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | Sitemap: https://rubydocs.org/sitemap.xml.gz 4 | -------------------------------------------------------------------------------- /stuff.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubydocs/app/66428e866c9c206279468451cf17eacb15b4cd17/stuff.rb --------------------------------------------------------------------------------