yamls 0.1.3 → 0.2.2

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 (153) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +49 -0
  3. data/CHANGELOG.md +5 -0
  4. data/README.md +233 -2
  5. data/example/rails-demo/.gitignore +33 -0
  6. data/example/rails-demo/.ruby-version +1 -0
  7. data/example/rails-demo/Gemfile +43 -0
  8. data/example/{rails5 → rails-demo}/README.md +0 -0
  9. data/example/rails-demo/Rakefile +6 -0
  10. data/example/rails-demo/app/channels/application_cable/channel.rb +4 -0
  11. data/example/rails-demo/app/channels/application_cable/connection.rb +4 -0
  12. data/example/rails-demo/app/controllers/application_controller.rb +2 -0
  13. data/example/rails-demo/app/controllers/books_controller.rb +48 -0
  14. data/example/{rails5/test/integration → rails-demo/app/controllers/concerns}/.keep +0 -0
  15. data/example/rails-demo/app/jobs/application_job.rb +7 -0
  16. data/example/rails-demo/app/mailers/application_mailer.rb +4 -0
  17. data/example/rails-demo/app/models/application_record.rb +3 -0
  18. data/example/rails-demo/app/models/book.rb +2 -0
  19. data/example/rails-demo/app/models/concerns/.keep +0 -0
  20. data/example/rails-demo/app/parameters/column.yml +5 -0
  21. data/example/rails-demo/app/views/layouts/mailer.html.erb +13 -0
  22. data/example/rails-demo/app/views/layouts/mailer.text.erb +1 -0
  23. data/example/rails-demo/bin/bundle +114 -0
  24. data/example/rails-demo/bin/rails +9 -0
  25. data/example/rails-demo/bin/rake +9 -0
  26. data/example/rails-demo/bin/setup +33 -0
  27. data/example/rails-demo/bin/spring +17 -0
  28. data/example/rails-demo/config/application.rb +37 -0
  29. data/example/rails-demo/config/boot.rb +4 -0
  30. data/example/rails-demo/config/cable.yml +10 -0
  31. data/example/rails-demo/config/credentials.yml.enc +1 -0
  32. data/example/rails-demo/config/database.yml +25 -0
  33. data/example/rails-demo/config/environment.rb +5 -0
  34. data/example/rails-demo/config/environments/development.rb +52 -0
  35. data/example/rails-demo/config/environments/production.rb +105 -0
  36. data/example/rails-demo/config/environments/test.rb +49 -0
  37. data/example/rails-demo/config/initializers/application_controller_renderer.rb +8 -0
  38. data/example/rails-demo/config/initializers/backtrace_silencers.rb +7 -0
  39. data/example/rails-demo/config/initializers/cors.rb +16 -0
  40. data/example/rails-demo/config/initializers/filter_parameter_logging.rb +4 -0
  41. data/example/rails-demo/config/initializers/inflections.rb +16 -0
  42. data/example/rails-demo/config/initializers/mime_types.rb +4 -0
  43. data/example/rails-demo/config/initializers/wrap_parameters.rb +14 -0
  44. data/example/rails-demo/config/locales/en.yml +33 -0
  45. data/example/rails-demo/config/puma.rb +38 -0
  46. data/example/rails-demo/config/routes.rb +5 -0
  47. data/example/rails-demo/config/spring.rb +6 -0
  48. data/example/rails-demo/config/storage.yml +34 -0
  49. data/example/rails-demo/config.ru +5 -0
  50. data/example/rails-demo/db/migrate/20211101020803_create_books.rb +11 -0
  51. data/example/rails-demo/db/schema.rb +31 -0
  52. data/example/rails-demo/db/seeds.rb +7 -0
  53. data/example/rails-demo/lib/tasks/.keep +0 -0
  54. data/example/rails-demo/log/.keep +0 -0
  55. data/example/rails-demo/public/robots.txt +1 -0
  56. data/example/rails-demo/storage/.keep +0 -0
  57. data/example/rails-demo/test/channels/application_cable/connection_test.rb +11 -0
  58. data/example/rails-demo/test/controllers/.keep +0 -0
  59. data/example/rails-demo/test/controllers/books_controller_test.rb +38 -0
  60. data/example/rails-demo/test/fixtures/.keep +0 -0
  61. data/example/rails-demo/test/fixtures/books.yml +11 -0
  62. data/example/rails-demo/test/fixtures/files/.keep +0 -0
  63. data/example/rails-demo/test/models/.keep +0 -0
  64. data/example/rails-demo/test/models/book_test.rb +7 -0
  65. data/example/rails-demo/test/test_helper.rb +13 -0
  66. data/example/rails-demo/tmp/.keep +0 -0
  67. data/example/rails-demo/tmp/pids/.keep +0 -0
  68. data/example/rails5/Gemfile +1 -1
  69. data/example/rails5/app/controllers/books_controller.rb +3 -5
  70. data/example/rails5/app/controllers/people_controller.rb +1 -1
  71. data/example/rails5/db/migrate/{20211031043641_create_people.rb → 20211031170917_create_people.rb} +2 -2
  72. data/example/rails5/db/schema.rb +3 -3
  73. data/example/rails5/test/controllers/books_controller_test.rb +2 -14
  74. data/example/rails5/test/controllers/people_controller_test.rb +2 -14
  75. data/example/rails5/test/fixtures/books.yml +8 -7
  76. data/example/rails5/test/fixtures/people.yml +8 -7
  77. data/example/rails6.0.0/.gitignore +33 -0
  78. data/example/rails6.0.0/.ruby-version +1 -0
  79. data/example/rails6.0.0/Gemfile +43 -0
  80. data/example/rails6.0.0/README.md +24 -0
  81. data/example/rails6.0.0/Rakefile +6 -0
  82. data/example/rails6.0.0/app/channels/application_cable/channel.rb +4 -0
  83. data/example/rails6.0.0/app/channels/application_cable/connection.rb +4 -0
  84. data/example/rails6.0.0/app/controllers/application_controller.rb +2 -0
  85. data/example/rails6.0.0/app/controllers/books_controller.rb +53 -0
  86. data/example/rails6.0.0/app/controllers/concerns/.keep +0 -0
  87. data/example/rails6.0.0/app/controllers/people_controller.rb +55 -0
  88. data/example/rails6.0.0/app/jobs/application_job.rb +7 -0
  89. data/example/rails6.0.0/app/mailers/application_mailer.rb +4 -0
  90. data/example/rails6.0.0/app/models/application_record.rb +3 -0
  91. data/example/rails6.0.0/app/models/book.rb +2 -0
  92. data/example/rails6.0.0/app/models/concerns/.keep +0 -0
  93. data/example/rails6.0.0/app/models/person.rb +2 -0
  94. data/example/rails6.0.0/app/parameters/column.yml +15 -0
  95. data/example/rails6.0.0/app/views/layouts/mailer.html.erb +13 -0
  96. data/example/rails6.0.0/app/views/layouts/mailer.text.erb +1 -0
  97. data/example/rails6.0.0/bin/bundle +114 -0
  98. data/example/rails6.0.0/bin/rails +9 -0
  99. data/example/rails6.0.0/bin/rake +9 -0
  100. data/example/rails6.0.0/bin/setup +33 -0
  101. data/example/rails6.0.0/bin/spring +17 -0
  102. data/example/rails6.0.0/config/application.rb +37 -0
  103. data/example/rails6.0.0/config/boot.rb +4 -0
  104. data/example/rails6.0.0/config/cable.yml +10 -0
  105. data/example/rails6.0.0/config/credentials.yml.enc +1 -0
  106. data/example/rails6.0.0/config/database.yml +25 -0
  107. data/example/rails6.0.0/config/environment.rb +5 -0
  108. data/example/rails6.0.0/config/environments/development.rb +52 -0
  109. data/example/rails6.0.0/config/environments/production.rb +105 -0
  110. data/example/rails6.0.0/config/environments/test.rb +49 -0
  111. data/example/rails6.0.0/config/initializers/application_controller_renderer.rb +8 -0
  112. data/example/rails6.0.0/config/initializers/backtrace_silencers.rb +7 -0
  113. data/example/rails6.0.0/config/initializers/cors.rb +16 -0
  114. data/example/rails6.0.0/config/initializers/filter_parameter_logging.rb +4 -0
  115. data/example/rails6.0.0/config/initializers/inflections.rb +16 -0
  116. data/example/rails6.0.0/config/initializers/mime_types.rb +4 -0
  117. data/example/rails6.0.0/config/initializers/wrap_parameters.rb +14 -0
  118. data/example/rails6.0.0/config/locales/en.yml +33 -0
  119. data/example/rails6.0.0/config/puma.rb +38 -0
  120. data/example/rails6.0.0/config/routes.rb +5 -0
  121. data/example/rails6.0.0/config/spring.rb +6 -0
  122. data/example/rails6.0.0/config/storage.yml +34 -0
  123. data/example/rails6.0.0/config.ru +5 -0
  124. data/example/rails6.0.0/db/migrate/20211031165333_create_people.rb +11 -0
  125. data/example/rails6.0.0/db/migrate/20211031165612_create_books.rb +11 -0
  126. data/example/rails6.0.0/db/schema.rb +31 -0
  127. data/example/rails6.0.0/db/seeds.rb +7 -0
  128. data/example/rails6.0.0/lib/tasks/.keep +0 -0
  129. data/example/rails6.0.0/log/.keep +0 -0
  130. data/example/rails6.0.0/public/robots.txt +1 -0
  131. data/example/rails6.0.0/storage/.keep +0 -0
  132. data/example/rails6.0.0/test/channels/application_cable/connection_test.rb +11 -0
  133. data/example/rails6.0.0/test/controllers/.keep +0 -0
  134. data/example/rails6.0.0/test/controllers/books_controller_test.rb +38 -0
  135. data/example/rails6.0.0/test/controllers/people_controller_test.rb +38 -0
  136. data/example/rails6.0.0/test/fixtures/.keep +0 -0
  137. data/example/rails6.0.0/test/fixtures/books.yml +11 -0
  138. data/example/rails6.0.0/test/fixtures/files/.keep +0 -0
  139. data/example/rails6.0.0/test/fixtures/people.yml +11 -0
  140. data/example/rails6.0.0/test/integration/.keep +0 -0
  141. data/example/rails6.0.0/test/test_helper.rb +13 -0
  142. data/example/rails6.0.0/tmp/.keep +0 -0
  143. data/example/rails6.0.0/tmp/pids/.keep +0 -0
  144. data/lib/yamls/helpers/config.rb +6 -0
  145. data/lib/yamls/helpers/yaml_load.rb +19 -0
  146. data/lib/yamls/parameters.rb +6 -6
  147. data/lib/yamls/support/parameters.rb +13 -1
  148. data/lib/yamls/support.rb +8 -0
  149. data/lib/yamls/version.rb +1 -1
  150. data/lib/yamls.rb +3 -2
  151. metadata +136 -7
  152. data/lib/yamls/config.rb +0 -4
  153. data/lib/yamls/yaml_load.rb +0 -17
