hyper-kitten-tables 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +3 -0
  5. data/lib/hyper-kitten-tables.rb +6 -0
  6. data/lib/hyper_kitten_tables/components/table.rb +7 -0
  7. data/lib/hyper_kitten_tables/concerns/table.rb +134 -0
  8. data/lib/hyper_kitten_tables/engine.rb +5 -0
  9. data/lib/hyper_kitten_tables/version.rb +3 -0
  10. data/lib/tasks/tables_tasks.rake +4 -0
  11. data/spec/components/table_spec.rb +209 -0
  12. data/spec/dummy/Rakefile +6 -0
  13. data/spec/dummy/app/assets/config/manifest.js +3 -0
  14. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  15. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  16. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  17. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  18. data/spec/dummy/app/controllers/pages_controller.rb +3 -0
  19. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  20. data/spec/dummy/app/jobs/application_job.rb +7 -0
  21. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  22. data/spec/dummy/app/models/application_record.rb +3 -0
  23. data/spec/dummy/app/views/hyper_kitten_meow/pages/hardcoded_page.html.haml +4 -0
  24. data/spec/dummy/app/views/pages/app_hardcoded_page.html.haml +4 -0
  25. data/spec/dummy/app/views/pages/show.html.haml +3 -0
  26. data/spec/dummy/bin/rails +4 -0
  27. data/spec/dummy/bin/rake +4 -0
  28. data/spec/dummy/bin/setup +33 -0
  29. data/spec/dummy/config/application.rb +26 -0
  30. data/spec/dummy/config/boot.rb +5 -0
  31. data/spec/dummy/config/cable.yml +10 -0
  32. data/spec/dummy/config/database.yml +16 -0
  33. data/spec/dummy/config/environment.rb +5 -0
  34. data/spec/dummy/config/environments/development.rb +56 -0
  35. data/spec/dummy/config/environments/production.rb +93 -0
  36. data/spec/dummy/config/environments/test.rb +50 -0
  37. data/spec/dummy/config/initializers/assets.rb +12 -0
  38. data/spec/dummy/config/initializers/content_security_policy.rb +26 -0
  39. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
  40. data/spec/dummy/config/initializers/inflections.rb +16 -0
  41. data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
  42. data/spec/dummy/config/locales/en.yml +33 -0
  43. data/spec/dummy/config/puma.rb +43 -0
  44. data/spec/dummy/config/routes.rb +3 -0
  45. data/spec/dummy/config/storage.yml +34 -0
  46. data/spec/dummy/config.ru +6 -0
  47. data/spec/dummy/db/migrate/20220805173427_create_action_text_tables.action_text.rb +26 -0
  48. data/spec/dummy/db/migrate/20220805173748_create_active_storage_tables.active_storage.rb +57 -0
  49. data/spec/dummy/db/schema.rb +134 -0
  50. data/spec/dummy/db/seeds.rb +23 -0
  51. data/spec/dummy/log/development.log +12689 -0
  52. data/spec/dummy/log/test.log +58989 -0
  53. data/spec/dummy/public/404.html +67 -0
  54. data/spec/dummy/public/422.html +67 -0
  55. data/spec/dummy/public/500.html +66 -0
  56. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  57. data/spec/dummy/public/apple-touch-icon.png +0 -0
  58. data/spec/dummy/public/favicon.ico +0 -0
  59. data/spec/dummy/storage/it/lb/itlbn65dlnw20cu9ii6epg3qtr0h +0 -0
  60. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-16-58-13.777.html +148 -0
  61. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-16-59-53.965.html +148 -0
  62. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-00-42.481.html +148 -0
  63. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-01-02.940.html +229 -0
  64. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-03-02.450.html +229 -0
  65. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-03-17.782.html +148 -0
  66. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-03-57.376.html +229 -0
  67. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-07-53.996.html +232 -0
  68. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-13-29.891.html +232 -0
  69. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-13-56.197.html +232 -0
  70. data/spec/dummy/tmp/capybara/screenshot_2022-10-04-17-15-26.557.html +232 -0
  71. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-14-43-43.563.html +165 -0
  72. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-14-45-19.375.html +157 -0
  73. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.088.html +1 -0
  74. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.102.html +1 -0
  75. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.116.html +1 -0
  76. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.193.html +1 -0
  77. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-15-29-06.206.html +1 -0
  78. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-26-51.644.html +96 -0
  79. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-26-54.957.html +91 -0
  80. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-30-28.415.html +91 -0
  81. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-30-34.037.html +96 -0
  82. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-43-01.197.html +91 -0
  83. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-43-04.942.html +96 -0
  84. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-45-09.535.html +96 -0
  85. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-45-14.082.html +91 -0
  86. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-45-26.094.html +96 -0
  87. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-45-26.446.html +91 -0
  88. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-57-08.858.html +96 -0
  89. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-57-11.332.html +91 -0
  90. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-58-08.456.html +91 -0
  91. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-16-58-08.832.html +96 -0
  92. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-02-35.674.html +91 -0
  93. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-02-39.415.html +96 -0
  94. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-03-38.082.html +96 -0
  95. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-03-38.564.html +91 -0
  96. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-08.143.html +91 -0
  97. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-08.472.html +96 -0
  98. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-34.570.html +91 -0
  99. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-40.657.html +96 -0
  100. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-52.001.html +91 -0
  101. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-04-52.410.html +96 -0
  102. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-06-40.488.html +91 -0
  103. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-06-46.796.html +96 -0
  104. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-09-28.828.html +91 -0
  105. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-09-32.459.html +96 -0
  106. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-09-45.931.html +91 -0
  107. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-09-46.318.html +96 -0
  108. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-12-03.393.html +96 -0
  109. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-12-06.113.html +91 -0
  110. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-12-11.111.html +96 -0
  111. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-12-16.868.html +91 -0
  112. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-15-57.176.html +91 -0
  113. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-16-03.653.html +96 -0
  114. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-29-32.001.html +91 -0
  115. data/spec/dummy/tmp/capybara/screenshot_2022-10-05-17-29-34.702.html +96 -0
  116. data/spec/dummy/tmp/capybara/screenshot_2022-10-11-16-24-42.604.html +85 -0
  117. data/spec/dummy/tmp/capybara/screenshot_2022-10-11-16-25-08.753.html +76 -0
  118. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-02-02.769.html +0 -0
  119. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-08-16.549.html +0 -0
  120. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-09-06.988.html +0 -0
  121. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-10-02.456.html +0 -0
  122. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-12-58.767.html +0 -0
  123. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-13-38.946.html +0 -0
  124. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-20-23.040.html +0 -0
  125. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-22-40.972.html +31 -0
  126. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-30-50.210.html +31 -0
  127. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-31-41.216.html +31 -0
  128. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-42-03.223.html +31 -0
  129. data/spec/dummy/tmp/capybara/screenshot_2022-10-12-14-53-14.392.html +0 -0
  130. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-52-54.850.html +35 -0
  131. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-53-03.992.html +0 -0
  132. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-53-40.077.html +0 -0
  133. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-53-55.068.html +0 -0
  134. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-54-08.951.html +0 -0
  135. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-54-39.523.html +0 -0
  136. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-55-46.588.html +0 -0
  137. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-56-53.302.html +0 -0
  138. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-57-13.712.html +0 -0
  139. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-16-59-55.972.html +0 -0
  140. data/spec/dummy/tmp/capybara/screenshot_2022-10-18-17-04-32.815.html +0 -0
  141. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-45-56.483.html +1 -0
  142. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-51-45.853.html +54 -0
  143. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-56-35.870.html +1 -0
  144. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-58-42.872.html +1 -0
  145. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-19-59-53.565.html +1 -0
  146. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-25-51.194.html +1 -0
  147. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-27-18.607.html +1 -0
  148. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-34-14.915.html +1 -0
  149. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-34-23.967.html +1 -0
  150. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-35-20.693.html +0 -0
  151. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-38-57.780.html +1 -0
  152. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-39-59.478.html +1 -0
  153. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-40-32.807.html +0 -0
  154. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-40-42.311.html +1 -0
  155. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-41-40.038.html +1 -0
  156. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-43-18.794.html +1 -0
  157. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-45-22.057.html +9 -0
  158. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-46-07.622.html +1 -0
  159. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-46-23.810.html +1 -0
  160. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-46-42.443.html +9 -0
  161. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-47-03.378.html +1 -0
  162. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-49-38.206.html +1 -0
  163. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-49-53.697.html +1 -0
  164. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-50-25.359.html +1 -0
  165. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-50-43.146.html +9 -0
  166. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-51-18.812.html +54 -0
  167. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-51-55.591.html +78 -0
  168. data/spec/dummy/tmp/capybara/screenshot_2022-11-16-20-52-42.586.html +78 -0
  169. data/spec/dummy/tmp/development_secret.txt +1 -0
  170. data/spec/dummy/tmp/restart.txt +0 -0
  171. data/spec/features/admin/create_first_user_spec.rb +34 -0
  172. data/spec/features/admin/menu_management_spec.rb +137 -0
  173. data/spec/features/admin/page_management_spec.rb +73 -0
  174. data/spec/features/admin/post_management_spec.rb +80 -0
  175. data/spec/features/admin/users_management_spec.rb +65 -0
  176. data/spec/features/display_pages_spec.rb +45 -0
  177. data/spec/features/display_posts_spec.rb +0 -0
  178. data/spec/rails_helper.rb +13 -0
  179. metadata +502 -0
