optics_view_components 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/Gemfile +4 -2
  4. data/Gemfile.lock +186 -0
  5. data/app/components/optics/application_view_component.rb +113 -0
  6. data/app/components/optics/application_view_component_preview.rb +5 -0
  7. data/app/components/optics/button/component.rb +55 -0
  8. data/app/components/optics/button/preview.rb +34 -0
  9. data/app/components/optics/icon/component.rb +59 -0
  10. data/app/components/optics/icon/preview.rb +31 -0
  11. data/demo/.ruby-version +1 -0
  12. data/demo/Gemfile +21 -0
  13. data/demo/Gemfile.lock +198 -0
  14. data/demo/Procfile.dev +2 -0
  15. data/demo/README.md +24 -0
  16. data/demo/Rakefile +8 -0
  17. data/demo/app/assets/builds/.keep +0 -0
  18. data/demo/app/assets/config/manifest.js +3 -0
  19. data/demo/app/assets/images/.keep +0 -0
  20. data/demo/app/assets/stylesheets/application.sass.scss +2 -0
  21. data/demo/app/controllers/application_controller.rb +4 -0
  22. data/demo/app/controllers/concerns/.keep +0 -0
  23. data/demo/app/controllers/home_controller.rb +4 -0
  24. data/demo/app/helpers/application_helper.rb +4 -0
  25. data/demo/app/javascript/application.js +3 -0
  26. data/demo/app/javascript/controllers/application.js +9 -0
  27. data/demo/app/javascript/controllers/index.js +11 -0
  28. data/demo/app/views/home/index.html.erb +3 -0
  29. data/demo/app/views/layouts/application.html.erb +15 -0
  30. data/demo/bin/bundle +113 -0
  31. data/demo/bin/dev +8 -0
  32. data/demo/bin/importmap +5 -0
  33. data/demo/bin/rails +6 -0
  34. data/demo/bin/rake +6 -0
  35. data/demo/bin/setup +35 -0
  36. data/demo/config/application.rb +36 -0
  37. data/demo/config/boot.rb +6 -0
  38. data/demo/config/cable.yml +10 -0
  39. data/demo/config/credentials.yml.enc +1 -0
  40. data/demo/config/database.yml +25 -0
  41. data/demo/config/environment.rb +7 -0
  42. data/demo/config/environments/development.rb +63 -0
  43. data/demo/config/environments/production.rb +89 -0
  44. data/demo/config/environments/test.rb +59 -0
  45. data/demo/config/importmap.rb +9 -0
  46. data/demo/config/initializers/assets.rb +14 -0
  47. data/demo/config/initializers/content_security_policy.rb +26 -0
  48. data/demo/config/initializers/filter_parameter_logging.rb +10 -0
  49. data/demo/config/initializers/inflections.rb +17 -0
  50. data/demo/config/initializers/permissions_policy.rb +12 -0
  51. data/demo/config/locales/en.yml +33 -0
  52. data/demo/config/puma.rb +45 -0
  53. data/demo/config/routes.rb +8 -0
  54. data/demo/config/storage.yml +34 -0
  55. data/demo/config.ru +8 -0
  56. data/demo/lib/assets/.keep +0 -0
  57. data/demo/lib/tasks/.keep +0 -0
  58. data/demo/log/.keep +0 -0
  59. data/demo/package.json +9 -0
  60. data/demo/public/404.html +67 -0
  61. data/demo/public/422.html +67 -0
  62. data/demo/public/500.html +66 -0
  63. data/demo/public/favicon.ico +0 -0
  64. data/demo/yarn.lock +157 -0
  65. data/lib/optics/view_components/engine.rb +19 -0
  66. data/lib/optics/view_components/version.rb +1 -1
  67. data/lib/optics/view_components.rb +4 -2
  68. metadata +155 -4