@@ -0,0 +1,34 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket
23
+
24
+ # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
+ # microsoft:
26
+ # service: AzureStorage
27
+ # storage_account_name: your_account_name
28
+ # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
+ # container: your_container_name
30
+
31
+ # mirror:
32
+ # service: Mirror
33
+ # primary: local
34
+ # mirrors: [ amazon, google, microsoft ]
@@ -0,0 +1,5 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative 'config/environment'
4
+
5
+ run Rails.application
@@ -0,0 +1,11 @@
1
+ class CreatePeople < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :people do |t|
4
+ t.string :name
5
+ t.integer :age
6
+ t.integer :role
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class CreateBooks < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :books do |t|
4
+ t.string :name
5
+ t.string :label
6
+ t.integer :value
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,31 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `rails
6
+ # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(version: 2021_10_31_165612) do
14
+
15
+ create_table "books", force: :cascade do |t|
16
+ t.string "name"
17
+ t.string "label"
18
+ t.integer "value"
19
+ t.datetime "created_at", precision: 6, null: false
20
+ t.datetime "updated_at", precision: 6, null: false
21
+ end
22
+
23
+ create_table "people", force: :cascade do |t|
24
+ t.string "name"
25
+ t.integer "age"
26
+ t.integer "role"
27
+ t.datetime "created_at", precision: 6, null: false
28
+ t.datetime "updated_at", precision: 6, null: false
29
+ end
30
+
31
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7
+ # Character.create(name: 'Luke', movie: movies.first)
File without changes
File without changes
@@ -0,0 +1 @@
1
+ # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
File without changes
@@ -0,0 +1,11 @@
1
+ require "test_helper"
2
+
3
+ class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
4
+ # test "connects with cookies" do
5
+ # cookies.signed[:user_id] = 42
6
+ #
7
+ # connect
8
+ #
9
+ # assert_equal connection.user_id, "42"
10
+ # end
11
+ end
File without changes
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+
3
+ class BooksControllerTest < ActionDispatch::IntegrationTest
4
+ setup do
5
+ @book = books(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get books_url, as: :json
10
+ assert_response :success
11
+ end
12
+
13
+ test "should create book" do
14
+ assert_difference('Book.count') do
15
+ post books_url, params: { book: { label: @book.label, name: @book.name, value: @book.value } }, as: :json
16
+ end
17
+
18
+ assert_response 201
19
+ end
20
+
21
+ test "should show book" do
22
+ get book_url(@book), as: :json
23
+ assert_response :success
24
+ end
25
+
26
+ test "should update book" do
27
+ patch book_url(@book), params: { book: { label: @book.label, name: @book.name, value: @book.value } }, as: :json
28
+ assert_response 200
29
+ end
30
+
31
+ test "should destroy book" do
32
+ assert_difference('Book.count', -1) do
33
+ delete book_url(@book), as: :json
34
+ end
35
+
36
+ assert_response 204
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+
3
+ class PeopleControllerTest < ActionDispatch::IntegrationTest
4
+ setup do
5
+ @person = people(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get people_url, as: :json
10
+ assert_response :success
11
+ end
12
+
13
+ test "should create person" do
14
+ assert_difference('Person.count') do
15
+ post people_url, params: { person: { age: @person.age, name: @person.name, role: @person.role } }, as: :json
16
+ end
17
+
18
+ assert_response 201
19
+ end
20
+
21
+ test "should show person" do
22
+ get person_url(@person), as: :json
23
+ assert_response :success
24
+ end
25
+
26
+ test "should update person" do
27
+ patch person_url(@person), params: { person: { age: @person.age, name: @person.name, role: @person.role } }, as: :json
28
+ assert_response 200
29
+ end
30
+
31
+ test "should destroy person" do
32
+ assert_difference('Person.count', -1) do
33
+ delete person_url(@person), as: :json
34
+ end
35
+
36
+ assert_response 204
37
+ end
38
+ end
File without changes
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+ label: MyString
6
+ value: 1
7
+
8
+ two:
9
+ name: MyString
10
+ label: MyString
11
+ value: 1
File without changes
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ name: MyString
5
+ age: 1
6
+ role: 1
7
+
8
+ two:
9
+ name: MyString
10
+ age: 1
11
+ role: 1
File without changes
@@ -0,0 +1,13 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require_relative '../config/environment'
3
+ require 'rails/test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ # Run tests in parallel with specified workers
7
+ parallelize(workers: :number_of_processors)
8
+
9
+ # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
10
+ fixtures :all
11
+
12
+ # Add more helper methods to be used by all tests here...
13
+ end
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ module Yamls
3
+ module Helpers
4
+ FILEPATH = "app/parameters/column.yml"
5
+ end
6
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+ module Yamls
3
+ module Helpers
4
+ class YamlLoad
5
+ def initialize(filepath, loader: YAML)
6
+ @filepath = filepath
7
+ @loader = loader
8
+ end
9
+
10
+ def load
11
+ loader.load_file(filepath)
12
+ end
13
+
14
+ private
15
+
16
+ attr_reader :filepath, :loader
17
+ end
18
+ end
19
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
- require_relative "./config"
3
- require_relative "./yaml_load"
2
+ require_relative "./helpers/config"
3
+ require_relative "./helpers/yaml_load"
4
4
 
5
5
  module Yamls
6
6
  class Parameters
@@ -8,12 +8,12 @@ module Yamls
8
8
  params,
9
9
  model: nil,
10
10
  action: nil,
11
- required: nil,
11
+ required: model || action,
12
12
  nested: [],
13
- filepath: "#{Rails.root}/#{Yamls::FILEPATH}"
13
+ filepath: "#{Rails.root}/#{Helpers::FILEPATH}"
14
14
  )
15
15
  @params = params
16
- @required = required || model
16
+ @required = required
17
17
  @nested = [model, action].push(*nested).compact.map(&:to_s)
18
18
  @filepath = filepath
19
19
  end
@@ -29,7 +29,7 @@ module Yamls
29
29
  attr_reader :params, :filepath, :required, :nested
30
30
 
31
31
  def yaml_loader
32
- @yaml_loader ||= YamlLoad.new(filepath)
32
+ @yaml_loader ||= Helpers::YamlLoad.new(filepath)
33
33
  end
34
34
 
35
35
  def columns
@@ -1,12 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "../yamls/parameters"
3
+ require "active_support"
4
4
 
5
5
  module Yamls
6
6
  module Support
7
7
  module Parameters
8
8
  extend ActiveSupport::Concern
9
9
 
10
+ included do
11
+ before_action :define_params_method
12
+ end
13
+
14
+ protected
15
+
10
16
  def yamls
11
17
  Yamls::Parameters.new(
12
18
  params,
@@ -14,6 +20,12 @@ module Yamls
14
20
  action: action_name,
15
21
  ).permit
16
22
  end
23
+
24
+ def define_params_method
25
+ method_name = "#{controller_name.singularize}_#{action_name}_params"
26
+
27
+ define_singleton_method(method_name) { yamls }
28
+ end
17
29
  end
18
30
  end
19
31
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "yamls/support/parameters"
4
+
5
+ module Yamls
6
+ module Support
7
+ end
8
+ end
data/lib/yamls/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yamls
4
- VERSION = "0.1.3"
4
+ VERSION = "0.2.2"
5
5
  end
data/lib/yamls.rb CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  require "yaml"
4
4
 
5
- require_relative "yamls/version"
6
- require_relative "yamls/parameters"
5
+ require "yamls/version"
6
+ require "yamls/parameters"
7
+ require "yamls/support"
7
8
 
8
9
  module Yamls
9
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TsuMakoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-31 00:00:00.000000000 Z
11
+ date: 2021-11-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -28,10 +28,72 @@ files:
28
28
  - Rakefile
29
29
  - bin/console
30
30
  - bin/setup
31
+ - example/rails-demo/.gitignore
32
+ - example/rails-demo/.ruby-version
33
+ - example/rails-demo/Gemfile
34
+ - example/rails-demo/README.md
35
+ - example/rails-demo/Rakefile
36
+ - example/rails-demo/app/channels/application_cable/channel.rb
37
+ - example/rails-demo/app/channels/application_cable/connection.rb
38
+ - example/rails-demo/app/controllers/application_controller.rb
39
+ - example/rails-demo/app/controllers/books_controller.rb
40
+ - example/rails-demo/app/controllers/concerns/.keep
41
+ - example/rails-demo/app/jobs/application_job.rb
42
+ - example/rails-demo/app/mailers/application_mailer.rb
43
+ - example/rails-demo/app/models/application_record.rb
44
+ - example/rails-demo/app/models/book.rb
45
+ - example/rails-demo/app/models/concerns/.keep
46
+ - example/rails-demo/app/parameters/column.yml
47
+ - example/rails-demo/app/views/layouts/mailer.html.erb
48
+ - example/rails-demo/app/views/layouts/mailer.text.erb
49
+ - example/rails-demo/bin/bundle
50
+ - example/rails-demo/bin/rails
51
+ - example/rails-demo/bin/rake
52
+ - example/rails-demo/bin/setup
53
+ - example/rails-demo/bin/spring
54
+ - example/rails-demo/config.ru
55
+ - example/rails-demo/config/application.rb
56
+ - example/rails-demo/config/boot.rb
57
+ - example/rails-demo/config/cable.yml
58
+ - example/rails-demo/config/credentials.yml.enc
59
+ - example/rails-demo/config/database.yml
60
+ - example/rails-demo/config/environment.rb
61
+ - example/rails-demo/config/environments/development.rb
62
+ - example/rails-demo/config/environments/production.rb
63
+ - example/rails-demo/config/environments/test.rb
64
+ - example/rails-demo/config/initializers/application_controller_renderer.rb
65
+ - example/rails-demo/config/initializers/backtrace_silencers.rb
66
+ - example/rails-demo/config/initializers/cors.rb
67
+ - example/rails-demo/config/initializers/filter_parameter_logging.rb
68
+ - example/rails-demo/config/initializers/inflections.rb
69
+ - example/rails-demo/config/initializers/mime_types.rb
70
+ - example/rails-demo/config/initializers/wrap_parameters.rb
71
+ - example/rails-demo/config/locales/en.yml
72
+ - example/rails-demo/config/puma.rb
73
+ - example/rails-demo/config/routes.rb
74
+ - example/rails-demo/config/spring.rb
75
+ - example/rails-demo/config/storage.yml
76
+ - example/rails-demo/db/migrate/20211101020803_create_books.rb
77
+ - example/rails-demo/db/schema.rb
78
+ - example/rails-demo/db/seeds.rb
79
+ - example/rails-demo/lib/tasks/.keep
80
+ - example/rails-demo/log/.keep
81
+ - example/rails-demo/public/robots.txt
82
+ - example/rails-demo/storage/.keep
83
+ - example/rails-demo/test/channels/application_cable/connection_test.rb
84
+ - example/rails-demo/test/controllers/.keep
85
+ - example/rails-demo/test/controllers/books_controller_test.rb
86
+ - example/rails-demo/test/fixtures/.keep
87
+ - example/rails-demo/test/fixtures/books.yml
88
+ - example/rails-demo/test/fixtures/files/.keep
89
+ - example/rails-demo/test/models/.keep
90
+ - example/rails-demo/test/models/book_test.rb
91
+ - example/rails-demo/test/test_helper.rb
92
+ - example/rails-demo/tmp/.keep
93
+ - example/rails-demo/tmp/pids/.keep
31
94
  - example/rails5/.gitignore
32
95
  - example/rails5/.ruby-version
33
96
  - example/rails5/Gemfile
34
- - example/rails5/README.md
35
97
  - example/rails5/Rakefile
36
98
  - example/rails5/app/channels/application_cable/channel.rb
37
99
  - example/rails5/app/channels/application_cable/connection.rb
@@ -76,8 +138,8 @@ files:
76
138
  - example/rails5/config/routes.rb
77
139
  - example/rails5/config/spring.rb
78
140
  - example/rails5/config/storage.yml
79
- - example/rails5/db/migrate/20211031043641_create_people.rb
80
141
  - example/rails5/db/migrate/20211031052741_create_books.rb
142
+ - example/rails5/db/migrate/20211031170917_create_people.rb
81
143
  - example/rails5/db/schema.rb
82
144
  - example/rails5/db/seeds.rb
83
145
  - example/rails5/lib/tasks/.keep
@@ -91,15 +153,82 @@ files:
91
153
  - example/rails5/test/fixtures/books.yml
92
154
  - example/rails5/test/fixtures/files/.keep
93
155
  - example/rails5/test/fixtures/people.yml
94
- - example/rails5/test/integration/.keep
95
156
  - example/rails5/test/test_helper.rb
96
157
  - example/rails5/tmp/.keep
158
+ - example/rails6.0.0/.gitignore
159
+ - example/rails6.0.0/.ruby-version
160
+ - example/rails6.0.0/Gemfile
161
+ - example/rails6.0.0/README.md
162
+ - example/rails6.0.0/Rakefile
163
+ - example/rails6.0.0/app/channels/application_cable/channel.rb
164
+ - example/rails6.0.0/app/channels/application_cable/connection.rb
165
+ - example/rails6.0.0/app/controllers/application_controller.rb
166
+ - example/rails6.0.0/app/controllers/books_controller.rb
167
+ - example/rails6.0.0/app/controllers/concerns/.keep
168
+ - example/rails6.0.0/app/controllers/people_controller.rb
169
+ - example/rails6.0.0/app/jobs/application_job.rb
170
+ - example/rails6.0.0/app/mailers/application_mailer.rb
171
+ - example/rails6.0.0/app/models/application_record.rb
172
+ - example/rails6.0.0/app/models/book.rb
173
+ - example/rails6.0.0/app/models/concerns/.keep
174
+ - example/rails6.0.0/app/models/person.rb
175
+ - example/rails6.0.0/app/parameters/column.yml
176
+ - example/rails6.0.0/app/views/layouts/mailer.html.erb
177
+ - example/rails6.0.0/app/views/layouts/mailer.text.erb
178
+ - example/rails6.0.0/bin/bundle
179
+ - example/rails6.0.0/bin/rails
180
+ - example/rails6.0.0/bin/rake
181
+ - example/rails6.0.0/bin/setup
182
+ - example/rails6.0.0/bin/spring
183
+ - example/rails6.0.0/config.ru
184
+ - example/rails6.0.0/config/application.rb
185
+ - example/rails6.0.0/config/boot.rb
186
+ - example/rails6.0.0/config/cable.yml
187
+ - example/rails6.0.0/config/credentials.yml.enc
188
+ - example/rails6.0.0/config/database.yml
189
+ - example/rails6.0.0/config/environment.rb
190
+ - example/rails6.0.0/config/environments/development.rb
191
+ - example/rails6.0.0/config/environments/production.rb
192
+ - example/rails6.0.0/config/environments/test.rb
193
+ - example/rails6.0.0/config/initializers/application_controller_renderer.rb
194
+ - example/rails6.0.0/config/initializers/backtrace_silencers.rb
195
+ - example/rails6.0.0/config/initializers/cors.rb
196
+ - example/rails6.0.0/config/initializers/filter_parameter_logging.rb
197
+ - example/rails6.0.0/config/initializers/inflections.rb
198
+ - example/rails6.0.0/config/initializers/mime_types.rb
199
+ - example/rails6.0.0/config/initializers/wrap_parameters.rb
200
+ - example/rails6.0.0/config/locales/en.yml
201
+ - example/rails6.0.0/config/puma.rb
202
+ - example/rails6.0.0/config/routes.rb
203
+ - example/rails6.0.0/config/spring.rb
204
+ - example/rails6.0.0/config/storage.yml
205
+ - example/rails6.0.0/db/migrate/20211031165333_create_people.rb
206
+ - example/rails6.0.0/db/migrate/20211031165612_create_books.rb
207
+ - example/rails6.0.0/db/schema.rb
208
+ - example/rails6.0.0/db/seeds.rb
209
+ - example/rails6.0.0/lib/tasks/.keep
210
+ - example/rails6.0.0/log/.keep
211
+ - example/rails6.0.0/public/robots.txt
212
+ - example/rails6.0.0/storage/.keep
213
+ - example/rails6.0.0/test/channels/application_cable/connection_test.rb
214
+ - example/rails6.0.0/test/controllers/.keep
215
+ - example/rails6.0.0/test/controllers/books_controller_test.rb
216
+ - example/rails6.0.0/test/controllers/people_controller_test.rb
217
+ - example/rails6.0.0/test/fixtures/.keep
218
+ - example/rails6.0.0/test/fixtures/books.yml
219
+ - example/rails6.0.0/test/fixtures/files/.keep
220
+ - example/rails6.0.0/test/fixtures/people.yml
221
+ - example/rails6.0.0/test/integration/.keep
222
+ - example/rails6.0.0/test/test_helper.rb
223
+ - example/rails6.0.0/tmp/.keep
224
+ - example/rails6.0.0/tmp/pids/.keep
97
225
  - lib/yamls.rb
98
- - lib/yamls/config.rb
226
+ - lib/yamls/helpers/config.rb
227
+ - lib/yamls/helpers/yaml_load.rb
99
228
  - lib/yamls/parameters.rb
229
+ - lib/yamls/support.rb
100
230
  - lib/yamls/support/parameters.rb
101
231
  - lib/yamls/version.rb
102
- - lib/yamls/yaml_load.rb
103
232
  - yamls.gemspec
104
233
  homepage: https://github.com/TsuMakoto/yamls
105
234
  licenses: []
data/lib/yamls/config.rb DELETED
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
- module Yamls
3
- FILEPATH = "app/parameters/column.yml"
4
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
- module Yamls
3
- class YamlLoad
4
- def initialize(filepath, loader: YAML)
5
- @filepath = filepath
6
- @loader = loader
7
- end
8
-
9
- def load
10
- loader.load_file(filepath)
11
- end
12
-
13
- private
14
-
15
- attr_reader :filepath, :loader
16
- end
17
- end