simple_wallet 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +28 -0
- data/Rakefile +6 -0
- data/lib/simple_wallet/engine.rb +4 -0
- data/lib/simple_wallet/version.rb +3 -0
- data/lib/simple_wallet.rb +6 -0
- data/lib/tasks/simple_wallet_tasks.rake +4 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/stylesheets/application.css +1 -0
- data/test/dummy/app/controllers/application_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/application_record.rb +3 -0
- data/test/dummy/app/views/layouts/application.html.erb +28 -0
- data/test/dummy/app/views/pwa/manifest.json.erb +22 -0
- data/test/dummy/app/views/pwa/service-worker.js +26 -0
- data/test/dummy/bin/ci +6 -0
- data/test/dummy/bin/dev +2 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +35 -0
- data/test/dummy/config/application.rb +41 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/ci.rb +19 -0
- data/test/dummy/config/database.yml +19 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +57 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/content_security_policy.rb +29 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +8 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/locales/en.yml +31 -0
- data/test/dummy/config/puma.rb +39 -0
- data/test/dummy/config/routes.rb +14 -0
- data/test/dummy/config.ru +6 -0
- data/test/dummy/log/development.log +4 -0
- data/test/dummy/log/test.log +8 -0
- data/test/dummy/public/400.html +135 -0
- data/test/dummy/public/404.html +135 -0
- data/test/dummy/public/406-unsupported-browser.html +135 -0
- data/test/dummy/public/422.html +135 -0
- data/test/dummy/public/500.html +135 -0
- data/test/dummy/public/icon.png +0 -0
- data/test/dummy/public/icon.svg +3 -0
- data/test/dummy/tmp/local_secret.txt +1 -0
- data/test/integration/navigation_test.rb +7 -0
- data/test/simple_wallet_test.rb +7 -0
- data/test/test_helper.rb +14 -0
- metadata +150 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2c3400c19f3e0b718cc3af58b3bacb0ecb45e6c2749a454ff0d4482648533370
|
|
4
|
+
data.tar.gz: da498f98223ef9dc2d3f32ff4f43937163c5fd06cf40d33d0b59416d2f82761e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 360e49d1e3b7896c4d2694b9dab53d54c8d39f4a73f48445d33f190807e8b4ccc685fba25ab595d9eed74c3760b81e72b50b4ead1f7d82cf2a1b2d078d9dce2c
|
|
7
|
+
data.tar.gz: 88c4b352059950f58ab5cf5a4061e4a868dae88210fc3ae2d497701349392bdc3c6e6878d4df233ce473281b438409974c2317d56c797be472133addd062845c
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Marcin Urbański
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# SimpleWallet
|
|
2
|
+
Short description and motivation.
|
|
3
|
+
|
|
4
|
+
## Usage
|
|
5
|
+
How to use my plugin.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
Add this line to your application's Gemfile:
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
gem "simple_wallet"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
And then execute:
|
|
15
|
+
```bash
|
|
16
|
+
$ bundle
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or install it yourself as:
|
|
20
|
+
```bash
|
|
21
|
+
$ gem install simple_wallet
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Contributing
|
|
25
|
+
Contribution directions go here.
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/test/dummy/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Application styles */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title><%= content_for(:title) || "Dummy" %></title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
7
|
+
<meta name="application-name" content="Dummy">
|
|
8
|
+
<meta name="mobile-web-app-capable" content="yes">
|
|
9
|
+
<%= csrf_meta_tags %>
|
|
10
|
+
<%= csp_meta_tag %>
|
|
11
|
+
|
|
12
|
+
<%= yield :head %>
|
|
13
|
+
|
|
14
|
+
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
|
|
15
|
+
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
|
|
16
|
+
|
|
17
|
+
<link rel="icon" href="/icon.png" type="image/png">
|
|
18
|
+
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
|
19
|
+
<link rel="apple-touch-icon" href="/icon.png">
|
|
20
|
+
|
|
21
|
+
<%# Includes all stylesheet files in app/assets/stylesheets %>
|
|
22
|
+
<%= stylesheet_link_tag "application" %>
|
|
23
|
+
</head>
|
|
24
|
+
|
|
25
|
+
<body>
|
|
26
|
+
<%= yield %>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Dummy",
|
|
3
|
+
"icons": [
|
|
4
|
+
{
|
|
5
|
+
"src": "/icon.png",
|
|
6
|
+
"type": "image/png",
|
|
7
|
+
"sizes": "512x512"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"src": "/icon.png",
|
|
11
|
+
"type": "image/png",
|
|
12
|
+
"sizes": "512x512",
|
|
13
|
+
"purpose": "maskable"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"start_url": "/",
|
|
17
|
+
"display": "standalone",
|
|
18
|
+
"scope": "/",
|
|
19
|
+
"description": "Dummy.",
|
|
20
|
+
"theme_color": "red",
|
|
21
|
+
"background_color": "red"
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Add a service worker for processing Web Push notifications:
|
|
2
|
+
//
|
|
3
|
+
// self.addEventListener("push", async (event) => {
|
|
4
|
+
// const { title, options } = await event.data.json()
|
|
5
|
+
// event.waitUntil(self.registration.showNotification(title, options))
|
|
6
|
+
// })
|
|
7
|
+
//
|
|
8
|
+
// self.addEventListener("notificationclick", function(event) {
|
|
9
|
+
// event.notification.close()
|
|
10
|
+
// event.waitUntil(
|
|
11
|
+
// clients.matchAll({ type: "window" }).then((clientList) => {
|
|
12
|
+
// for (let i = 0; i < clientList.length; i++) {
|
|
13
|
+
// let client = clientList[i]
|
|
14
|
+
// let clientPath = (new URL(client.url)).pathname
|
|
15
|
+
//
|
|
16
|
+
// if (clientPath == event.notification.data.path && "focus" in client) {
|
|
17
|
+
// return client.focus()
|
|
18
|
+
// }
|
|
19
|
+
// }
|
|
20
|
+
//
|
|
21
|
+
// if (clients.openWindow) {
|
|
22
|
+
// return clients.openWindow(event.notification.data.path)
|
|
23
|
+
// }
|
|
24
|
+
// })
|
|
25
|
+
// )
|
|
26
|
+
// })
|
data/test/dummy/bin/ci
ADDED
data/test/dummy/bin/dev
ADDED
data/test/dummy/bin/rake
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require "fileutils"
|
|
3
|
+
|
|
4
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
|
5
|
+
|
|
6
|
+
def system!(*args)
|
|
7
|
+
system(*args, exception: true)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
FileUtils.chdir APP_ROOT do
|
|
11
|
+
# This script is a way to set up or update your development environment automatically.
|
|
12
|
+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
|
13
|
+
# Add necessary setup steps to this file.
|
|
14
|
+
|
|
15
|
+
puts "== Installing dependencies =="
|
|
16
|
+
system("bundle check") || system!("bundle install")
|
|
17
|
+
|
|
18
|
+
# puts "\n== Copying sample files =="
|
|
19
|
+
# unless File.exist?("config/database.yml")
|
|
20
|
+
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
|
|
21
|
+
# end
|
|
22
|
+
|
|
23
|
+
puts "\n== Preparing database =="
|
|
24
|
+
system! "bin/rails db:prepare"
|
|
25
|
+
system! "bin/rails db:reset" if ARGV.include?("--reset")
|
|
26
|
+
|
|
27
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
28
|
+
system! "bin/rails log:clear tmp:clear"
|
|
29
|
+
|
|
30
|
+
unless ARGV.include?("--skip-server")
|
|
31
|
+
puts "\n== Starting development server =="
|
|
32
|
+
STDOUT.flush # flush the output before exec(2) so that it displays
|
|
33
|
+
exec "bin/dev"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require_relative "boot"
|
|
2
|
+
|
|
3
|
+
require "rails"
|
|
4
|
+
# Pick the frameworks you want:
|
|
5
|
+
require "active_model/railtie"
|
|
6
|
+
# require "active_job/railtie"
|
|
7
|
+
require "active_record/railtie"
|
|
8
|
+
# require "active_storage/engine"
|
|
9
|
+
require "action_controller/railtie"
|
|
10
|
+
# require "action_mailer/railtie"
|
|
11
|
+
# require "action_mailbox/engine"
|
|
12
|
+
# require "action_text/engine"
|
|
13
|
+
require "action_view/railtie"
|
|
14
|
+
require "action_cable/engine"
|
|
15
|
+
require "rails/test_unit/railtie"
|
|
16
|
+
|
|
17
|
+
# Require the gems listed in Gemfile, including any gems
|
|
18
|
+
# you've limited to :test, :development, or :production.
|
|
19
|
+
Bundler.require(*Rails.groups)
|
|
20
|
+
|
|
21
|
+
module Dummy
|
|
22
|
+
class Application < Rails::Application
|
|
23
|
+
config.load_defaults Rails::VERSION::STRING.to_f
|
|
24
|
+
|
|
25
|
+
# For compatibility with applications that use this config
|
|
26
|
+
config.action_controller.include_all_helpers = false
|
|
27
|
+
|
|
28
|
+
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
|
29
|
+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
|
30
|
+
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
|
31
|
+
config.autoload_lib(ignore: %w[assets tasks])
|
|
32
|
+
|
|
33
|
+
# Configuration for the application, engines, and railties goes here.
|
|
34
|
+
#
|
|
35
|
+
# These settings can be overridden in specific environments using the files
|
|
36
|
+
# in config/environments, which are processed later.
|
|
37
|
+
#
|
|
38
|
+
# config.time_zone = "Central Time (US & Canada)"
|
|
39
|
+
# config.eager_load_paths << Rails.root.join("extras")
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Run using bin/ci
|
|
2
|
+
|
|
3
|
+
CI.run do
|
|
4
|
+
step "Setup", "bin/setup --skip-server"
|
|
5
|
+
|
|
6
|
+
step "Tests: Rails", "bin/rails test"
|
|
7
|
+
step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
|
|
8
|
+
|
|
9
|
+
# Optional: Run system tests
|
|
10
|
+
# step "Tests: System", "bin/rails test:system"
|
|
11
|
+
|
|
12
|
+
# Optional: set a green GitHub commit status to unblock PR merge.
|
|
13
|
+
# Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
|
|
14
|
+
# if success?
|
|
15
|
+
# step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff"
|
|
16
|
+
# else
|
|
17
|
+
# failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again."
|
|
18
|
+
# end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
default: &default
|
|
2
|
+
adapter: postgresql
|
|
3
|
+
encoding: unicode
|
|
4
|
+
max_connections: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
|
5
|
+
host: <%= ENV["DB_HOST"] %>
|
|
6
|
+
username: <%= ENV["DB_USERNAME"] %>
|
|
7
|
+
password: <%= ENV["DB_PASSWORD"] %>
|
|
8
|
+
|
|
9
|
+
development:
|
|
10
|
+
<<: *default
|
|
11
|
+
database: <%= ENV["DB_BASENAME"] %>_development
|
|
12
|
+
|
|
13
|
+
test:
|
|
14
|
+
<<: *default
|
|
15
|
+
database: <%= ENV["DB_BASENAME"] %>_test
|
|
16
|
+
|
|
17
|
+
production:
|
|
18
|
+
<<: *default
|
|
19
|
+
database: <%= ENV["DB_BASENAME"] %>_production
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
# Make code changes take effect immediately without server restart.
|
|
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 Action Controller caching. By default Action Controller caching is disabled.
|
|
19
|
+
# Run rails dev:cache to toggle Action Controller 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
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
|
|
24
|
+
else
|
|
25
|
+
config.action_controller.perform_caching = false
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Change to :null_store to avoid any caching.
|
|
29
|
+
config.cache_store = :memory_store
|
|
30
|
+
|
|
31
|
+
# Print deprecation notices to the Rails logger.
|
|
32
|
+
config.active_support.deprecation = :log
|
|
33
|
+
|
|
34
|
+
# Raise an error on page load if there are pending migrations.
|
|
35
|
+
config.active_record.migration_error = :page_load
|
|
36
|
+
|
|
37
|
+
# Highlight code that triggered database queries in logs.
|
|
38
|
+
config.active_record.verbose_query_logs = true
|
|
39
|
+
|
|
40
|
+
# Append comments with runtime information tags to SQL queries in logs.
|
|
41
|
+
config.active_record.query_log_tags_enabled = true
|
|
42
|
+
|
|
43
|
+
# Highlight code that triggered redirect in logs.
|
|
44
|
+
config.action_dispatch.verbose_redirect_logs = true
|
|
45
|
+
|
|
46
|
+
# Raises error for missing translations.
|
|
47
|
+
# config.i18n.raise_on_missing_translations = true
|
|
48
|
+
|
|
49
|
+
# Annotate rendered view with file names.
|
|
50
|
+
config.action_view.annotate_rendered_view_with_filenames = true
|
|
51
|
+
|
|
52
|
+
# Uncomment if you wish to allow Action Cable access from any origin.
|
|
53
|
+
# config.action_cable.disable_request_forgery_protection = 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
|
|
@@ -0,0 +1,67 @@
|
|
|
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.enable_reloading = false
|
|
8
|
+
|
|
9
|
+
# Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
|
|
10
|
+
config.eager_load = true
|
|
11
|
+
|
|
12
|
+
# Full error reports are disabled.
|
|
13
|
+
config.consider_all_requests_local = false
|
|
14
|
+
|
|
15
|
+
# Turn on fragment caching in view templates.
|
|
16
|
+
config.action_controller.perform_caching = true
|
|
17
|
+
|
|
18
|
+
# Cache assets for far-future expiry since they are all digest stamped.
|
|
19
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
|
|
20
|
+
|
|
21
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
22
|
+
# config.asset_host = "http://assets.example.com"
|
|
23
|
+
|
|
24
|
+
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
|
25
|
+
config.assume_ssl = true
|
|
26
|
+
|
|
27
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
28
|
+
config.force_ssl = true
|
|
29
|
+
|
|
30
|
+
# Skip http-to-https redirect for the default health check endpoint.
|
|
31
|
+
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
|
32
|
+
|
|
33
|
+
# Log to STDOUT with the current request id as a default log tag.
|
|
34
|
+
config.log_tags = [ :request_id ]
|
|
35
|
+
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
|
|
36
|
+
|
|
37
|
+
# Change to "debug" to log everything (including potentially personally-identifiable information!).
|
|
38
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
|
39
|
+
|
|
40
|
+
# Prevent health checks from clogging up the logs.
|
|
41
|
+
config.silence_healthcheck_path = "/up"
|
|
42
|
+
|
|
43
|
+
# Don't log any deprecations.
|
|
44
|
+
config.active_support.report_deprecations = false
|
|
45
|
+
|
|
46
|
+
# Replace the default in-process memory cache store with a durable alternative.
|
|
47
|
+
# config.cache_store = :mem_cache_store
|
|
48
|
+
|
|
49
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
50
|
+
# the I18n.default_locale when a translation cannot be found).
|
|
51
|
+
config.i18n.fallbacks = true
|
|
52
|
+
|
|
53
|
+
# Do not dump schema after migrations.
|
|
54
|
+
config.active_record.dump_schema_after_migration = false
|
|
55
|
+
|
|
56
|
+
# Only use :id for inspections in production.
|
|
57
|
+
config.active_record.attributes_for_inspect = [ :id ]
|
|
58
|
+
|
|
59
|
+
# Enable DNS rebinding protection and other `Host` header attacks.
|
|
60
|
+
# config.hosts = [
|
|
61
|
+
# "example.com", # Allow requests from example.com
|
|
62
|
+
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
|
63
|
+
# ]
|
|
64
|
+
#
|
|
65
|
+
# Skip DNS rebinding protection for the default health check endpoint.
|
|
66
|
+
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
|
67
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# The test environment is used exclusively to run your application's
|
|
2
|
+
# test suite. You never need to work with it otherwise. Remember that
|
|
3
|
+
# your test database is "scratch space" for the test suite and is wiped
|
|
4
|
+
# and recreated between test runs. Don't rely on the data there!
|
|
5
|
+
|
|
6
|
+
Rails.application.configure do
|
|
7
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
8
|
+
|
|
9
|
+
# While tests run files are not watched, reloading is not necessary.
|
|
10
|
+
config.enable_reloading = false
|
|
11
|
+
|
|
12
|
+
# Eager loading loads your entire application. When running a single test locally,
|
|
13
|
+
# this is usually not necessary, and can slow down your test suite. However, it's
|
|
14
|
+
# recommended that you enable it in continuous integration systems to ensure eager
|
|
15
|
+
# loading is working properly before deploying your code.
|
|
16
|
+
config.eager_load = ENV["CI"].present?
|
|
17
|
+
|
|
18
|
+
# Configure public file server for tests with cache-control for performance.
|
|
19
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
|
|
20
|
+
|
|
21
|
+
# Show full error reports.
|
|
22
|
+
config.consider_all_requests_local = true
|
|
23
|
+
config.cache_store = :null_store
|
|
24
|
+
|
|
25
|
+
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
|
26
|
+
config.action_dispatch.show_exceptions = :rescuable
|
|
27
|
+
|
|
28
|
+
# Disable request forgery protection in test environment.
|
|
29
|
+
config.action_controller.allow_forgery_protection = false
|
|
30
|
+
|
|
31
|
+
# Print deprecation notices to the stderr.
|
|
32
|
+
config.active_support.deprecation = :stderr
|
|
33
|
+
|
|
34
|
+
# Raises error for missing translations.
|
|
35
|
+
# config.i18n.raise_on_missing_translations = true
|
|
36
|
+
|
|
37
|
+
# Annotate rendered view with file names.
|
|
38
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
|
39
|
+
|
|
40
|
+
# Raise error when a before_action's only/except options reference missing actions.
|
|
41
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
|
42
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
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, inline scripts, and inline styles.
|
|
20
|
+
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
|
21
|
+
# config.content_security_policy_nonce_directives = %w(script-src style-src)
|
|
22
|
+
#
|
|
23
|
+
# # Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag`
|
|
24
|
+
# # if the corresponding directives are specified in `content_security_policy_nonce_directives`.
|
|
25
|
+
# # config.content_security_policy_nonce_auto = true
|
|
26
|
+
#
|
|
27
|
+
# # Report violations without enforcing the policy.
|
|
28
|
+
# # config.content_security_policy_report_only = true
|
|
29
|
+
# end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
|
|
4
|
+
# Use this to limit dissemination of sensitive information.
|
|
5
|
+
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
|
6
|
+
Rails.application.config.filter_parameters += [
|
|
7
|
+
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
|
|
8
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Files in the config/locales directory are used for internationalization and
|
|
2
|
+
# are automatically loaded by Rails. If you want to use locales other than
|
|
3
|
+
# 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
|
+
# To learn more about the API, please read the Rails Internationalization guide
|
|
20
|
+
# at https://guides.rubyonrails.org/i18n.html.
|
|
21
|
+
#
|
|
22
|
+
# Be aware that YAML interprets the following case-insensitive strings as
|
|
23
|
+
# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
|
|
24
|
+
# must be quoted to be interpreted as strings. For example:
|
|
25
|
+
#
|
|
26
|
+
# en:
|
|
27
|
+
# "yes": yup
|
|
28
|
+
# enabled: "ON"
|
|
29
|
+
|
|
30
|
+
en:
|
|
31
|
+
hello: "Hello world"
|