yamls 0.1.1 → 0.2.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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +26 -1
  3. data/Gemfile +2 -0
  4. data/README.md +3 -0
  5. data/example/rails5/.gitignore +28 -0
  6. data/example/rails5/.ruby-version +1 -0
  7. data/example/rails5/Gemfile +47 -0
  8. data/example/rails5/README.md +24 -0
  9. data/example/rails5/Rakefile +6 -0
  10. data/example/rails5/app/channels/application_cable/channel.rb +4 -0
  11. data/example/rails5/app/channels/application_cable/connection.rb +4 -0
  12. data/example/rails5/app/controllers/application_controller.rb +2 -0
  13. data/example/rails5/app/controllers/books_controller.rb +53 -0
  14. data/example/rails5/app/controllers/concerns/.keep +0 -0
  15. data/example/rails5/app/controllers/people_controller.rb +55 -0
  16. data/example/rails5/app/jobs/application_job.rb +2 -0
  17. data/example/rails5/app/mailers/application_mailer.rb +4 -0
  18. data/example/rails5/app/models/application_record.rb +3 -0
  19. data/example/rails5/app/models/book.rb +2 -0
  20. data/example/rails5/app/models/concerns/.keep +0 -0
  21. data/example/rails5/app/models/person.rb +2 -0
  22. data/example/rails5/app/parameters/column.yml +11 -0
  23. data/example/rails5/app/views/layouts/mailer.html.erb +13 -0
  24. data/example/rails5/app/views/layouts/mailer.text.erb +1 -0
  25. data/example/rails5/bin/bundle +3 -0
  26. data/example/rails5/bin/rails +9 -0
  27. data/example/rails5/bin/rake +9 -0
  28. data/example/rails5/bin/setup +33 -0
  29. data/example/rails5/bin/spring +17 -0
  30. data/example/rails5/bin/update +28 -0
  31. data/example/rails5/config/application.rb +35 -0
  32. data/example/rails5/config/boot.rb +4 -0
  33. data/example/rails5/config/cable.yml +10 -0
  34. data/example/rails5/config/credentials.yml.enc +1 -0
  35. data/example/rails5/config/database.yml +25 -0
  36. data/example/rails5/config/environment.rb +5 -0
  37. data/example/rails5/config/environments/development.rb +54 -0
  38. data/example/rails5/config/environments/production.rb +85 -0
  39. data/example/rails5/config/environments/test.rb +46 -0
  40. data/example/rails5/config/initializers/application_controller_renderer.rb +8 -0
  41. data/example/rails5/config/initializers/backtrace_silencers.rb +7 -0
  42. data/example/rails5/config/initializers/cors.rb +16 -0
  43. data/example/rails5/config/initializers/filter_parameter_logging.rb +4 -0
  44. data/example/rails5/config/initializers/inflections.rb +16 -0
  45. data/example/rails5/config/initializers/mime_types.rb +4 -0
  46. data/example/rails5/config/initializers/wrap_parameters.rb +14 -0
  47. data/example/rails5/config/locales/en.yml +33 -0
  48. data/example/rails5/config/puma.rb +37 -0
  49. data/example/rails5/config/routes.rb +5 -0
  50. data/example/rails5/config/spring.rb +6 -0
  51. data/example/rails5/config/storage.yml +34 -0
  52. data/example/rails5/config.ru +5 -0
  53. data/example/rails5/db/migrate/20211031043641_create_people.rb +11 -0
  54. data/example/rails5/db/migrate/20211031052741_create_books.rb +11 -0
  55. data/example/rails5/db/schema.rb +31 -0
  56. data/example/rails5/db/seeds.rb +7 -0
  57. data/example/rails5/lib/tasks/.keep +0 -0
  58. data/example/rails5/log/.keep +0 -0
  59. data/example/rails5/public/robots.txt +1 -0
  60. data/example/rails5/storage/.keep +0 -0
  61. data/example/rails5/test/controllers/.keep +0 -0
  62. data/example/rails5/test/controllers/books_controller_test.rb +50 -0
  63. data/example/rails5/test/controllers/people_controller_test.rb +50 -0
  64. data/example/rails5/test/fixtures/.keep +0 -0
  65. data/example/rails5/test/fixtures/books.yml +10 -0
  66. data/example/rails5/test/fixtures/files/.keep +0 -0
  67. data/example/rails5/test/fixtures/people.yml +10 -0
  68. data/example/rails5/test/integration/.keep +0 -0
  69. data/example/rails5/test/test_helper.rb +10 -0
  70. data/example/rails5/tmp/.keep +0 -0
  71. data/lib/yamls/helpers/config.rb +6 -0
  72. data/lib/yamls/helpers/yaml_load.rb +19 -0
  73. data/lib/yamls/parameters.rb +4 -4
  74. data/lib/yamls/support/parameters.rb +19 -0
  75. data/lib/yamls/support.rb +8 -0
  76. data/lib/yamls/version.rb +1 -1
  77. data/lib/yamls.rb +3 -2
  78. metadata +71 -3
  79. data/lib/yamls/config.rb +0 -4
  80. data/lib/yamls/yaml_load.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d46df14bb66468b23c9ab08d1b5dfcadb439a148eacb145ff07e93d7b0f84066