data/demo/Gemfile.lock ADDED
@@ -0,0 +1,198 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ optics_view_components (0.1.0)
5
+ view_component (> 2.0, < 4.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (7.0.4.3)
11
+ actionpack (= 7.0.4.3)
12
+ activesupport (= 7.0.4.3)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (7.0.4.3)
16
+ actionpack (= 7.0.4.3)
17
+ activejob (= 7.0.4.3)
18
+ activerecord (= 7.0.4.3)
19
+ activestorage (= 7.0.4.3)
20
+ activesupport (= 7.0.4.3)
21
+ mail (>= 2.7.1)
22
+ net-imap
23
+ net-pop
24
+ net-smtp
25
+ actionmailer (7.0.4.3)
26
+ actionpack (= 7.0.4.3)
27
+ actionview (= 7.0.4.3)
28
+ activejob (= 7.0.4.3)
29
+ activesupport (= 7.0.4.3)
30
+ mail (~> 2.5, >= 2.5.4)
31
+ net-imap
32
+ net-pop
33
+ net-smtp
34
+ rails-dom-testing (~> 2.0)
35
+ actionpack (7.0.4.3)
36
+ actionview (= 7.0.4.3)
37
+ activesupport (= 7.0.4.3)
38
+ rack (~> 2.0, >= 2.2.0)
39
+ rack-test (>= 0.6.3)
40
+ rails-dom-testing (~> 2.0)
41
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
42
+ actiontext (7.0.4.3)
43
+ actionpack (= 7.0.4.3)
44
+ activerecord (= 7.0.4.3)
45
+ activestorage (= 7.0.4.3)
46
+ activesupport (= 7.0.4.3)
47
+ globalid (>= 0.6.0)
48
+ nokogiri (>= 1.8.5)
49
+ actionview (7.0.4.3)
50
+ activesupport (= 7.0.4.3)
51
+ builder (~> 3.1)
52
+ erubi (~> 1.4)
53
+ rails-dom-testing (~> 2.0)
54
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
55
+ activejob (7.0.4.3)
56
+ activesupport (= 7.0.4.3)
57
+ globalid (>= 0.3.6)
58
+ activemodel (7.0.4.3)
59
+ activesupport (= 7.0.4.3)
60
+ activerecord (7.0.4.3)
61
+ activemodel (= 7.0.4.3)
62
+ activesupport (= 7.0.4.3)
63
+ activestorage (7.0.4.3)
64
+ actionpack (= 7.0.4.3)
65
+ activejob (= 7.0.4.3)
66
+ activerecord (= 7.0.4.3)
67
+ activesupport (= 7.0.4.3)
68
+ marcel (~> 1.0)
69
+ mini_mime (>= 1.1.0)
70
+ activesupport (7.0.4.3)
71
+ concurrent-ruby (~> 1.0, >= 1.0.2)
72
+ i18n (>= 1.6, < 2)
73
+ minitest (>= 5.1)
74
+ tzinfo (~> 2.0)
75
+ bindex (0.8.1)
76
+ bootsnap (1.16.0)
77
+ msgpack (~> 1.2)
78
+ builder (3.2.4)
79
+ concurrent-ruby (1.2.2)
80
+ crass (1.0.6)
81
+ cssbundling-rails (1.1.2)
82
+ railties (>= 6.0.0)
83
+ date (3.3.3)
84
+ debug (1.8.0)
85
+ irb (>= 1.5.0)
86
+ reline (>= 0.3.1)
87
+ erubi (1.12.0)
88
+ globalid (1.1.0)
89
+ activesupport (>= 5.0)
90
+ i18n (1.13.0)
91
+ concurrent-ruby (~> 1.0)
92
+ importmap-rails (1.1.6)
93
+ actionpack (>= 6.0.0)
94
+ railties (>= 6.0.0)
95
+ io-console (0.6.0)
96
+ irb (1.6.4)
97
+ reline (>= 0.3.0)
98
+ loofah (2.21.3)
99
+ crass (~> 1.0.2)
100
+ nokogiri (>= 1.12.0)
101
+ mail (2.8.1)
102
+ mini_mime (>= 0.1.1)
103
+ net-imap
104
+ net-pop
105
+ net-smtp
106
+ marcel (1.0.2)
107
+ method_source (1.0.0)
108
+ mini_mime (1.1.2)
109
+ minitest (5.18.0)
110
+ msgpack (1.7.1)
111
+ net-imap (0.3.4)
112
+ date
113
+ net-protocol
114
+ net-pop (0.1.2)
115
+ net-protocol
116
+ net-protocol (0.2.1)
117
+ timeout
118
+ net-smtp (0.3.3)
119
+ net-protocol
120
+ nio4r (2.5.9)
121
+ nokogiri (1.15.1-x86_64-linux)
122
+ racc (~> 1.4)
123
+ puma (6.2.2)
124
+ nio4r (~> 2.0)
125
+ racc (1.6.2)
126
+ rack (2.2.7)
127
+ rack-test (2.1.0)
128
+ rack (>= 1.3)
129
+ rails (7.0.4.3)
130
+ actioncable (= 7.0.4.3)
131
+ actionmailbox (= 7.0.4.3)
132
+ actionmailer (= 7.0.4.3)
133
+ actionpack (= 7.0.4.3)
134
+ actiontext (= 7.0.4.3)
135
+ actionview (= 7.0.4.3)
136
+ activejob (= 7.0.4.3)
137
+ activemodel (= 7.0.4.3)
138
+ activerecord (= 7.0.4.3)
139
+ activestorage (= 7.0.4.3)
140
+ activesupport (= 7.0.4.3)
141
+ bundler (>= 1.15.0)
142
+ railties (= 7.0.4.3)
143
+ rails-dom-testing (2.0.3)
144
+ activesupport (>= 4.2.0)
145
+ nokogiri (>= 1.6)
146
+ rails-html-sanitizer (1.5.0)
147
+ loofah (~> 2.19, >= 2.19.1)
148
+ railties (7.0.4.3)
149
+ actionpack (= 7.0.4.3)
150
+ activesupport (= 7.0.4.3)
151
+ method_source
152
+ rake (>= 12.2)
153
+ thor (~> 1.0)
154
+ zeitwerk (~> 2.5)
155
+ rake (13.0.6)
156
+ reline (0.3.3)
157
+ io-console (~> 0.5)
158
+ sprockets (4.2.0)
159
+ concurrent-ruby (~> 1.0)
160
+ rack (>= 2.2.4, < 4)
161
+ sprockets-rails (3.4.2)
162
+ actionpack (>= 5.2)
163
+ activesupport (>= 5.2)
164
+ sprockets (>= 3.0.0)
165
+ thor (1.2.2)
166
+ timeout (0.3.2)
167
+ tzinfo (2.0.6)
168
+ concurrent-ruby (~> 1.0)
169
+ view_component (3.0.0)
170
+ activesupport (>= 5.2.0, < 8.0)
171
+ concurrent-ruby (~> 1.0)
172
+ method_source (~> 1.0)
173
+ web-console (4.2.0)
174
+ actionview (>= 6.0.0)
175
+ activemodel (>= 6.0.0)
176
+ bindex (>= 0.4.0)
177
+ railties (>= 6.0.0)
178
+ websocket-driver (0.7.5)
179
+ websocket-extensions (>= 0.1.0)
180
+ websocket-extensions (0.1.5)
181
+ zeitwerk (2.6.8)
182
+
183
+ PLATFORMS
184
+ x86_64-linux
185
+
186
+ DEPENDENCIES
187
+ bootsnap
188
+ cssbundling-rails (~> 1.1)
189
+ debug
190
+ importmap-rails
191
+ optics_view_components!
192
+ puma (~> 6.0)
193
+ rails (~> 7.0.4, >= 7.0.4.3)
194
+ sprockets-rails
195
+ web-console
196
+
197
+ BUNDLED WITH
198
+ 2.4.10
data/demo/Procfile.dev ADDED
@@ -0,0 +1,2 @@
1
+ web: unset PORT && bin/rails server
2
+ css: yarn build:css --watch
data/demo/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
data/demo/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
4
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
5
+
6
+ require_relative 'config/application'
7
+
8
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_tree ../../javascript .js
3
+ //= link_tree ../builds
File without changes
@@ -0,0 +1,2 @@
1
+ // Entry point for your Sass build
2
+ @import '@rolemodel/optics/dist/scss/optics';
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationController < ActionController::Base
4
+ end
File without changes
@@ -0,0 +1,4 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApplicationHelper
4
+ end
@@ -0,0 +1,3 @@
1
+ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2
+ import "@hotwired/turbo-rails"
3
+ import "controllers"
@@ -0,0 +1,9 @@
1
+ import { Application } from "@hotwired/stimulus"
2
+
3
+ const application = Application.start()
4
+
5
+ // Configure Stimulus development experience
6
+ application.debug = false
7
+ window.Stimulus = application
8
+
9
+ export { application }
@@ -0,0 +1,11 @@
1
+ // Import and register all your controllers from the importmap under controllers/*
2
+
3
+ import { application } from "controllers/application"
4
+
5
+ // Eager load all controllers defined in the import map under controllers/**/*_controller
6
+ import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
7
+ eagerLoadControllersFrom("controllers", application)
8
+
9
+ // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
10
+ // import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
11
+ // lazyLoadControllersFrom("controllers", application)
@@ -0,0 +1,3 @@
1
+ <h1>Optics View Components Demo</h1>
2
+ <h2>Button</h2>
3
+ <%= render(Optics::Button::Component.new(label: 'Hello')) %>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Demo</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
+ </head>
11
+
12
+ <body>
13
+ <%= yield %>
14
+ </body>
15
+ </html>
data/demo/bin/bundle ADDED
@@ -0,0 +1,113 @@
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$/, '.locked')
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 ||
68
+ cli_arg_version ||
69
+ bundler_requirement_for(lockfile_version)
70
+ end
71
+
72
+ def bundler_requirement_for(version)
73
+ return "#{Gem::Requirement.default}.a" unless version
74
+
75
+ bundler_gem_version = Gem::Version.new(version)
76
+
77
+ bundler_gem_version.approximate_recommendation
78
+ end
79
+
80
+ def load_bundler!
81
+ ENV['BUNDLE_GEMFILE'] ||= gemfile
82
+
83
+ activate_bundler
84
+ end
85
+
86
+ def activate_bundler
87
+ gem_error = activation_error_handling do
88
+ gem 'bundler', bundler_requirement
89
+ end
90
+ return if gem_error.nil?
91
+
92
+ require_error = activation_error_handling do
93
+ require 'bundler/version'
94
+ end
95
+ if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
96
+ return
97
+ end
98
+
99
+ 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}'`"
100
+ exit 42
101
+ end
102
+
103
+ def activation_error_handling
104
+ yield
105
+ nil
106
+ rescue StandardError, LoadError => e
107
+ e
108
+ end
109
+ end
110
+
111
+ m.load_bundler!
112
+
113
+ load Gem.bin_path('bundler', 'bundle') if m.invoked_as_script?
data/demo/bin/dev ADDED
@@ -0,0 +1,8 @@
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 "$@"
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative '../config/application'
5
+ require 'importmap/commands'
data/demo/bin/rails ADDED
@@ -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'
data/demo/bin/rake ADDED
@@ -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
data/demo/bin/setup ADDED
@@ -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,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'boot'
4
+
5
+ require 'rails'
6
+ require 'active_model/railtie'
7
+ require 'active_job/railtie'
8
+ require 'action_controller/railtie'
9
+ require 'action_mailer/railtie'
10
+ require 'action_view/railtie'
11
+ require 'action_cable/engine'
12
+ require 'rails/test_unit/railtie'
13
+ require 'sprockets/railtie'
14
+
15
+ require 'view_component'
16
+ require 'optics/view_components'
17
+ require 'optics/view_components/engine'
18
+
19
+ # Require the gems listed in Gemfile, including any gems
20
+ # you've limited to :test, :development, or :production.
21
+ Bundler.require(*Rails.groups)
22
+
23
+ module Demo
24
+ class Application < Rails::Application
25
+ # Initialize configuration defaults for originally generated Rails version.
26
+ config.load_defaults 7.0
27
+
28
+ # Configuration for the application, engines, and railties goes here.
29
+ #
30
+ # These settings can be overridden in specific environments using the files
31
+ # in config/environments, which are processed later.
32
+ #
33
+ # config.time_zone = "Central Time (US & Canada)"
34
+ # config.eager_load_paths << Rails.root.join("extras")
35
+ end
36
+ 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: demo_production
@@ -0,0 +1 @@
1
+ F3Nl2BCHuT4zuosB602MLCVxA6J0hkJ7LqBOqeSfI9jgODKMqD1EqrIXg+ZoA0WHO9CV794WLelcP6wDnxqOZ9eB3x0yKHMEjwBvtTXW2hwuZTuT+4QzEH5VlV8/k+L5OK6dTY+M0/ZtL9HSE2EVyVjPGmwXEsk3vDeBRlsB/S192oGD0X75fatWvBIBDSESUCsoYNub3260SNuBB8OHPnEScPc7p0pCVOQfXlPIgBtw3DcQ2LqYBLE3BuNYoXdvrxn8Z6sgUVzANXzdqjZSICVZ/ba1EERe3nyh5wwRhs4rS5g3eTtLPC81WiZ7NOWWbR76eTt7eVtJkkL+7zzlliotZlJ9TqlT+cn8eorlxuIx/CwoTan7LKwKR6lfgBAHj8MBvi5F2eIL788kyNJxkTv2IO/aqwrUUz9t--/HjmFC5iAfP8ovq7--avyt26x5eDZa13b2jdJ90A==
@@ -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,63 @@
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
+ # Don't care if the mailer can't send.
39
+ config.action_mailer.raise_delivery_errors = false
40
+
41
+ config.action_mailer.perform_caching = false
42
+
43
+ # Print deprecation notices to the Rails logger.
44
+ config.active_support.deprecation = :log
45
+
46
+ # Raise exceptions for disallowed deprecations.
47
+ config.active_support.disallowed_deprecation = :raise
48
+
49
+ # Tell Active Support which deprecation messages to disallow.
50
+ config.active_support.disallowed_deprecation_warnings = []
51
+
52
+ # Suppress logger output for asset requests.
53
+ config.assets.quiet = true
54
+
55
+ # Raises error for missing translations.
56
+ # config.i18n.raise_on_missing_translations = true
57
+
58
+ # Annotate rendered view with file names.
59
+ # config.action_view.annotate_rendered_view_with_filenames = true
60
+
61
+ # Uncomment if you wish to allow Action Cable access from any origin.
62
+ # config.action_cable.disable_request_forgery_protection = true
63
+ end