featurehub-sdk 1.2.2 → 1.3.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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -2
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG.md +9 -0
  5. data/Gemfile +3 -3
  6. data/Gemfile.lock +124 -63
  7. data/LICENSE +21 -0
  8. data/README.md +235 -0
  9. data/examples/rails_example/.env.example +13 -0
  10. data/examples/rails_example/.gitattributes +7 -0
  11. data/examples/rails_example/.gitignore +103 -0
  12. data/examples/rails_example/.ruby-version +1 -0
  13. data/examples/rails_example/Dockerfile +12 -0
  14. data/examples/rails_example/Gemfile +80 -0
  15. data/examples/rails_example/Gemfile.lock +283 -0
  16. data/examples/rails_example/README.md +36 -0
  17. data/examples/rails_example/Rakefile +8 -0
  18. data/examples/rails_example/app/assets/config/manifest.js +4 -0
  19. data/examples/rails_example/app/assets/images/.keep +0 -0
  20. data/examples/rails_example/app/assets/stylesheets/application.css +15 -0
  21. data/examples/rails_example/app/channels/application_cable/channel.rb +6 -0
  22. data/examples/rails_example/app/channels/application_cable/connection.rb +6 -0
  23. data/examples/rails_example/app/controllers/application_controller.rb +4 -0
  24. data/examples/rails_example/app/controllers/concerns/.keep +0 -0
  25. data/examples/rails_example/app/controllers/home_controller.rb +12 -0
  26. data/examples/rails_example/app/helpers/application_helper.rb +4 -0
  27. data/examples/rails_example/app/helpers/home_helper.rb +4 -0
  28. data/examples/rails_example/app/javascript/application.js +3 -0
  29. data/examples/rails_example/app/javascript/controllers/application.js +9 -0
  30. data/examples/rails_example/app/javascript/controllers/hello_controller.js +7 -0
  31. data/examples/rails_example/app/javascript/controllers/index.js +11 -0
  32. data/examples/rails_example/app/jobs/application_job.rb +9 -0
  33. data/examples/rails_example/app/mailers/application_mailer.rb +6 -0
  34. data/examples/rails_example/app/models/application_record.rb +5 -0
  35. data/examples/rails_example/app/models/concerns/.keep +0 -0
  36. data/examples/rails_example/app/views/home/index.html.erb +6 -0
  37. data/examples/rails_example/app/views/layouts/application.html.erb +16 -0
  38. data/examples/rails_example/app/views/layouts/mailer.html.erb +13 -0
  39. data/examples/rails_example/app/views/layouts/mailer.text.erb +1 -0
  40. data/examples/rails_example/bin/bundle +118 -0
  41. data/examples/rails_example/bin/importmap +5 -0
  42. data/examples/rails_example/bin/rails +6 -0
  43. data/examples/rails_example/bin/rake +6 -0
  44. data/examples/rails_example/bin/setup +35 -0
  45. data/examples/rails_example/config/application.rb +24 -0
  46. data/examples/rails_example/config/boot.rb +6 -0
  47. data/examples/rails_example/config/cable.yml +10 -0
  48. data/examples/rails_example/config/credentials.yml.enc +1 -0
  49. data/examples/rails_example/config/database.yml +25 -0
  50. data/examples/rails_example/config/environment.rb +7 -0
  51. data/examples/rails_example/config/environments/development.rb +72 -0
  52. data/examples/rails_example/config/environments/production.rb +95 -0
  53. data/examples/rails_example/config/environments/test.rb +62 -0
  54. data/examples/rails_example/config/importmap.rb +9 -0
  55. data/examples/rails_example/config/initializers/assets.rb +14 -0
  56. data/examples/rails_example/config/initializers/content_security_policy.rb +27 -0
  57. data/examples/rails_example/config/initializers/featurehub.rb +8 -0
  58. data/examples/rails_example/config/initializers/filter_parameter_logging.rb +10 -0
  59. data/examples/rails_example/config/initializers/inflections.rb +18 -0
  60. data/examples/rails_example/config/initializers/permissions_policy.rb +13 -0
  61. data/examples/rails_example/config/locales/en.yml +33 -0
  62. data/examples/rails_example/config/puma.rb +57 -0
  63. data/examples/rails_example/config/routes.rb +8 -0
  64. data/examples/rails_example/config/storage.yml +34 -0
  65. data/examples/rails_example/config.ru +8 -0
  66. data/examples/rails_example/db/seeds.rb +9 -0
  67. data/examples/rails_example/lib/assets/.keep +0 -0
  68. data/examples/rails_example/lib/tasks/.keep +0 -0
  69. data/examples/rails_example/log/.keep +0 -0
  70. data/examples/rails_example/public/404.html +67 -0
  71. data/examples/rails_example/public/422.html +67 -0
  72. data/examples/rails_example/public/500.html +66 -0
  73. data/examples/rails_example/public/apple-touch-icon-precomposed.png +0 -0
  74. data/examples/rails_example/public/apple-touch-icon.png +0 -0
  75. data/examples/rails_example/public/favicon.ico +0 -0
  76. data/examples/rails_example/public/robots.txt +1 -0
  77. data/examples/rails_example/storage/.keep +0 -0
  78. data/examples/rails_example/test/application_system_test_case.rb +7 -0
  79. data/examples/rails_example/test/channels/application_cable/connection_test.rb +15 -0
  80. data/examples/rails_example/test/controllers/.keep +0 -0
  81. data/examples/rails_example/test/controllers/home_controller_test.rb +9 -0
  82. data/examples/rails_example/test/fixtures/files/.keep +0 -0
  83. data/examples/rails_example/test/helpers/.keep +0 -0
  84. data/examples/rails_example/test/integration/.keep +0 -0
  85. data/examples/rails_example/test/mailers/.keep +0 -0
  86. data/examples/rails_example/test/models/.keep +0 -0
  87. data/examples/rails_example/test/system/.keep +0 -0
  88. data/examples/rails_example/test/test_helper.rb +17 -0
  89. data/examples/rails_example/tmp/.keep +0 -0
  90. data/examples/rails_example/tmp/pids/.keep +0 -0
  91. data/examples/rails_example/tmp/storage/.keep +0 -0
  92. data/examples/rails_example/vendor/.keep +0 -0
  93. data/examples/rails_example/vendor/javascript/.keep +0 -0
  94. data/examples/sinatra/.gitignore +3 -0
  95. data/examples/sinatra/.ruby-version +1 -0
  96. data/examples/sinatra/Dockerfile +42 -0
  97. data/examples/sinatra/Gemfile +16 -0
  98. data/examples/sinatra/Gemfile.lock +86 -0
  99. data/examples/sinatra/README.adoc +10 -0
  100. data/examples/sinatra/app/application.rb +141 -0
  101. data/examples/sinatra/build.sh +2 -0
  102. data/examples/sinatra/conf/nginx.conf +57 -0
  103. data/examples/sinatra/conf/nsswitch.conf +21 -0
  104. data/examples/sinatra/config.ru +17 -0
  105. data/examples/sinatra/docker_start.sh +3 -0
  106. data/examples/sinatra/sinatra.iml +22 -0
  107. data/examples/sinatra/start.sh +3 -0
  108. data/examples/sinatra/thin.ru +9 -0
  109. data/featurehub-ruby-sdk.iml +9 -0
  110. data/featurehub-sdk.gemspec +42 -0
  111. data/lib/feature_hub/sdk/feature_hub_config.rb +0 -2
  112. data/lib/feature_hub/sdk/feature_repository.rb +1 -1
  113. data/lib/feature_hub/sdk/impl/rollout_holders.rb +3 -3
  114. data/lib/feature_hub/sdk/streaming_edge_service.rb +1 -1
  115. data/lib/feature_hub/sdk/version.rb +1 -1
  116. metadata +114 -13
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>RailsExample</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
10
+ <%= javascript_importmap_tags %>
11
+ </head>
12
+
13
+ <body>
14
+ <%= yield %>
15
+ </body>
16
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "rubygems"
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV.fetch("BUNDLER_VERSION", nil)
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27
+
28
+ bundler_version = nil
29
+ update_index = nil
30
+ ARGV.each_with_index do |a, i|
31
+ bundler_version = a if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
32
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
33
+
34
+ bundler_version = Regexp.last_match(1)
35
+ update_index = i
36
+ end
37
+ bundler_version
38
+ end
39
+
40
+ def gemfile
41
+ gemfile = ENV.fetch("BUNDLE_GEMFILE", nil)
42
+ return gemfile if gemfile && !gemfile.empty?
43
+
44
+ File.expand_path("../Gemfile", __dir__)
45
+ end
46
+
47
+ def lockfile
48
+ lockfile =
49
+ case File.basename(gemfile)
50
+ when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
51
+ else "#{gemfile}.lock"
52
+ end
53
+ File.expand_path(lockfile)
54
+ end
55
+
56
+ def lockfile_version
57
+ return unless File.file?(lockfile)
58
+
59
+ lockfile_contents = File.read(lockfile)
60
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
61
+
62
+ Regexp.last_match(1)
63
+ end
64
+
65
+ def bundler_requirement
66
+ @bundler_requirement ||=
67
+ env_var_version || cli_arg_version ||
68
+ bundler_requirement_for(lockfile_version)
69
+ end
70
+
71
+ def bundler_requirement_for(version)
72
+ return "#{Gem::Requirement.default}.a" unless version
73
+
74
+ bundler_gem_version = Gem::Version.new(version)
75
+
76
+ requirement = bundler_gem_version.approximate_recommendation
77
+
78
+ return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0")
79
+
80
+ requirement += ".a" if bundler_gem_version.prerelease?
81
+
82
+ requirement
83
+ end
84
+
85
+ def load_bundler!
86
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
87
+
88
+ activate_bundler
89
+ end
90
+
91
+ def activate_bundler
92
+ gem_error = activation_error_handling do
93
+ gem "bundler", bundler_requirement
94
+ end
95
+ return if gem_error.nil?
96
+
97
+ require_error = activation_error_handling do
98
+ require "bundler/version"
99
+ end
100
+ if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
101
+ return
102
+ end
103
+
104
+ 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}'`" # rubocop:disable Layout/LineLength
105
+ exit 42
106
+ end
107
+
108
+ def activation_error_handling
109
+ yield
110
+ nil
111
+ rescue StandardError, LoadError => e
112
+ e
113
+ end
114
+ end
115
+
116
+ m.load_bundler!
117
+
118
+ load Gem.bin_path("bundler", "bundle") if m.invoked_as_script?
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative "../config/application"
5
+ require "importmap/commands"
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ APP_PATH = File.expand_path("../config/application", __dir__)
5
+ require_relative "../config/boot"
6
+ require "rails/commands"
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative "../config/boot"
5
+ require "rake"
6
+ Rake.application.run
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "fileutils"
5
+
6
+ # path to your application root.
7
+ APP_ROOT = File.expand_path("..", __dir__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ FileUtils.chdir APP_ROOT do
14
+ # This script is a way to set up or update your development environment automatically.
15
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
16
+ # Add necessary setup steps to this file.
17
+
18
+ puts "== Installing dependencies =="
19
+ system! "gem install bundler --conservative"
20
+ system("bundle check") || system!("bundle install")
21
+
22
+ # puts "\n== Copying sample files =="
23
+ # unless File.exist?("config/database.yml")
24
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
25
+ # end
26
+
27
+ puts "\n== Preparing database =="
28
+ system! "bin/rails db:prepare"
29
+
30
+ puts "\n== Removing old logs and tempfiles =="
31
+ system! "bin/rails log:clear tmp:clear"
32
+
33
+ puts "\n== Restarting application server =="
34
+ system! "bin/rails restart"
35
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "boot"
4
+
5
+ require "rails/all"
6
+
7
+ # Require the gems listed in Gemfile, including any gems
8
+ # you've limited to :test, :development, or :production.
9
+ Bundler.require(*Rails.groups)
10
+
11
+ module RailsExample
12
+ class Application < Rails::Application
13
+ # Initialize configuration defaults for originally generated Rails version.
14
+ config.load_defaults 7.0
15
+
16
+ # Configuration for the application, engines, and railties goes here.
17
+ #
18
+ # These settings can be overridden in specific environments using the files
19
+ # in config/environments, which are processed later.
20
+ #
21
+ # config.time_zone = "Central Time (US & Canada)"
22
+ # config.eager_load_paths << Rails.root.join("extras")
23
+ end
24
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
4
+
5
+ require "bundler/setup" # Set up gems listed in the Gemfile.
6
+ require "bootsnap/setup" # Speed up boot time by caching expensive operations.
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: test
6
+
7
+ production:
8
+ adapter: redis
9
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
+ channel_prefix: rails_example_production
@@ -0,0 +1 @@
1
+ Akik2iUsz3zKZuO0ObqxdkBM6H7f17tnE8/Mh07vF2qQd1wqPwFAtHoA8YlrkXsZf0g9oqfzsZZjMVGz2uvZGO2eekeCpw8h6MIYpkPxAnaUZWTGwsAg3fjZtqZMFebbH+c640HCKKschiwkw5COS6yEoOXO9ye01icdm4r8dGP0i0074o+MyF6vW0qOTWcRF/fNKCJGAq4UHndvRYuwTYcmwZvBXTPVI3KFh67s00MlFNPc5f6Gjppta1Tp1wxT6OTn/wNZPn7tliCjkg+UnpkoIxjzZQa4EvHdpe/mAVDOwApKmaE2MuoDtLgfFzqiXdiD8q0OuoQc/B8KvrDK6YnGuu0uxzAYwVcKTdYN8IXS/yX5sjFa9+xmIJ8Tnio371MjGqqbXa3Rjo7yGerml2f+mHeMvEcZgRn8--rs4v0A2BLysCFkAH--BhmXzv5R+7w8XGUs79Gmwg==
@@ -0,0 +1,25 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Load the Rails application.
4
+ require_relative "application"
5
+
6
+ # Initialize the Rails application.
7
+ Rails.application.initialize!
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/core_ext/integer/time"
4
+
5
+ Rails.application.configure do
6
+ # Settings specified here will take precedence over those in config/application.rb.
7
+
8
+ # In the development environment your application's code is reloaded any time
9
+ # it changes. This slows down response time but is perfect for development
10
+ # since you don't have to restart the web server when you make code changes.
11
+ config.cache_classes = false
12
+
13
+ # Do not eager load code on boot.
14
+ config.eager_load = false
15
+
16
+ # Show full error reports.
17
+ config.consider_all_requests_local = true
18
+
19
+ # Enable server timing
20
+ config.server_timing = true
21
+
22
+ # Enable/disable caching. By default caching is disabled.
23
+ # Run rails dev:cache to toggle caching.
24
+ if Rails.root.join("tmp/caching-dev.txt").exist?
25
+ config.action_controller.perform_caching = true
26
+ config.action_controller.enable_fragment_cache_logging = true
27
+
28
+ config.cache_store = :memory_store
29
+ config.public_file_server.headers = {
30
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
31
+ }
32
+ else
33
+ config.action_controller.perform_caching = false
34
+
35
+ config.cache_store = :null_store
36
+ end
37
+
38
+ # Store uploaded files on the local file system (see config/storage.yml for options).
39
+ config.active_storage.service = :local
40
+
41
+ # Don't care if the mailer can't send.
42
+ config.action_mailer.raise_delivery_errors = false
43
+
44
+ config.action_mailer.perform_caching = false
45
+
46
+ # Print deprecation notices to the Rails logger.
47
+ config.active_support.deprecation = :log
48
+
49
+ # Raise exceptions for disallowed deprecations.
50
+ config.active_support.disallowed_deprecation = :raise
51
+
52
+ # Tell Active Support which deprecation messages to disallow.
53
+ config.active_support.disallowed_deprecation_warnings = []
54
+
55
+ # Raise an error on page load if there are pending migrations.
56
+ config.active_record.migration_error = :page_load
57
+
58
+ # Highlight code that triggered database queries in logs.
59
+ config.active_record.verbose_query_logs = true
60
+
61
+ # Suppress logger output for asset requests.
62
+ config.assets.quiet = true
63
+
64
+ # Raises error for missing translations.
65
+ # config.i18n.raise_on_missing_translations = true
66
+
67
+ # Annotate rendered view with file names.
68
+ # config.action_view.annotate_rendered_view_with_filenames = true
69
+
70
+ # Uncomment if you wish to allow Action Cable access from any origin.
71
+ # config.action_cable.disable_request_forgery_protection = true
72
+ end
@@ -0,0 +1,95 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/core_ext/integer/time"
4
+
5
+ Rails.application.configure do
6
+ # Settings specified here will take precedence over those in config/application.rb.
7
+
8
+ # Code is not reloaded between requests.
9
+ config.cache_classes = true
10
+
11
+ # Eager load code on boot. This eager loads most of Rails and
12
+ # your application in memory, allowing both threaded web servers
13
+ # and those relying on copy on write to perform better.
14
+ # Rake tasks automatically ignore this option for performance.
15
+ config.eager_load = true
16
+
17
+ # Full error reports are disabled and caching is turned on.
18
+ config.consider_all_requests_local = false
19
+ config.action_controller.perform_caching = true
20
+
21
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
22
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
23
+ # config.require_master_key = true
24
+
25
+ # Disable serving static files from the `/public` folder by default since
26
+ # Apache or NGINX already handles this.
27
+ config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
28
+
29
+ # Compress CSS using a preprocessor.
30
+ # config.assets.css_compressor = :sass
31
+
32
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
33
+ config.assets.compile = false
34
+
35
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
36
+ # config.asset_host = "http://assets.example.com"
37
+
38
+ # Specifies the header that your server uses for sending files.
39
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
40
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
41
+
42
+ # Store uploaded files on the local file system (see config/storage.yml for options).
43
+ config.active_storage.service = :local
44
+
45
+ # Mount Action Cable outside main process or domain.
46
+ # config.action_cable.mount_path = nil
47
+ # config.action_cable.url = "wss://example.com/cable"
48
+ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
49
+
50
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
51
+ # config.force_ssl = true
52
+
53
+ # Include generic and useful information about system operation, but avoid logging too much
54
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
55
+ config.log_level = :info
56
+
57
+ # Prepend all log lines with the following tags.
58
+ config.log_tags = [:request_id]
59
+
60
+ # Use a different cache store in production.
61
+ # config.cache_store = :mem_cache_store
62
+
63
+ # Use a real queuing backend for Active Job (and separate queues per environment).
64
+ # config.active_job.queue_adapter = :resque
65
+ # config.active_job.queue_name_prefix = "rails_example_production"
66
+
67
+ config.action_mailer.perform_caching = false
68
+
69
+ # Ignore bad email addresses and do not raise email delivery errors.
70
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
71
+ # config.action_mailer.raise_delivery_errors = false
72
+
73
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
74
+ # the I18n.default_locale when a translation cannot be found).
75
+ config.i18n.fallbacks = true
76
+
77
+ # Don't log any deprecations.
78
+ config.active_support.report_deprecations = false
79
+
80
+ # Use default logging formatter so that PID and timestamp are not suppressed.
81
+ config.log_formatter = ::Logger::Formatter.new
82
+
83
+ # Use a different logger for distributed setups.
84
+ # require "syslog/logger"
85
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
86
+
87
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
88
+ logger = ActiveSupport::Logger.new($stdout)
89
+ logger.formatter = config.log_formatter
90
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
91
+ end
92
+
93
+ # Do not dump schema after migrations.
94
+ config.active_record.dump_schema_after_migration = false
95
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/core_ext/integer/time"
4
+
5
+ # The test environment is used exclusively to run your application's
6
+ # test suite. You never need to work with it otherwise. Remember that
7
+ # your test database is "scratch space" for the test suite and is wiped
8
+ # and recreated between test runs. Don't rely on the data there!
9
+
10
+ Rails.application.configure do
11
+ # Settings specified here will take precedence over those in config/application.rb.
12
+
13
+ # Turn false under Spring and add config.action_view.cache_template_loading = true.
14
+ config.cache_classes = true
15
+
16
+ # Eager loading loads your whole application. When running a single test locally,
17
+ # this probably isn't necessary. It's a good idea to do in a continuous integration
18
+ # system, or in some way before deploying your code.
19
+ config.eager_load = ENV["CI"].present?
20
+
21
+ # Configure public file server for tests with Cache-Control for performance.
22
+ config.public_file_server.enabled = true
23
+ config.public_file_server.headers = {
24
+ "Cache-Control" => "public, max-age=#{1.hour.to_i}"
25
+ }
26
+
27
+ # Show full error reports and disable caching.
28
+ config.consider_all_requests_local = true
29
+ config.action_controller.perform_caching = false
30
+ config.cache_store = :null_store
31
+
32
+ # Raise exceptions instead of rendering exception templates.
33
+ config.action_dispatch.show_exceptions = false
34
+
35
+ # Disable request forgery protection in test environment.
36
+ config.action_controller.allow_forgery_protection = false
37
+
38
+ # Store uploaded files on the local file system in a temporary directory.
39
+ config.active_storage.service = :test
40
+
41
+ config.action_mailer.perform_caching = false
42
+
43
+ # Tell Action Mailer not to deliver emails to the real world.
44
+ # The :test delivery method accumulates sent emails in the
45
+ # ActionMailer::Base.deliveries array.
46
+ config.action_mailer.delivery_method = :test
47
+
48
+ # Print deprecation notices to the stderr.
49
+ config.active_support.deprecation = :stderr
50
+
51
+ # Raise exceptions for disallowed deprecations.
52
+ config.active_support.disallowed_deprecation = :raise
53
+
54
+ # Tell Active Support which deprecation messages to disallow.
55
+ config.active_support.disallowed_deprecation_warnings = []
56
+
57
+ # Raises error for missing translations.
58
+ # config.i18n.raise_on_missing_translations = true
59
+
60
+ # Annotate rendered view with file names.
61
+ # config.action_view.annotate_rendered_view_with_filenames = true
62
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Pin npm packages by running ./bin/importmap
4
+
5
+ pin "application", preload: true
6
+ pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
7
+ pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
8
+ pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
9
+ pin_all_from "app/javascript/controllers", under: "controllers"
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Version of your assets, change this if you want to expire all your assets.
6
+ Rails.application.config.assets.version = "1.0"
7
+
8
+ # Add additional assets to the asset load path.
9
+ # Rails.application.config.assets.paths << Emoji.images_path
10
+
11
+ # Precompile additional assets.
12
+ # application.js, application.css, and all non-JS/CSS in the app/assets
13
+ # folder are already added.
14
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Define an application-wide content security policy.
6
+ # See the Securing Rails Applications Guide for more information:
7
+ # https://guides.rubyonrails.org/security.html#content-security-policy-header
8
+
9
+ # Rails.application.configure do
10
+ # config.content_security_policy do |policy|
11
+ # policy.default_src :self, :https
12
+ # policy.font_src :self, :https, :data
13
+ # policy.img_src :self, :https, :data
14
+ # policy.object_src :none
15
+ # policy.script_src :self, :https
16
+ # policy.style_src :self, :https
17
+ # # Specify URI for violation reports
18
+ # # policy.report_uri "/csp-violation-report-endpoint"
19
+ # end
20
+ #
21
+ # # Generate session nonces for permitted importmap and inline scripts
22
+ # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
23
+ # config.content_security_policy_nonce_directives = %w(script-src)
24
+ #
25
+ # # Report violations without enforcing the policy.
26
+ # # config.content_security_policy_report_only = true
27
+ # end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # configure FeatureHub. Mostly taken from the rails portion of this doc:
4
+ # https://github.com/featurehub-io/featurehub-ruby-sdk/tree/main#2-create-featurehub-config
5
+ Rails.configuration.fh_config = FeatureHub::Sdk::FeatureHubConfig.new(
6
+ ENV.fetch("FEATUREHUB_EDGE_URL"),
7
+ [ENV.fetch("FEATUREHUB_CLIENT_API_KEY")]
8
+ ).init
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Configure parameters to be filtered from the log file. Use this to limit dissemination of
6
+ # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
7
+ # notations and behaviors.
8
+ Rails.application.config.filter_parameters += %i[
9
+ passw secret token _key crypt salt certificate otp ssn
10
+ ]
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add new inflection rules using the following format. Inflections
6
+ # are locale specific, and you may define rules for as many different
7
+ # locales as you wish. All of these examples are active by default:
8
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
9
+ # inflect.plural /^(ox)$/i, "\\1en"
10
+ # inflect.singular /^(ox)en/i, "\\1"
11
+ # inflect.irregular "person", "people"
12
+ # inflect.uncountable %w( fish sheep )
13
+ # end
14
+
15
+ # These inflection rules are supported but not enabled by default:
16
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
17
+ # inflect.acronym "RESTful"
18
+ # end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Define an application-wide HTTP permissions policy. For further
4
+ # information see https://developers.google.com/web/updates/2018/06/feature-policy
5
+ #
6
+ # Rails.application.config.permissions_policy do |f|
7
+ # f.camera :none
8
+ # f.gyroscope :none
9
+ # f.microphone :none
10
+ # f.usb :none
11
+ # f.fullscreen :self
12
+ # f.payment :self, "https://secure.example.com"
13
+ # end
@@ -0,0 +1,33 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t "hello"
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t("hello") %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # "true": "foo"
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at https://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"