4
- data.tar.gz: f06503685e11f42c7c7a687edaa81896a45e36fd6e464b7cc8aa79d6fa53b6e6
3
+ metadata.gz: ed8889b3c349731c112b58edb0699f114ccec9d6943500f2f421d33de77e0a4a
4
+ data.tar.gz: 7282c6527b87c907cb5abe98f2b5c4e057cf16549344af544e89780cbfe672be
5
5
  SHA512:
6
- metadata.gz: be090cb08898f3d6f590b63bed2f58c0f2c57d2e6c46aac6d01ef5969583d47435d445bb5f00bc509bbe66b3cb787a068498943c946e595225db0f42ef96152e
7
- data.tar.gz: d3aecf3dc56a5cbd48a1f414abad6f0eb2872bde8b7cb657dd69d8256f170043da8398f0ea6ae31bb3c517e0c7fccf701022c1f01d0fe6b84ac92b3f3a78d5c3
6
+ metadata.gz: e4681ff177aea5b609952df299a3c8ea2fdb9c803385417de4e85ff0844b185eafdbaef7885fe3d6dbec828246dfb333bf2052d41ee434323a1bf763293230a8
7
+ data.tar.gz: ee52a0edf4761acf2c2d53a30e79af552777ae8f2c8b0a1c835e70f57983567b416ffbd42262b1eb25d80d898547259328707aa30dce1f28fe94d5dae7da2c8e
data/.circleci/config.yml CHANGED
@@ -26,11 +26,36 @@ jobs:
26
26
  - run:
27
27
  name: Run rspec
28
28
  command: bundle exec rspec
29
+ test_rails5:
30
+ docker:
31
+ - image: cimg/ruby:2.7.4-node
32
+ executor: ruby/default
33
+ steps:
34
+ - checkout
35
+ - run:
36
+ name: Install dependencies
37
+ command: sudo apt-get update -y && sudo apt-get install -y libsqlite3-dev
38
+ - run:
39
+ name: Which bundler?
40
+ command: bundle -v
41
+ - run:
42
+ name: Bundle install
43
+ command: cd example/rails5 && bundle install --path vendor/bundle
44
+ - run:
45
+ name: Setup db
46
+ command: cd example/rails5 && bundle exec rails db:migrate
47
+ - run:
48
+ name: Run test
49
+ command: cd example/rails5 && bundle exec rake test
50
+
29
51
 
30
52
  # Invoke jobs via workflows
31
53
  # See: https://circleci.com/docs/2.0/configuration-reference/#workflows
32
54
  workflows:
33
- sample: # This is the name of the workflow, feel free to change it to better match your workflow.
55
+ build_and_test: # This is the name of the workflow, feel free to change it to better match your workflow.
34
56
  # Inside the workflow, you define the jobs you want to run.
35
57
  jobs:
36
58
  - build
59
+ - test_rails5:
60
+ requires:
61
+ - build
data/Gemfile CHANGED
@@ -12,6 +12,8 @@ gem "rspec", "~> 3.0"
12
12
  gem "rubocop", "~> 1.7"
