### Example environment variables for Heroku Source: https://github.com/rubyconfig/config/blob/master/README.md Example of environment variables with custom prefix and separator. ```bash SETTINGS__SECTION__SERVER_SIZE=1 SETTINGS__SECTION__SERVER=google.com SETTINGS__SECTION__SSL_ENABLED=false ``` -------------------------------- ### Install on Padrino Source: https://github.com/rubyconfig/config/blob/master/README.md Add the gem to your Gemfile and run 'bundle install'. Then edit 'app.rb' and register 'Config'. ```ruby register Config ``` -------------------------------- ### Install on Rails Source: https://github.com/rubyconfig/config/blob/master/README.md Add 'gem 'config'' to your Gemfile and run 'bundle install'. Then run 'rails g config:install' to generate configuration files. ```ruby rails g config:install ``` -------------------------------- ### Install on Sinatra Source: https://github.com/rubyconfig/config/blob/master/README.md Add the gem to your Gemfile and run 'bundle install'. Register 'Config' in your app and provide a root path. ```ruby set :root, File.dirname(__FILE__) register Config ``` -------------------------------- ### Example ENV variables Source: https://github.com/rubyconfig/config/blob/master/README.md When `use_env` is true, config reads values from the ENV object. For the example above, it would look for keys starting with `Settings`. ```ruby ENV['Settings.section.size'] = 1 ENV['Settings.section.server'] = 'google.com' ``` -------------------------------- ### Bundle Install Source: https://github.com/rubyconfig/config/blob/master/CONTRIBUTING.md Installs all project dependencies defined in the Gemfile. ```bash bundle install ``` -------------------------------- ### Install dependencies for running specs Source: https://github.com/rubyconfig/config/blob/master/README.md Commands to install necessary dependencies for running the project's specifications. ```sh bundle install bundle exec appraisal install ``` -------------------------------- ### Schema Validation Example Source: https://github.com/rubyconfig/config/blob/master/README.md Example of setting up a validation schema using dry-schema. ```ruby Config.setup do |config| # ... config.schema do optional(:email).maybe(:str?) required(:youtube).schema do required(:api_key).filled end end end ``` -------------------------------- ### Install on other ruby projects (Method 1) Source: https://github.com/rubyconfig/config/blob/master/README.md Add the gem to your Gemfile, run 'bundle install', and initialize 'Config' manually within your configure block. ```ruby Config.load_and_set_settings(Config.setting_files("/path/to/config_root", "your_project_environment")) ``` -------------------------------- ### Contract Validation Example Source: https://github.com/rubyconfig/config/blob/master/README.md Example of setting up a validation contract using dry-validation. ```ruby class ConfigContract < Dry::Validation::Contract params do optional(:email).maybe(:str?) required(:youtube).schema do required(:api_key).filled end end rule(:email) do unless /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i.match?(value) key.failure('has invalid format') end end end Config.setup do |config| config.validation_contract = ConfigContract.new end ``` -------------------------------- ### Adding a local.yml config file via initializer Source: https://github.com/rubyconfig/config/blob/master/README.md Provides an example of how to add a local.yml config file using an initializer. ```ruby Settings.add_source!("#{Rails.root}/config/settings/local.yml") Settings.reload! ``` -------------------------------- ### Example development environment config file Source: https://github.com/rubyconfig/config/blob/master/README.md Specifies the path for a development environment-specific configuration file. ```ruby #{Rails.root}/config/environments/development.yml ``` -------------------------------- ### Example production environment config file Source: https://github.com/rubyconfig/config/blob/master/README.md Specifies the path for a production environment-specific configuration file. ```ruby #{Rails.root}/config/environments/production.yml ``` -------------------------------- ### Install Appraisal Source: https://github.com/rubyconfig/config/blob/master/CONTRIBUTING.md Installs the necessary gems for using Appraisal, a tool for testing against multiple Rails versions. ```bash gem install bundler gem install appraisal ``` -------------------------------- ### Install on other ruby projects (Method 2) Source: https://github.com/rubyconfig/config/blob/master/README.md Initialize 'Config' manually within your configure block by providing YAML file paths. ```ruby Config.load_and_set_settings("/path/to/yaml1", "/path/to/yaml2", ...) ``` -------------------------------- ### Merge Nil Values Example Source: https://github.com/rubyconfig/config/blob/master/README.md Demonstrates how merge_nil_values works by default and how to disable it. ```ruby # merge_nil_values is true by default c = Config.load_files("./spec/fixtures/development.yml") # => # c.size # => 2 c.merge!(size: nil) => # c.size # => nil ``` ```ruby # To reject nil values when merging settings: Config.setup do |config| config.merge_nil_values = false end c = Config.load_files("./spec/fixtures/development.yml") # => # c.size # => 2 c.merge!(size: nil) => # c.size # => 2 ``` -------------------------------- ### Overriding EnvSource constructor options Source: https://github.com/rubyconfig/config/blob/master/README.md Example of overriding default options for `EnvSource` in the constructor. ```ruby secret_source = Config::Sources::EnvSource.new(secrets, prefix: 'MyConfig', separator: '__', converter: nil, parse_values: false) ``` -------------------------------- ### Example AWS Secrets Manager secret Source: https://github.com/rubyconfig/config/blob/master/README.md Example of a plaintext secret stored in AWS Secrets Manager. ```json { "Settings.foo": "hello", "Settings.bar": "world" } ``` -------------------------------- ### YAML configuration with ERB Source: https://github.com/rubyconfig/config/blob/master/README.md Example YAML configuration files demonstrating the use of Embedded Ruby (ERB) for dynamic values. ```yaml size: 1 server: google.com ``` ```yaml size: 2 computed: <%= 1 + 2 + 3 %> section: size: 3 servers: [ {name: yahoo.com}, {name: amazon.com} ] ``` -------------------------------- ### Bootstrap Appraisal Source: https://github.com/rubyconfig/config/blob/master/CONTRIBUTING.md Installs test applications for each specified Rails version using Appraisal. ```bash bundle exec appraisal install ``` -------------------------------- ### Loading extra sources during initialization Source: https://github.com/rubyconfig/config/blob/master/README.md Demonstrates how to load additional configuration sources during application initialization using the `extra_sources` option. ```ruby Config.setup do |config| config.extra_sources = [ 'path/to/extra_source.yml', { api_key: ENV['API_KEY'] }, MyCustomSource.new, ] end ``` -------------------------------- ### Adding a raw hash as a source Source: https://github.com/rubyconfig/config/blob/master/README.md Illustrates how to add a raw hash as a configuration source, useful for environment variables or database settings. ```ruby Settings.add_source!({some_secret: ENV['some_secret']}) Settings.reload! ``` -------------------------------- ### Configuring the constant name Source: https://github.com/rubyconfig/config/blob/master/README.md Demonstrates how to set a custom constant name for the configuration using `Config.setup`. ```ruby Config.setup do |config| config.const_name = 'Settings' # ... end ``` -------------------------------- ### Checking for Missing Keys Source: https://github.com/rubyconfig/config/blob/master/README.md Demonstrates how to check for the presence of a key using `key?`. ```ruby Settings.key?(:path) # => false Settings.key?(:server) # => true ``` -------------------------------- ### Adding sources at runtime Source: https://github.com/rubyconfig/config/blob/master/README.md Shows how to add new YAML configuration files at runtime using `add_source!` and `reload!`. ```ruby Settings.add_source!("/path/to/source.yml") Settings.reload! ``` -------------------------------- ### Prepending a YML file as a source Source: https://github.com/rubyconfig/config/blob/master/README.md Demonstrates how to prepend a YAML file to the list of configuration files using `prepend_source!` and `reload!`. ```ruby Settings.prepend_source!("/path/to/source.yml") Settings.reload! ``` -------------------------------- ### List defined appraisals Source: https://github.com/rubyconfig/config/blob/master/README.md Command to list all defined appraisals for the project. ```sh bundle exec appraisal list ``` -------------------------------- ### Correct way to specify environment variables Source: https://github.com/rubyconfig/config/blob/master/README.md Instead, specify keys of equal depth in the environment variable names. ```ruby ENV['BACKEND_DATABASE_NAME'] = 'development' ENV['BACKEND_DATABASE_USER'] = 'postgres' ``` -------------------------------- ### Verify Documentation Format Source: https://github.com/rubyconfig/config/blob/master/CONTRIBUTING.md Checks the format of Markdown documentation files using the 'mdl' linter. ```bash mdl *.md ``` -------------------------------- ### Accessing Missing Keys (fail_on_missing = true) Source: https://github.com/rubyconfig/config/blob/master/README.md Demonstrates configuring `fail_on_missing` to raise a KeyError for non-existent keys. ```ruby Config.setup do |config| config.fail_on_missing = true # ... end Settings.path # => raises KeyError: key not found: :path ``` -------------------------------- ### Run Test Suite Source: https://github.com/rubyconfig/config/blob/master/CONTRIBUTING.md Executes the project's test suite using RSpec with Appraisal. ```bash bundle exec appraisal rspec ``` -------------------------------- ### Settings available after custom configuration Source: https://github.com/rubyconfig/config/blob/master/README.md The resulting settings available after applying the custom environment variable configuration. ```ruby Settings.section.server_size # => 1 Settings.section.server # => 'google.com' Settings.section.ssl_enabled # => false ``` -------------------------------- ### Run specs for a specific appraisal Source: https://github.com/rubyconfig/config/blob/master/README.md Command to run specifications for a particular appraisal. ```sh bundle exec appraisal rails-6.1 rspec ``` -------------------------------- ### Accessing Nested Settings Source: https://github.com/rubyconfig/config/blob/master/README.md Nested entries are supported. ```ruby Settings.my_section.some_entry ``` -------------------------------- ### Accessing Missing Keys (Default Behavior) Source: https://github.com/rubyconfig/config/blob/master/README.md Shows that accessing a missing key returns nil by default. ```ruby Settings.key?(:path) # => false Settings.path # => nil ``` -------------------------------- ### Accessing Settings with [] operator Source: https://github.com/rubyconfig/config/blob/master/README.md Alternatively, use the '[]' operator if the exact setting name is unknown. ```ruby # All the following are equivalent to Settings.my_section.some_entry Settings.my_section[:some_entry] Settings.my_section['some_entry'] Settings[:my_section][:some_entry] ``` -------------------------------- ### Reloading Settings and Config Files Source: https://github.com/rubyconfig/config/blob/master/README.md Reload the Settings object from different config files at runtime, useful for testing. ```ruby Rails.env = "production" Settings.reload_from_files( Rails.root.join("config", "settings.yml").to_s, Rails.root.join("config", "settings", "#{Rails.env}.yml").to_s, Rails.root.join("config", "environments", "#{Rails.env}.yml").to_s ) ``` -------------------------------- ### Error case for environment variables Source: https://github.com/rubyconfig/config/blob/master/README.md It is considered an error to use environment variables to simultaneously assign a "flat" value and a multi-level value to a key. ```ruby # Raises an error when settings are loaded ENV['BACKEND_DATABASE'] = 'development' ENV['BACKEND_DATABASE_USER'] = 'postgres' ``` -------------------------------- ### Reloading Settings Source: https://github.com/rubyconfig/config/blob/master/README.md Reload the Settings object at any time by running 'Settings.reload!' ```ruby Settings.reload! ``` -------------------------------- ### Accessing Settings Source: https://github.com/rubyconfig/config/blob/master/README.md Access configuration entries via object member notation. ```ruby Settings.my_config_entry ``` -------------------------------- ### Developer specific config file paths Source: https://github.com/rubyconfig/config/blob/master/README.md Lists the default paths for developer-specific local configuration files that are automatically ignored by git. ```ruby Rails.root.join("config", "settings.local.yml").to_s, Rails.root.join("config", "settings", "#{Rails.env}.local.yml").to_s, Rails.root.join("config", "environments", "#{Rails.env}.local.yml").to_s ``` -------------------------------- ### Enable environment variable loading Source: https://github.com/rubyconfig/config/blob/master/README.md To load environment variables from the ENV object, that will override any settings defined in files, set the `use_env` to true in your `config/initializers/config.rb` file. ```ruby Config.setup do |config| config.const_name = 'Settings' config.use_env = true end ``` -------------------------------- ### Create New Test App Source: https://github.com/rubyconfig/config/blob/master/CONTRIBUTING.md Creates a new test application for a specific Rails version (e.g., Rails 7.0). ```bash bundle exec appraisal rails-7.0 rails new spec/app/rails_7.0 ``` -------------------------------- ### Accessing configuration values after ERB evaluation Source: https://github.com/rubyconfig/config/blob/master/README.md Shows how to access configuration values after ERB has been evaluated, demonstrating overwriting and nested access. ```ruby Settings.size # => 2 Settings.server # => google.com Settings.computed # => 6 Settings.section.size # => 3 Settings.section.servers[0].name # => yahoo.com Settings.section.servers[1].name # => amazon.com ``` -------------------------------- ### CSS for 404 Error Page Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_7.1/public/404.html This CSS styles the default 404 error page in a Rails application. ```css .rails-default-error-page { background-color: #EFEFEF; color: #2E2F30; text-align: center; font-family: arial, sans-serif; margin: 0; } .rails-default-error-page div.dialog { width: 95%; max-width: 33em; margin: 4em auto 0; } .rails-default-error-page div.dialog > div { border: 1px solid #CCC; border-right-color: #999; border-left-color: #999; border-bottom-color: #BBB; border-top: #B00100 solid 4px; border-top-left-radius: 9px; border-top-right-radius: 9px; background-color: white; padding: 7px 12% 0; box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17); } .rails-default-error-page h1 { font-size: 100%; color: #730E15; line-height: 1.5em; } .rails-default-error-page div.dialog > p { margin: 0 0 1em; padding: 1em; background-color: #F7F7F7; border: 1px solid #CCC; border-right-color: #999; border-left-color: #999; border-bottom-color: #999; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-color: #DADADA; color: #666; box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17); } ``` -------------------------------- ### Customizing environment variable processing Source: https://github.com/rubyconfig/config/blob/master/README.md Configuration for custom environment variable processing with a specific prefix, separator, converter, and value parsing. ```ruby Config.setup do |config| config.use_env = true config.env_prefix = 'SETTINGS' config.env_separator = '__' config.env_converter = :downcase config.env_parse_values = true end ``` -------------------------------- ### Settings available from AWS Secrets Manager Source: https://github.com/rubyconfig/config/blob/master/README.md The settings available after loading from AWS Secrets Manager. ```ruby Settings.foo # => "hello" Settings.bar # => "world" ``` -------------------------------- ### 404.html CSS Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_8.1/public/404.html The CSS styles for the 404 page, including responsive design and dark mode support. ```css *, *::before, *::after { box-sizing: border-box; } * { margin: 0; } html { font-size: 16px; } body { background: #FFF; color: #261B23; display: grid; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: clamp(1rem, 2.5vw, 2rem); -webkit-font-smoothing: antialiased; font-style: normal; font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; min-height: 100dvh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } #error-description { fill: #d30001; } #error-id { fill: #f0eff0; } @media (prefers-color-scheme: dark) { body { background: #101010; color: #e0e0e0; } #error-description { fill: #FF6161; } #error-id { fill: #2c2c2c; } } a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.0925em; } b, strong { font-weight: 700; } i, em { font-style: italic; } main { display: grid; gap: 1em; padding: 2em; place-items: center; text-align: center; } main header { width: min(100%, 12em); } main header svg { height: auto; max-width: 100%; width: 100%; } main article { width: min(100%, 30em); } main article p { font-size: 75%; } main article br { display: none; @media(min-width: 48em) { display: inline; } } ``` -------------------------------- ### 404.html Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_8.0/public/404.html The HTML content for a 404 Not Found page. ```html The page you were looking for doesn’t exist (404 Not found)
The page you were looking for doesn’t exist (404 Not found)
``` -------------------------------- ### Loading settings from AWS Secrets Manager Source: https://github.com/rubyconfig/config/blob/master/README.md Code to fetch secrets from AWS Secrets Manager, parse the plaintext as JSON, and load them into the config. ```ruby # fetch secrets from AWS client = Aws::SecretsManager::Client.new response = client.get_secret_value(secret_id: "#{ENV['ENVIRONMENT']}/my_application") secrets = JSON.parse(response.secret_string) # load secrets into config secret_source = Config::Sources::EnvSource.new(secrets) Settings.add_source!(secret_source) Settings.reload! ``` -------------------------------- ### CSS for 422 Error Page Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_8.0/public/422.html The CSS styles applied to the 422 error page, including resets, body styling, and layout for main content. ```css *, *::before, *::after { box-sizing: border-box; } * { margin: 0; } html { font-size: 16px; } body { background: #FFF; color: #261B23; display: grid; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: clamp(1rem, 2.5vw, 2rem); -webkit-font-smoothing: antialiased; font-style: normal; font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; min-height: 100vh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.0925em; } b, strong { font-weight: 700; } i, em { font-style: italic; } main { display: grid; gap: 1em; padding: 2em; place-items: center; text-align: center; } main header { width: min(100%, 12em); } main header svg { height: auto; max-width: 100%; width: 100%; } main article { width: min(100%, 30em); } main article p { font-size: 75%; } main article br { display: none; } @media(min-width: 48em) { main article br { display: inline; } } ``` -------------------------------- ### HTML and CSS for 500 Error Page Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_8.0/public/500.html This code snippet provides the HTML structure and CSS styling for a basic 500 Internal Server Error page. It includes reset styles, body styling for layout and typography, and specific styling for main content, headers, and articles. It also includes a media query for line breaks. ```html 500 Internal Server Error