@@ -0,0 +1,56 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # In the development environment your application's code is reloaded any time
7
+ # it changes. This slows down response time but is perfect for development
8
+ # since you don't have to restart the web server when you make code changes.
9
+ config.cache_classes = false
10
+
11
+ # Do not eager load code on boot.
12
+ config.eager_load = false
13
+
14
+ # Show full error reports.
15
+ config.consider_all_requests_local = true
16
+
17
+ # Enable server timing
18
+ config.server_timing = true
19
+
20
+ # Enable/disable caching. By default caching is disabled.
21
+ # Run rails dev:cache to toggle caching.
22
+ if Rails.root.join("tmp/caching-dev.txt").exist?
23
+ config.action_controller.perform_caching = true
24
+ config.action_controller.enable_fragment_cache_logging = true
25
+
26
+ config.cache_store = :memory_store
27
+ config.public_file_server.headers = {
28
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
29
+ }
30
+ else
31
+ config.action_controller.perform_caching = false
32
+
33
+ config.cache_store = :null_store
34
+ end
35
+
36
+ # Print deprecation notices to the Rails logger.
37
+ config.active_support.deprecation = :log
38
+
39
+ # Raise exceptions for disallowed deprecations.
40
+ config.active_support.disallowed_deprecation = :raise
41
+
42
+ # Tell Active Support which deprecation messages to disallow.
43
+ config.active_support.disallowed_deprecation_warnings = []
44
+
45
+ # Suppress logger output for asset requests.
46
+ # config.assets.quiet = true
47
+
48
+ # Raises error for missing translations.
49
+ # config.i18n.raise_on_missing_translations = true
50
+
51
+ # Annotate rendered view with file names.
52
+ # config.action_view.annotate_rendered_view_with_filenames = true
53
+
54
+ # Uncomment if you wish to allow Action Cable access from any origin.
55
+ # config.action_cable.disable_request_forgery_protection = true
56
+ end
@@ -0,0 +1,93 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # Code is not reloaded between requests.
7
+ config.cache_classes = true
8
+
9
+ # Eager load code on boot. This eager loads most of Rails and
10
+ # your application in memory, allowing both threaded web servers
11
+ # and those relying on copy on write to perform better.
12
+ # Rake tasks automatically ignore this option for performance.
13
+ config.eager_load = true
14
+
15
+ # Full error reports are disabled and caching is turned on.
16
+ config.consider_all_requests_local = false
17
+ config.action_controller.perform_caching = true
18
+
19
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
20
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
21
+ # config.require_master_key = true
22
+
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
26
+
27
+ # Compress CSS using a preprocessor.
28
+ # config.assets.css_compressor = :sass
29
+
30
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
31
+ config.assets.compile = false
32
+
33
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
34
+ # config.asset_host = "http://assets.example.com"
35
+
36
+ # Specifies the header that your server uses for sending files.
37
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
38
+ # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
39
+
40
+ # Store uploaded files on the local file system (see config/storage.yml for options).
41
+ config.active_storage.service = :local
42
+
43
+ # Mount Action Cable outside main process or domain.
44
+ # config.action_cable.mount_path = nil
45
+ # config.action_cable.url = "wss://example.com/cable"
46
+ # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
47
+
48
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
49
+ # config.force_ssl = true
50
+
51
+ # Include generic and useful information about system operation, but avoid logging too much
52
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
53
+ config.log_level = :info
54
+
55
+ # Prepend all log lines with the following tags.
56
+ config.log_tags = [ :request_id ]
57
+
58
+ # Use a different cache store in production.
59
+ # config.cache_store = :mem_cache_store
60
+
61
+ # Use a real queuing backend for Active Job (and separate queues per environment).
62
+ # config.active_job.queue_adapter = :resque
63
+ # config.active_job.queue_name_prefix = "dummy_production"
64
+
65
+ config.action_mailer.perform_caching = false
66
+
67
+ # Ignore bad email addresses and do not raise email delivery errors.
68
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
69
+ # config.action_mailer.raise_delivery_errors = false
70
+
71
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72
+ # the I18n.default_locale when a translation cannot be found).
73
+ config.i18n.fallbacks = true
74
+
75
+ # Don't log any deprecations.
76
+ config.active_support.report_deprecations = false
77
+
78
+ # Use default logging formatter so that PID and timestamp are not suppressed.
79
+ config.log_formatter = ::Logger::Formatter.new
80
+
81
+ # Use a different logger for distributed setups.
82
+ # require "syslog/logger"
83
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
84
+
85
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
86
+ logger = ActiveSupport::Logger.new(STDOUT)
87
+ logger.formatter = config.log_formatter
88
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
89
+ end
90
+
91
+ # Do not dump schema after migrations.
92
+ config.active_record.dump_schema_after_migration = false
93
+ end
@@ -0,0 +1,50 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ # The test environment is used exclusively to run your application's
4
+ # test suite. You never need to work with it otherwise. Remember that
5
+ # your test database is "scratch space" for the test suite and is wiped
6
+ # and recreated between test runs. Don't rely on the data there!
7
+
8
+ Rails.application.configure do
9
+ # Settings specified here will take precedence over those in config/application.rb.
10
+
11
+ # Turn false under Spring and add config.action_view.cache_template_loading = true.
12
+ config.cache_classes = true
13
+
14
+ # Eager loading loads your whole application. When running a single test locally,
15
+ # this probably isn't necessary. It's a good idea to do in a continuous integration
16
+ # system, or in some way before deploying your code.
17
+ config.eager_load = ENV["CI"].present?
18
+
19
+ # Configure public file server for tests with Cache-Control for performance.
20
+ config.public_file_server.enabled = true
21
+ config.public_file_server.headers = {
22
+ "Cache-Control" => "public, max-age=#{1.hour.to_i}"
23
+ }
24
+
25
+ # Show full error reports and disable caching.
26
+ config.consider_all_requests_local = true
27
+ config.action_controller.perform_caching = false
28
+ config.cache_store = :null_store
29
+
30
+ # Raise exceptions instead of rendering exception templates.
31
+ config.action_dispatch.show_exceptions = false
32
+
33
+ # Disable request forgery protection in test environment.
34
+ config.action_controller.allow_forgery_protection = false
35
+
36
+ # Print deprecation notices to the stderr.
37
+ config.active_support.deprecation = :stderr
38
+
39
+ # Raise exceptions for disallowed deprecations.
40
+ config.active_support.disallowed_deprecation = :raise
41
+
42
+ # Tell Active Support which deprecation messages to disallow.
43
+ config.active_support.disallowed_deprecation_warnings = []
44
+
45
+ # Raises error for missing translations.
46
+ # config.i18n.raise_on_missing_translations = true
47
+
48
+ # Annotate rendered view with file names.
49
+ # config.action_view.annotate_rendered_view_with_filenames = true
50
+ end
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ # Rails.application.config.assets.version = "1.0"
5
+
6
+ # Add additional assets to the asset load path.
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in the app/assets
11
+ # folder are already added.
12
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,26 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy
4
+ # For further information see the following documentation
5
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6
+
7
+ # Rails.application.configure do
8
+ # config.content_security_policy do |policy|
9
+ # policy.default_src :self, :https
10
+ # policy.font_src :self, :https, :data
11
+ # policy.img_src :self, :https, :data
12
+ # policy.object_src :none
13
+ # policy.script_src :self, :https
14
+ # policy.style_src :self, :https
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+ #
19
+ # # Generate session nonces for permitted importmap and inline scripts
20
+ # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21
+ # config.content_security_policy_nonce_directives = %w(script-src)
22
+ #
23
+ # # Report CSP violations to a specified URI. See:
24
+ # # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
25
+ # # config.content_security_policy_report_only = true
26
+ # end
@@ -0,0 +1,6 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [
5
+ :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
6
+ ]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, "\\1en"
8
+ # inflect.singular /^(ox)en/i, "\\1"
9
+ # inflect.irregular "person", "people"
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym "RESTful"
16
+ # end
@@ -0,0 +1,11 @@
1
+ # Define an application-wide HTTP permissions policy. For further
2
+ # information see https://developers.google.com/web/updates/2018/06/feature-policy
3
+ #
4
+ # Rails.application.config.permissions_policy do |f|
5
+ # f.camera :none
6
+ # f.gyroscope :none
7
+ # f.microphone :none
8
+ # f.usb :none
9
+ # f.fullscreen :self
10
+ # f.payment :self, "https://secure.example.com"
11
+ # 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"
@@ -0,0 +1,43 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9
+ threads min_threads_count, max_threads_count
10
+
11
+ # Specifies the `worker_timeout` threshold that Puma will use to wait before
12
+ # terminating a worker in development environments.
13
+ #
14
+ worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
15
+
16
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
17
+ #
18
+ port ENV.fetch("PORT") { 3000 }
19
+
20
+ # Specifies the `environment` that Puma will run in.
21
+ #
22
+ environment ENV.fetch("RAILS_ENV") { "development" }
23
+
24
+ # Specifies the `pidfile` that Puma will use.
25
+ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
26
+
27
+ # Specifies the number of `workers` to boot in clustered mode.
28
+ # Workers are forked web server processes. If using threads and workers together
29
+ # the concurrency of the application would be max `threads` * `workers`.
30
+ # Workers do not work on JRuby or Windows (both of which do not support
31
+ # processes).
32
+ #
33
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
34
+
35
+ # Use the `preload_app!` method when specifying a `workers` number.
36
+ # This directive tells Puma to first boot the application and load code
37
+ # before forking the application. This takes advantage of Copy On Write
38
+ # process behavior so workers use less memory.
39
+ #
40
+ # preload_app!
41
+
42
+ # Allow puma to be restarted by `bin/rails restart` command.
43
+ plugin :tmp_restart
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ # mount HyperKittenTables::Engine => "/hyper-kitten-tables"
3
+ end
@@ -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 bin/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-<%= Rails.env %>
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-<%= Rails.env %>
23
+
24
+ # Use bin/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-<%= Rails.env %>
30
+
31
+ # mirror:
32
+ # service: Mirror
33
+ # primary: local
34
+ # mirrors: [ amazon, google, microsoft ]
@@ -0,0 +1,6 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative "config/environment"
4
+
5
+ run Rails.application
6
+ Rails.application.load_server
@@ -0,0 +1,26 @@
1
+ # This migration comes from action_text (originally 20180528164100)
2
+ class CreateActionTextTables < ActiveRecord::Migration[6.0]
3
+ def change
4
+ # Use Active Record's configured type for primary and foreign keys
5
+ primary_key_type, foreign_key_type = primary_and_foreign_key_types
6
+
7
+ create_table :action_text_rich_texts, id: primary_key_type do |t|
8
+ t.string :name, null: false
9
+ t.text :body, size: :long
10
+ t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
11
+
12
+ t.timestamps
13
+
14
+ t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true
15
+ end
16
+ end
17
+
18
+ private
19
+ def primary_and_foreign_key_types
20
+ config = Rails.configuration.generators
21
+ setting = config.options[config.orm][:primary_key_type]
22
+ primary_key_type = setting || :primary_key
23
+ foreign_key_type = setting || :bigint
24
+ [primary_key_type, foreign_key_type]
25
+ end
26
+ end
@@ -0,0 +1,57 @@
1
+ # This migration comes from active_storage (originally 20170806125915)
2
+ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
3
+ def change
4
+ # Use Active Record's configured type for primary and foreign keys
5
+ primary_key_type, foreign_key_type = primary_and_foreign_key_types
6
+
7
+ create_table :active_storage_blobs, id: primary_key_type do |t|
8
+ t.string :key, null: false
9
+ t.string :filename, null: false
10
+ t.string :content_type
11
+ t.text :metadata
12
+ t.string :service_name, null: false
13
+ t.bigint :byte_size, null: false
14
+ t.string :checksum
15
+
16
+ if connection.supports_datetime_with_precision?
17
+ t.datetime :created_at, precision: 6, null: false
18
+ else
19
+ t.datetime :created_at, null: false
20
+ end
21
+
22
+ t.index [ :key ], unique: true
23
+ end
24
+
25
+ create_table :active_storage_attachments, id: primary_key_type do |t|
26
+ t.string :name, null: false
27
+ t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
28
+ t.references :blob, null: false, type: foreign_key_type
29
+
30
+ if connection.supports_datetime_with_precision?
31
+ t.datetime :created_at, precision: 6, null: false
32
+ else
33
+ t.datetime :created_at, null: false
34
+ end
35
+
36
+ t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true
37
+ t.foreign_key :active_storage_blobs, column: :blob_id
38
+ end
39
+
40
+ create_table :active_storage_variant_records, id: primary_key_type do |t|
41
+ t.belongs_to :blob, null: false, index: false, type: foreign_key_type
42
+ t.string :variation_digest, null: false
43
+
44
+ t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true
45
+ t.foreign_key :active_storage_blobs, column: :blob_id
46
+ end
47
+ end
48
+
49
+ private
50
+ def primary_and_foreign_key_types
51
+ config = Rails.configuration.generators
52
+ setting = config.options[config.orm][:primary_key_type]
53
+ primary_key_type = setting || :primary_key
54
+ foreign_key_type = setting || :bigint
55
+ [primary_key_type, foreign_key_type]
56
+ end
57
+ end
@@ -0,0 +1,134 @@
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 `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/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[7.0].define(version: 2022_09_30_141953) do
14
+ # These are extensions that must be enabled in order to support this database
15
+ enable_extension "plpgsql"
16
+
17
+ create_table "action_text_rich_texts", force: :cascade do |t|
18
+ t.string "name", null: false
19
+ t.text "body"
20
+ t.string "record_type", null: false
21
+ t.bigint "record_id", null: false
22
+ t.datetime "created_at", null: false
23
+ t.datetime "updated_at", null: false
24
+ t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
25
+ end
26
+
27
+ create_table "active_storage_attachments", force: :cascade do |t|
28
+ t.string "name", null: false
29
+ t.string "record_type", null: false
30
+ t.bigint "record_id", null: false
31
+ t.bigint "blob_id", null: false
32
+ t.datetime "created_at", null: false
33
+ t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
34
+ t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
35
+ end
36
+
37
+ create_table "active_storage_blobs", force: :cascade do |t|
38
+ t.string "key", null: false
39
+ t.string "filename", null: false
40
+ t.string "content_type"
41
+ t.text "metadata"
42
+ t.string "service_name", null: false
43
+ t.bigint "byte_size", null: false
44
+ t.string "checksum"
45
+ t.datetime "created_at", null: false
46
+ t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
47
+ end
48
+
49
+ create_table "active_storage_variant_records", force: :cascade do |t|
50
+ t.bigint "blob_id", null: false
51
+ t.string "variation_digest", null: false
52
+ t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
53
+ end
54
+
55
+ create_table "categorical_taggings", force: :cascade do |t|
56
+ t.string "taggable_type"
57
+ t.bigint "taggable_id"
58
+ t.bigint "tag_id"
59
+ t.index ["tag_id"], name: "index_categorical_taggings_on_tag_id"
60
+ t.index ["taggable_type", "taggable_id"], name: "index_categorical_taggings_on_taggable"
61
+ end
62
+
63
+ create_table "categorical_tags", force: :cascade do |t|
64
+ t.string "label"
65
+ t.string "slug"
66
+ t.datetime "created_at", null: false
67
+ t.datetime "updated_at", null: false
68
+ t.index ["label"], name: "index_categorical_tags_on_label", unique: true
69
+ t.index ["slug"], name: "index_categorical_tags_on_slug", unique: true
70
+ end
71
+
72
+ create_table "hyper_kitten_meow_menu_items", force: :cascade do |t|
73
+ t.bigint "page_id"
74
+ t.bigint "menu_id", null: false
75
+ t.string "title"
76
+ t.string "url"
77
+ t.boolean "new_window", default: false, null: false
78
+ t.integer "position"
79
+ t.datetime "created_at", null: false
80
+ t.datetime "updated_at", null: false
81
+ t.index ["menu_id"], name: "index_hyper_kitten_meow_menu_items_on_menu_id"
82
+ t.index ["page_id"], name: "index_hyper_kitten_meow_menu_items_on_page_id"
83
+ end
84
+
85
+ create_table "hyper_kitten_meow_menus", force: :cascade do |t|
86
+ t.string "name"
87
+ t.string "slug", null: false
88
+ t.datetime "created_at", null: false
89
+ t.datetime "updated_at", null: false
90
+ t.index ["slug"], name: "index_hyper_kitten_meow_menus_on_slug"
91
+ end
92
+
93
+ create_table "hyper_kitten_meow_pages", force: :cascade do |t|
94
+ t.string "title"
95
+ t.boolean "published", default: false, null: false
96
+ t.datetime "published_at"
97
+ t.text "body"
98
+ t.string "slug"
99
+ t.datetime "created_at", null: false
100
+ t.datetime "updated_at", null: false
101
+ t.index ["slug"], name: "index_hyper_kitten_meow_pages_on_slug", unique: true
102
+ end
103
+
104
+ create_table "hyper_kitten_meow_posts", force: :cascade do |t|
105
+ t.string "title"
106
+ t.boolean "published", default: false, null: false
107
+ t.datetime "published_at"
108
+ t.text "summary"
109
+ t.text "body"
110
+ t.string "slug"
111
+ t.bigint "user_id"
112
+ t.datetime "created_at", null: false
113
+ t.datetime "updated_at", null: false
114
+ t.index ["slug"], name: "index_hyper_kitten_meow_posts_on_slug", unique: true
115
+ t.index ["user_id"], name: "index_hyper_kitten_meow_posts_on_user_id"
116
+ end
117
+
118
+ create_table "hyper_kitten_meow_users", force: :cascade do |t|
119
+ t.string "name"
120
+ t.string "email"
121
+ t.string "password_digest"
122
+ t.string "remember_digest"
123
+ t.datetime "created_at", null: false
124
+ t.datetime "updated_at", null: false
125
+ t.index ["email"], name: "index_hyper_kitten_meow_users_on_email", unique: true
126
+ end
127
+
128
+ add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
129
+ add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
130
+ add_foreign_key "categorical_taggings", "categorical_tags", column: "tag_id"
131
+ add_foreign_key "hyper_kitten_meow_menu_items", "hyper_kitten_meow_menus", column: "menu_id"
132
+ add_foreign_key "hyper_kitten_meow_menu_items", "hyper_kitten_meow_pages", column: "page_id"
133
+ add_foreign_key "hyper_kitten_meow_posts", "hyper_kitten_meow_users", column: "user_id"
134
+ end
@@ -0,0 +1,23 @@
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 rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
8
+ #
9
+ unless Rails.env == "test"
10
+ author = HyperKittenMeow::User.create!(
11
+ name: 'Admin',
12
+ email: 'admin@admin.admin',
13
+ password: 'adminadmin',
14
+ password_confirmation: 'adminadmin'
15
+ )
16
+
17
+ post_content = <<-POST
18
+ Hello
19
+ This is a post.
20
+ POST
21
+
22
+ HyperKittenMeow::Post.create!(title: 'Test Title', user: author, body: post_content, summary: post_content, published: true)
23
+ end