13
13
  gem 'rubocop-discourse'
14
14
 
15
+ gem 'activesupport'
16
+
15
17
  group :test do
16
18
  gem 'actionpack'
17
19
  gem 'pry-byebug'
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Yamls
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/yamls.svg)](https://badge.fury.io/rb/yamls)
4
+ [![CircleCI](https://circleci.com/gh/TsuMakoto/yamls/tree/main.svg?style=svg)](https://circleci.com/gh/TsuMakoto/yamls/tree/main)
5
+
3
6
  Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/yamls`. To experiment with that code, run `bin/console` for an interactive prompt.
4
7
 
5
8
  TODO: Delete this and the text above, and describe your gem
@@ -0,0 +1,28 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ /tmp/*
17
+ !/log/.keep
18
+ !/tmp/.keep
19
+
20
+ # Ignore uploaded files in development
21
+ /storage/*
22
+ !/storage/.keep
23
+
24
+ .byebug_history
25
+
26
+ # Ignore master key for decrypting credentials and more.
27
+ /config/master.key
28
+ /vendor/
@@ -0,0 +1 @@
1
+ 2.7.4
@@ -0,0 +1,47 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ ruby '2.7.4'
5
+
6
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7
+ gem 'rails', '~> 5.2.6'
8
+ # Use sqlite3 as the database for Active Record
9
+ gem 'sqlite3'
10
+ # Use Puma as the app server
11
+ gem 'puma', '~> 3.11'
12
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
13
+ # gem 'jbuilder', '~> 2.5'
14
+ # Use Redis adapter to run Action Cable in production
15
+ # gem 'redis', '~> 4.0'
16
+ # Use ActiveModel has_secure_password
17
+ # gem 'bcrypt', '~> 3.1.7'
18
+
19
+ # Use ActiveStorage variant
20
+ # gem 'mini_magick', '~> 4.8'
21
+
22
+ # Use Capistrano for deployment
23
+ # gem 'capistrano-rails', group: :development
24
+
25
+ # Reduces boot times through caching; required in config/boot.rb
26
+ gem 'bootsnap', '>= 1.1.0', require: false
27
+
28
+ gem 'yamls'
29
+
30
+ # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
31
+ # gem 'rack-cors'
32
+
33
+ group :development, :test do
34
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
35
+ gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
36
+ end
37
+
38
+ group :development do
39
+ gem 'listen', '>= 3.0.5', '< 3.2'
40
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
41
+ gem 'spring'
42
+ gem 'spring-watcher-listen', '~> 2.0.0'
43
+ end
44
+
45
+
46
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
47
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
@@ -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
+ * ...
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationController < ActionController::API
2
+ end
@@ -0,0 +1,53 @@
1
+ class BooksController < ApplicationController
2
+ before_action :set_book, only: [:show, :update, :destroy]
3
+
4
+ include Yamls::Support::Parameters
5
+
6
+ # GET /books
7
+ def index
8
+ @books = Book.all
9
+
10
+ render json: @books
11
+ end
12
+
13
+ # GET /books/1
14
+ def show
15
+ render json: @book
16
+ end
17
+
18
+ # POST /books
19
+ def create
20
+ @book = Book.new(book_params)
21
+
22
+ if @book.save
23
+ render json: @book, status: :created, location: @book
24
+ else
25
+ render json: @book.errors, status: :unprocessable_entity
26
+ end
27
+ end
28
+
29
+ # PATCH/PUT /books/1
30
+ def update
31
+ if @book.update(book_params)
32
+ render json: @book
33
+ else
34
+ render json: @book.errors, status: :unprocessable_entity
35
+ end
36
+ end
37
+
38
+ # DELETE /books/1
39
+ def destroy
40
+ @book.destroy
41
+ end
42
+
43
+ private
44
+ # Use callbacks to share common setup or constraints between actions.
45
+ def set_book
46
+ @book = Book.find(params[:id])
47
+ end
48
+
49
+ # Only allow a trusted parameter "white list" through.
50
+ def book_params
51
+ yamls
52
+ end
53
+ end
File without changes
@@ -0,0 +1,55 @@
1
+ class PeopleController < ApplicationController
2
+ before_action :set_person, only: [:show, :update, :destroy]
3
+
4
+ # GET /people
5
+ def index
6
+ @people = Person.all
7
+
8
+ render json: @people
9
+ end
10
+
11
+ # GET /people/1
12
+ def show
13
+ render json: @person
14
+ end
15
+
16
+ # POST /people
17
+ def create
18
+ @person = Person.new(person_params)
19
+
20
+ if @person.save
21
+ render json: @person, status: :created, location: @person
22
+ else
23
+ render json: @person.errors, status: :unprocessable_entity
24
+ end
25
+ end
26
+
27
+ # PATCH/PUT /people/1
28
+ def update
29
+ if @person.update(person_params)
30
+ render json: @person
31
+ else
32
+ render json: @person.errors, status: :unprocessable_entity
33
+ end
34
+ end
35
+
36
+ # DELETE /people/1
37
+ def destroy
38
+ @person.destroy
39
+ end
40
+
41
+ private
42
+ # Use callbacks to share common setup or constraints between actions.
43
+ def set_person
44
+ @person = Person.find(params[:id])
45
+ end
46
+
47
+ # Only allow a trusted parameter "white list" through.
48
+ def person_params
49
+ Yamls::Parameters.new(
50
+ params,
51
+ model: :people,
52
+ action: :post
53
+ ).permit
54
+ end
55
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -0,0 +1,2 @@
1
+ class Book < ApplicationRecord
2
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ class Person < ApplicationRecord
2
+ end
@@ -0,0 +1,11 @@
1
+ people:
2
+ post:
3
+ - name
4
+ - agen
5
+ - role
6
+
7
+ book:
8
+ create:
9
+ - name
10
+ - label
11
+ - value
@@ -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,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ APP_PATH = File.expand_path('../config/application', __dir__)
8
+ require_relative '../config/boot'
9
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ require_relative '../config/boot'
8
+ require 'rake'
9
+ Rake.application.run
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ require 'fileutils'
3
+ include FileUtils
4
+
5
+ # path to your application root.
6
+ APP_ROOT = File.expand_path('..', __dir__)
7
+
8
+ def system!(*args)
9
+ system(*args) || abort("\n== Command #{args} failed ==")
10
+ end
11
+
12
+ chdir APP_ROOT do
13
+ # This script is a starting point to setup your application.
14
+ # Add necessary setup steps to this file.
15
+
16
+ puts '== Installing dependencies =='
17
+ system! 'gem install bundler --conservative'
18
+ system('bundle check') || system!('bundle install')
19
+
20
+ # puts "\n== Copying sample files =="
21
+ # unless File.exist?('config/database.yml')
22
+ # cp 'config/database.yml.sample', 'config/database.yml'
23
+ # end
24
+
25
+ puts "\n== Preparing database =="
26
+ system! 'bin/rails db:setup'
27
+
28
+ puts "\n== Removing old logs and tempfiles =="
29
+ system! 'bin/rails log:clear tmp:clear'
30
+
31
+ puts "\n== Restarting application server =="
32
+ system! 'bin/rails restart'
33
+ end
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads Spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require 'rubygems'
8
+ require 'bundler'
9
+
10
+ lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11
+ spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
12
+ if spring
13
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14
+ gem 'spring', spring.version
15
+ require 'spring/binstub'
16
+ end
17
+ end
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ require 'fileutils'
3
+ include FileUtils
4
+
5
+ # path to your application root.
6
+ APP_ROOT = File.expand_path('..', __dir__)
7
+
8
+ def system!(*args)
9
+ system(*args) || abort("\n== Command #{args} failed ==")
10
+ end
11
+
12
+ chdir APP_ROOT do
13
+ # This script is a way to update your development environment automatically.
14
+ # Add necessary update steps to this file.
15
+
16
+ puts '== Installing dependencies =='
17
+ system! 'gem install bundler --conservative'
18
+ system('bundle check') || system!('bundle install')
19
+
20
+ puts "\n== Updating database =="
21
+ system! 'bin/rails db:migrate'
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system! 'bin/rails log:clear tmp:clear'
25
+
26
+ puts "\n== Restarting application server =="
27
+ system! 'bin/rails restart'
28
+ end
@@ -0,0 +1,35 @@
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_view/railtie"
12
+ require "action_cable/engine"
13
+ # require "sprockets/railtie"
14
+ require "rails/test_unit/railtie"
15
+
16
+ # Require the gems listed in Gemfile, including any gems
17
+ # you've limited to :test, :development, or :production.
18
+ Bundler.require(*Rails.groups)
19
+
20
+ module Rails5
21
+ class Application < Rails::Application
22
+ # Initialize configuration defaults for originally generated Rails version.
23
+ config.load_defaults 5.2
24
+
25
+ # Settings in config/environments/* take precedence over those specified here.
26
+ # Application configuration can go into files in config/initializers
27
+ # -- all .rb files in that directory are automatically loaded after loading
28
+ # the framework and any gems in your application.
29
+
30
+ # Only loads a smaller set of middleware suitable for API only apps.
31
+ # Middleware like session, flash, cookies can be added back manually.
32
+ # Skip views, helpers and assets when generating a new resource.
33
+ config.api_only = true
34
+ end
35
+ end
@@ -0,0 +1,4 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
4
+ 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: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
+ channel_prefix: rails5_production
@@ -0,0 +1 @@
1
+ 3FqtMXzAKMGPsonOSWudTiuuVWKBKw9BXdZf94HDBc904shnEl8Fo0wdm7sTAsyOwkZJpyuHStfLCrmz0Bs8bHkSxOSo0S+0LvzavTQXbalnvaU+JUA4JrK4FbhjbBfH5HLVpleKtiYAObK6GKypQohRwst7Z5nw7Xs+P8NUrTTtYOFiDvpvtJtI8TttN/mwkUR/PKY8Wqye2374CTHUxu8fAcmTMiHsThlx57TUrOuwU9Gpl3paRvywP3OcsZrLzAwj9scb8OSd8rRNb4akg4h1E8+IsgEwXKdX85h/WdfGJ/trklXoPkf6J+awS/+TakIOodhOsFwPZ2bAN4K518esOlVSlBoCPK3snb++r0RsjEJG8op18d6hbNOFC9yWmSHSAEL2S0gNmS/UXXJEH7zYMWInZkuv45oa--53R0qvxW/0U8c6eG--ZDb/DIdThJF3YK1uXhibSA==
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
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,5 @@
1
+ # Load the Rails application.
2
+ require_relative 'application'
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,54 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
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/disable caching. By default caching is disabled.
16
+ # Run rails dev:cache to toggle caching.
17
+ if Rails.root.join('tmp', 'caching-dev.txt').exist?
18
+ config.action_controller.perform_caching = true
19
+
20
+ config.cache_store = :memory_store
21
+ config.public_file_server.headers = {
22
+ 'Cache-Control' => "public, max-age=#{2.days.to_i}"
23
+ }
24
+ else
25
+ config.action_controller.perform_caching = false
26
+
27
+ config.cache_store = :null_store
28
+ end
29
+
30
+ # Store uploaded files on the local file system (see config/storage.yml for options)
31
+ config.active_storage.service = :local
32
+
33
+ # Don't care if the mailer can't send.
34
+ config.action_mailer.raise_delivery_errors = false
35
+
36
+ config.action_mailer.perform_caching = false
37
+
38
+ # Print deprecation notices to the Rails logger.
39
+ config.active_support.deprecation = :log
40
+
41
+ # Raise an error on page load if there are pending migrations.
42
+ config.active_record.migration_error = :page_load
43
+
44
+ # Highlight code that triggered database queries in logs.
45
+ config.active_record.verbose_query_logs = true
46
+
47
+
48
+ # Raises error for missing translations
49
+ # config.action_view.raise_on_missing_translations = true
50
+
51
+ # Use an evented file watcher to asynchronously detect changes in source code,
52
+ # routes, locales, etc. This feature depends on the listen gem.
53
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
54
+ end