We’re sorry, but something went wrong (500 Internal Server Error)

If you’re the application owner check the logs for more information.

``` -------------------------------- ### CSS for Unsupported Browser Page Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_8.0/public/406-unsupported-browser.html The CSS styles used to render the 406 Not Acceptable error page, including basic resets, typography, and layout for centering content. ```css *, *::before, *::after { box-sizing: border-box; } * { margin: 0; } html { font-size: 16px; } body { background: #FFF; color: #261B23; display: grid; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: clamp(1rem, 2.5vw, 2rem); -webkit-font-smoothing: antialiased; font-style: normal; font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; min-height: 100vh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.0925em; } b, strong { font-weight: 700; } i, em { font-style: italic; } main { display: grid; gap: 1em; padding: 2em; place-items: center; text-align: center; } main header { width: min(100%, 12em); } main header svg { height: auto; max-width: 100%; width: 100%; } main article { width: min(100%, 30em); } main article p { font-size: 75%; } main article br { display: none; @media(min-width: 48em) { display: inline; } } ``` -------------------------------- ### CSS for 422 Error Page Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_8.1/public/422.html The CSS styles applied to the 422 error page, including responsive design, color schemes for light and dark modes, and typography. ```css *, *::before, *::after { box-sizing: border-box; } * { margin: 0; } html { font-size: 16px; } body { background: #FFF; color: #261B23; display: grid; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: clamp(1rem, 2.5vw, 2rem); -webkit-font-smoothing: antialiased; font-style: normal; font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; min-height: 100dvh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } #error-description { fill: #d30001; } #error-id { fill: #f0eff0; } @media (prefers-color-scheme: dark) { body { background: #101010; color: #e0e0e0; } #error-description { fill: #FF6161; } #error-id { fill: #2c2c2c; } } a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.0925em; } b, strong { font-weight: 700; } i, em { font-style: italic; } main { display: grid; gap: 1em; padding: 2em; place-items: center; text-align: center; } main header { width: min(100%, 12em); } main header svg { height: auto; max-width: 100%; width: 100%; } main article { width: min(100%, 30em); } main article p { font-size: 75%; } main article br { display: none; @media(min-width: 48em) { display: inline; } } ``` -------------------------------- ### CSS for 400 Bad Request Page Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_8.0/public/400.html This CSS styles the 400 Bad Request error page, including basic resets, font styles, layout, and responsive design elements. ```css *, *::before, *::after { box-sizing: border-box; } *, * { margin: 0; } html { font-size: 16px; } body { background: #FFF; color: #261B23; display: grid; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: clamp(1rem, 2.5vw, 2rem); -webkit-font-smoothing: antialiased; font-style: normal; font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; min-height: 100vh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.0925em; } b, strong { font-weight: 700; } i, em { font-style: italic; } main { display: grid; gap: 1em; padding: 2em; place-items: center; text-align: center; } main header { width: min(100%, 12em); } main header svg { height: auto; max-width: 100%; width: 100%; } main article { width: min(100%, 30em); } main article p { font-size: 75%; } main article br { display: none; } @media(min-width: 48em) { main article br { display: inline; } } ``` -------------------------------- ### CSS for 400 Bad Request Page Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_8.1/public/400.html The CSS styles applied to the 400 Bad Request error page, including responsive design and color scheme adjustments for dark mode. ```css *, *::before, *::after { box-sizing: border-box; } * { margin: 0; } html { font-size: 16px; } body { background: #FFF; color: #261B23; display: grid; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: clamp(1rem, 2.5vw, 2rem); -webkit-font-smoothing: antialiased; font-style: normal; font-weight: 400; letter-spacing: -0.0025em; line-height: 1.4; min-height: 100dvh; place-items: center; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; } #error-description { fill: #d30001; } #error-id { fill: #f0eff0; } @media (prefers-color-scheme: dark) { body { background: #101010; color: #e0e0e0; } #error-description { fill: #FF6161; } #error-id { fill: #2c2c2c; } } a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.0925em; } b, strong { font-weight: 700; } i, em { font-style: italic; } main { display: grid; gap: 1em; padding: 2em; place-items: center; text-align: center; } main header { width: min(100%, 12em); } main header svg { height: auto; max-width: 100%; width: 100%; } main article { width: min(100%, 30em); } main article p { font-size: 75%; } main article br { display: none; @media(min-width: 48em) { display: inline; } } ``` -------------------------------- ### Rails Default Error Page CSS Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_5.2/public/500.html The CSS styles applied to the default Rails 500 error page. ```css .rails-default-error-page { background-color: #EFEFEF; color: #2E2F30; text-align: center; font-family: arial, sans-serif; margin: 0; } .rails-default-error-page div.dialog { width: 95%; max-width: 33em; margin: 4em auto 0; } .rails-default-error-page div.dialog > div { border: 1px solid #CCC; border-right-color: #999; border-left-color: #999; border-bottom-color: #BBB; border-top: #B00100 solid 4px; border-top-left-radius: 9px; border-top-right-radius: 9px; background-color: white; padding: 7px 12% 0; box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17); } .rails-default-error-page h1 { font-size: 100%; color: #730E15; line-height: 1.5em; } .rails-default-error-page div.dialog > p { margin: 0 0 1em; padding: 1em; background-color: #F7F7F7; border: 1px solid #CCC; border-right-color: #999; border-left-color: #999; border-bottom-color: #999; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-color: #DADADA; color: #666; box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17); } ``` -------------------------------- ### Default Rails 500 Error Page HTML and CSS Source: https://github.com/rubyconfig/config/blob/master/spec/app/rails_7.1/public/500.html This snippet contains the HTML structure and CSS styling for a default Rails 500 Internal Server Error page. ```html We're sorry, but something went wrong (500)

We're sorry, but something went wrong (500)

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

You're seeing this page because the application encountered an error.

``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.