script_core 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -1
  3. data/.gitignore +15 -1
  4. data/.rubocop.yml +10 -2
  5. data/.ruby-version +1 -1
  6. data/.travis.yml +6 -0
  7. data/Gemfile +32 -0
  8. data/README.md +169 -6
  9. data/Rakefile +11 -0
  10. data/Vagrantfile +1 -1
  11. data/bin/rails +25 -0
  12. data/bootstrap.sh +2 -3
  13. data/dev.yml +4 -4
  14. data/ext/enterprise_script_service/Rakefile +5 -4
  15. data/ext/enterprise_script_service/mruby_config.rb +1 -0
  16. data/lib/script_core.rb +17 -15
  17. data/lib/script_core/engine.rb +1 -0
  18. data/lib/script_core/executable.rb +1 -1
  19. data/lib/script_core/railtie.rb +8 -0
  20. data/lib/script_core/spawner.rb +1 -0
  21. data/lib/script_core/version.rb +1 -1
  22. data/lib/tasks/mruby/engine.gembox.example +19 -0
  23. data/lib/tasks/mruby/lib/.keep +0 -0
  24. data/lib/tasks/script_core.rake +111 -0
  25. data/script/regression +7 -5
  26. data/script_core.gemspec +2 -2
  27. data/spec/dummy/Rakefile +8 -0
  28. data/spec/dummy/app/assets/config/manifest.js +3 -0
  29. data/spec/dummy/app/assets/images/.keep +0 -0
  30. data/spec/dummy/app/assets/javascripts/application.es6 +56 -0
  31. data/spec/dummy/app/assets/stylesheets/application.scss +65 -0
  32. data/spec/dummy/app/controllers/application_controller.rb +4 -0
  33. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  34. data/spec/dummy/app/controllers/fields/application_controller.rb +25 -0
  35. data/spec/dummy/app/controllers/fields/options_controller.rb +26 -0
  36. data/spec/dummy/app/controllers/fields/validations_controller.rb +26 -0
  37. data/spec/dummy/app/controllers/forms/application_controller.rb +14 -0
  38. data/spec/dummy/app/controllers/forms/fields_controller.rb +56 -0
  39. data/spec/dummy/app/controllers/forms/formulas/application_controller.rb +19 -0
  40. data/spec/dummy/app/controllers/forms/formulas/playgrounds_controller.rb +29 -0
  41. data/spec/dummy/app/controllers/forms/formulas_controller.rb +56 -0
  42. data/spec/dummy/app/controllers/forms_controller.rb +58 -0
  43. data/spec/dummy/app/controllers/home_controller.rb +7 -0
  44. data/spec/dummy/app/controllers/nested_forms/application_controller.rb +12 -0
  45. data/spec/dummy/app/controllers/nested_forms/fields_controller.rb +50 -0
  46. data/spec/dummy/app/controllers/playgrounds_controller.rb +29 -0
  47. data/spec/dummy/app/decorators/.keep +0 -0
  48. data/spec/dummy/app/helpers/application_helper.rb +21 -0
  49. data/spec/dummy/app/helpers/fields_helper.rb +32 -0
  50. data/spec/dummy/app/helpers/forms_helper.rb +14 -0
  51. data/spec/dummy/app/jobs/application_job.rb +4 -0
  52. data/spec/dummy/app/lib/script_engine.rb +22 -0
  53. data/spec/dummy/app/models/application_record.rb +8 -0
  54. data/spec/dummy/app/models/concerns/.keep +0 -0
  55. data/spec/dummy/app/models/concerns/acts_as_default_value.rb +152 -0
  56. data/spec/dummy/app/models/concerns/enum_attribute_localizable.rb +32 -0
  57. data/spec/dummy/app/models/concerns/fields/validations/acceptance.rb +18 -0
  58. data/spec/dummy/app/models/concerns/fields/validations/confirmation.rb +18 -0
  59. data/spec/dummy/app/models/concerns/fields/validations/exclusion.rb +35 -0
  60. data/spec/dummy/app/models/concerns/fields/validations/format.rb +45 -0
  61. data/spec/dummy/app/models/concerns/fields/validations/inclusion.rb +35 -0
  62. data/spec/dummy/app/models/concerns/fields/validations/length.rb +59 -0
  63. data/spec/dummy/app/models/concerns/fields/validations/numericality.rb +56 -0
  64. data/spec/dummy/app/models/concerns/fields/validations/presence.rb +18 -0
  65. data/spec/dummy/app/models/concerns/form_core/acts_as_default_value.rb +143 -0
  66. data/spec/dummy/app/models/field.rb +67 -0
  67. data/spec/dummy/app/models/field_options.rb +90 -0
  68. data/spec/dummy/app/models/fields.rb +10 -0
  69. data/spec/dummy/app/models/fields/boolean_field.rb +12 -0
  70. data/spec/dummy/app/models/fields/decimal_field.rb +12 -0
  71. data/spec/dummy/app/models/fields/integer_field.rb +20 -0
  72. data/spec/dummy/app/models/fields/multiple_nested_form_field.rb +35 -0
  73. data/spec/dummy/app/models/fields/nested_form_field.rb +37 -0
  74. data/spec/dummy/app/models/fields/options/boolean_field.rb +6 -0
  75. data/spec/dummy/app/models/fields/options/decimal_field.rb +12 -0
  76. data/spec/dummy/app/models/fields/options/integer_field.rb +13 -0
  77. data/spec/dummy/app/models/fields/options/multiple_nested_form_field.rb +6 -0
  78. data/spec/dummy/app/models/fields/options/nested_form_field.rb +6 -0
  79. data/spec/dummy/app/models/fields/options/text_field.rb +7 -0
  80. data/spec/dummy/app/models/fields/text_field.rb +12 -0
  81. data/spec/dummy/app/models/fields/validations/boolean_field.rb +7 -0
  82. data/spec/dummy/app/models/fields/validations/decimal_field.rb +8 -0
  83. data/spec/dummy/app/models/fields/validations/integer_field.rb +8 -0
  84. data/spec/dummy/app/models/fields/validations/multiple_nested_form_field.rb +8 -0
  85. data/spec/dummy/app/models/fields/validations/nested_form_field.rb +7 -0
  86. data/spec/dummy/app/models/fields/validations/text_field.rb +9 -0
  87. data/spec/dummy/app/models/form.rb +8 -0
  88. data/spec/dummy/app/models/formula.rb +8 -0
  89. data/spec/dummy/app/models/metal_form.rb +9 -0
  90. data/spec/dummy/app/models/nested_form.rb +5 -0
  91. data/spec/dummy/app/models/virtual_model.rb +23 -0
  92. data/spec/dummy/app/presenters/application_presenter.rb +11 -0
  93. data/spec/dummy/app/presenters/concerns/fields/presenter_for_number_field.rb +36 -0
  94. data/spec/dummy/app/presenters/fields/boolean_field_presenter.rb +13 -0
  95. data/spec/dummy/app/presenters/fields/composite_field_presenter.rb +13 -0
  96. data/spec/dummy/app/presenters/fields/decimal_field_presenter.rb +7 -0
  97. data/spec/dummy/app/presenters/fields/field_presenter.rb +44 -0
  98. data/spec/dummy/app/presenters/fields/integer_field_presenter.rb +11 -0
  99. data/spec/dummy/app/presenters/fields/multiple_nested_form_field_presenter.rb +9 -0
  100. data/spec/dummy/app/presenters/fields/nested_form_field_presenter.rb +9 -0
  101. data/spec/dummy/app/presenters/fields/text_field_presenter.rb +10 -0
  102. data/spec/dummy/app/views/_form_core/field_options/_decimal_field.html.erb +9 -0
  103. data/spec/dummy/app/views/_form_core/field_options/_integer_field.html.erb +10 -0
  104. data/spec/dummy/app/views/_form_core/field_options/_text_field.html.erb +12 -0
  105. data/spec/dummy/app/views/_form_core/fields/_boolean_field.html.erb +11 -0
  106. data/spec/dummy/app/views/_form_core/fields/_decimal_field.html.erb +9 -0
  107. data/spec/dummy/app/views/_form_core/fields/_integer_field.html.erb +9 -0
  108. data/spec/dummy/app/views/_form_core/fields/_multiple_nested_form_field.html.erb +23 -0
  109. data/spec/dummy/app/views/_form_core/fields/_nested_form.html.erb +37 -0
  110. data/spec/dummy/app/views/_form_core/fields/_nested_form_field.html.erb +42 -0
  111. data/spec/dummy/app/views/_form_core/fields/_text_field.html.erb +13 -0
  112. data/spec/dummy/app/views/_form_core/preview/_form.html.erb +17 -0
  113. data/spec/dummy/app/views/_form_core/preview/_nested_form.html.erb +22 -0
  114. data/spec/dummy/app/views/_form_core/render/_form.html.erb +39 -0
  115. data/spec/dummy/app/views/_form_core/validations/_acceptance.html.erb +12 -0
  116. data/spec/dummy/app/views/_form_core/validations/_confirmation.html.erb +12 -0
  117. data/spec/dummy/app/views/_form_core/validations/_exclusion.html.erb +2 -0
  118. data/spec/dummy/app/views/_form_core/validations/_format.html.erb +37 -0
  119. data/spec/dummy/app/views/_form_core/validations/_inclusion.html.erb +2 -0
  120. data/spec/dummy/app/views/_form_core/validations/_length.html.erb +44 -0
  121. data/spec/dummy/app/views/_form_core/validations/_numericality.html.erb +45 -0
  122. data/spec/dummy/app/views/_form_core/validations/_presence.html.erb +12 -0
  123. data/spec/dummy/app/views/fields/options/_form.html.erb +29 -0
  124. data/spec/dummy/app/views/fields/options/edit.html.erb +6 -0
  125. data/spec/dummy/app/views/fields/validations/_form.html.erb +34 -0
  126. data/spec/dummy/app/views/fields/validations/edit.html.erb +6 -0
  127. data/spec/dummy/app/views/forms/_form.html.erb +41 -0
  128. data/spec/dummy/app/views/forms/edit.html.erb +6 -0
  129. data/spec/dummy/app/views/forms/fields/_form.html.erb +71 -0
  130. data/spec/dummy/app/views/forms/fields/edit.html.erb +6 -0
  131. data/spec/dummy/app/views/forms/fields/index.html.erb +42 -0
  132. data/spec/dummy/app/views/forms/fields/new.html.erb +6 -0
  133. data/spec/dummy/app/views/forms/formulas/_form.html.erb +41 -0
  134. data/spec/dummy/app/views/forms/formulas/edit.html.erb +6 -0
  135. data/spec/dummy/app/views/forms/formulas/index.html.erb +28 -0
  136. data/spec/dummy/app/views/forms/formulas/new.html.erb +6 -0
  137. data/spec/dummy/app/views/forms/formulas/playgrounds/create.html.erb +48 -0
  138. data/spec/dummy/app/views/forms/formulas/playgrounds/show.html.erb +14 -0
  139. data/spec/dummy/app/views/forms/index.html.erb +31 -0
  140. data/spec/dummy/app/views/forms/new.html.erb +6 -0
  141. data/spec/dummy/app/views/home/index.html.erb +5 -0
  142. data/spec/dummy/app/views/layouts/_alert.html.erb +4 -0
  143. data/spec/dummy/app/views/layouts/_footer.html.erb +13 -0
  144. data/spec/dummy/app/views/layouts/_nav.html.erb +11 -0
  145. data/spec/dummy/app/views/layouts/_notice.html.erb +4 -0
  146. data/spec/dummy/app/views/layouts/application.html.erb +25 -0
  147. data/spec/dummy/app/views/layouts/forms.html.erb +33 -0
  148. data/spec/dummy/app/views/nested_forms/fields/_form.html.erb +68 -0
  149. data/spec/dummy/app/views/nested_forms/fields/edit.html.erb +6 -0
  150. data/spec/dummy/app/views/nested_forms/fields/index.html.erb +39 -0
  151. data/spec/dummy/app/views/nested_forms/fields/new.html.erb +6 -0
  152. data/spec/dummy/app/views/playgrounds/_form.html.erb +13 -0
  153. data/spec/dummy/app/views/playgrounds/create.html.erb +51 -0
  154. data/spec/dummy/app/views/playgrounds/show.html.erb +7 -0
  155. data/spec/dummy/bin/bundle +5 -0
  156. data/spec/dummy/bin/rails +6 -0
  157. data/spec/dummy/bin/rake +6 -0
  158. data/spec/dummy/bin/setup +40 -0
  159. data/spec/dummy/bin/update +35 -0
  160. data/spec/dummy/bin/yarn +13 -0
  161. data/spec/dummy/config.ru +7 -0
  162. data/spec/dummy/config/application.rb +35 -0
  163. data/spec/dummy/config/boot.rb +7 -0
  164. data/spec/dummy/config/database.yml +25 -0
  165. data/spec/dummy/config/environment.rb +7 -0
  166. data/spec/dummy/config/environments/development.rb +58 -0
  167. data/spec/dummy/config/environments/production.rb +85 -0
  168. data/spec/dummy/config/environments/test.rb +41 -0
  169. data/spec/dummy/config/initializers/application_controller_renderer.rb +10 -0
  170. data/spec/dummy/config/initializers/assets.rb +16 -0
  171. data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -0
  172. data/spec/dummy/config/initializers/content_security_policy.rb +27 -0
  173. data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
  174. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
  175. data/spec/dummy/config/initializers/form_core.rb +4 -0
  176. data/spec/dummy/config/initializers/inflections.rb +18 -0
  177. data/spec/dummy/config/initializers/mime_types.rb +6 -0
  178. data/spec/dummy/config/initializers/wrap_parameters.rb +16 -0
  179. data/spec/dummy/config/locales/en.yml +33 -0
  180. data/spec/dummy/config/puma.rb +36 -0
  181. data/spec/dummy/config/routes.rb +31 -0
  182. data/spec/dummy/config/spring.rb +8 -0
  183. data/spec/dummy/config/storage.yml +34 -0
  184. data/spec/dummy/db/migrate/20180916202025_create_forms.form_core.rb +12 -0
  185. data/spec/dummy/db/migrate/20180916202026_add_columns_to_forms.rb +10 -0
  186. data/spec/dummy/db/migrate/20180916202027_add_attachable_to_forms.rb +9 -0
  187. data/spec/dummy/db/migrate/20180916202030_create_fields.form_core.rb +17 -0
  188. data/spec/dummy/db/migrate/20180916202121_add_columns_to_fields.rb +10 -0
  189. data/spec/dummy/db/migrate/20180916202124_add_position_to_fields.rb +9 -0
  190. data/spec/dummy/db/migrate/20181111111412_create_formulas.rb +13 -0
  191. data/spec/dummy/db/schema.rb +52 -0
  192. data/spec/dummy/lib/assets/.keep +0 -0
  193. data/spec/dummy/lib/monkey_patches/active_support.rb +3 -0
  194. data/spec/dummy/lib/monkey_patches/active_support/concern+prependable.rb +28 -0
  195. data/spec/dummy/lib/monkey_patches/big_decimal.rb +8 -0
  196. data/spec/dummy/log/.keep +0 -0
  197. data/spec/dummy/mruby/engine.gembox +19 -0
  198. data/spec/dummy/mruby/lib/.keep +0 -0
  199. data/spec/dummy/mruby/lib/core_ext.rb +62 -0
  200. data/spec/dummy/mruby/lib/harden.rb +1 -0
  201. data/spec/dummy/mruby/lib/input.rb +20 -0
  202. data/spec/dummy/mruby/lib/io.rb +19 -0
  203. data/spec/dummy/mruby/lib/output.rb +35 -0
  204. data/spec/dummy/mruby/lib/script_kernel.rb +12 -0
  205. data/spec/dummy/package.json +5 -0
  206. data/spec/dummy/public/404.html +67 -0
  207. data/spec/dummy/public/422.html +67 -0
  208. data/spec/dummy/public/500.html +66 -0
  209. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  210. data/spec/dummy/public/apple-touch-icon.png +0 -0
  211. data/spec/dummy/public/favicon.ico +0 -0
  212. data/spec/dummy/storage/.keep +0 -0
  213. data/spec/dummy/test/controllers/.keep +0 -0
  214. data/spec/dummy/test/fixtures/.keep +0 -0
  215. data/spec/dummy/test/models/.keep +0 -0
  216. data/spec/script_core_spec.rb +2 -2
  217. data/spec/spec_helper.rb +2 -2
  218. metadata +199 -5
  219. data/circle.yml +0 -9
@@ -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,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,58 @@
1
+ # frozen_string_literal: true
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 on
7
+ # every request. 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/disable caching. By default caching is disabled.
18
+ # Run rails dev:cache to toggle caching.
19
+ if Rails.root.join("tmp", "caching-dev.txt").exist?
20
+ config.action_controller.perform_caching = true
21
+
22
+ config.cache_store = :memory_store
23
+ config.public_file_server.headers = {
24
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
25
+ }
26
+ else
27
+ config.action_controller.perform_caching = false
28
+
29
+ config.cache_store = :null_store
30
+ end
31
+
32
+ # Store uploaded files on the local file system (see config/storage.yml for options)
33
+ # config.active_storage.service = :local
34
+
35
+ # Print deprecation notices to the Rails logger.
36
+ config.active_support.deprecation = :log
37
+
38
+ # Raise an error on page load if there are pending migrations.
39
+ config.active_record.migration_error = :page_load
40
+
41
+ # Highlight code that triggered database queries in logs.
42
+ config.active_record.verbose_query_logs = true
43
+
44
+ # Debug mode disables concatenation and preprocessing of assets.
45
+ # This option may cause significant delays in view rendering with a large
46
+ # number of complex assets.
47
+ config.assets.debug = true
48
+
49
+ # Suppress logger output for asset requests.
50
+ config.assets.quiet = true
51
+
52
+ # Raises error for missing translations
53
+ # config.action_view.raise_on_missing_translations = true
54
+
55
+ # Use an evented file watcher to asynchronously detect changes in source code,
56
+ # routes, locales, etc. This feature depends on the listen gem.
57
+ # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
58
+ end
@@ -0,0 +1,85 @@
1
+ # frozen_string_literal: true
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 JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
30
+
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
32
+ config.assets.compile = false
33
+
34
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
35
+
36
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
37
+ # config.action_controller.asset_host = 'http://assets.example.com'
38
+
39
+ # Specifies the header that your server uses for sending files.
40
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
41
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
42
+
43
+ # Store uploaded files on the local file system (see config/storage.yml for options)
44
+ # config.active_storage.service = :local
45
+
46
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
47
+ # config.force_ssl = true
48
+
49
+ # Use the lowest log level to ensure availability of diagnostic information
50
+ # when problems arise.
51
+ config.log_level = :debug
52
+
53
+ # Prepend all log lines with the following tags.
54
+ config.log_tags = [:request_id]
55
+
56
+ # Use a different cache store in production.
57
+ # config.cache_store = :mem_cache_store
58
+
59
+ # Use a real queuing backend for Active Job (and separate queues per environment)
60
+ # config.active_job.queue_adapter = :resque
61
+ # config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
62
+
63
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
64
+ # the I18n.default_locale when a translation cannot be found).
65
+ config.i18n.fallbacks = true
66
+
67
+ # Send deprecation notices to registered listeners.
68
+ config.active_support.deprecation = :notify
69
+
70
+ # Use default logging formatter so that PID and timestamp are not suppressed.
71
+ config.log_formatter = ::Logger::Formatter.new
72
+
73
+ # Use a different logger for distributed setups.
74
+ # require 'syslog/logger'
75
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
76
+
77
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
78
+ logger = ActiveSupport::Logger.new(STDOUT)
79
+ logger.formatter = config.log_formatter
80
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
81
+ end
82
+
83
+ # Do not dump schema after migrations.
84
+ config.active_record.dump_schema_after_migration = false
85
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # The test environment is used exclusively to run your application's
7
+ # test suite. You never need to work with it otherwise. Remember that
8
+ # your test database is "scratch space" for the test suite and is wiped
9
+ # and recreated between test runs. Don't rely on the data there!
10
+ config.cache_classes = true
11
+
12
+ # Do not eager load code on boot. This avoids loading your whole application
13
+ # just for the purpose of running a single test. If you are using a tool that
14
+ # preloads Rails for running tests, you may have to set it to true.
15
+ config.eager_load = false
16
+
17
+ # Configure public file server for tests with Cache-Control for performance.
18
+ config.public_file_server.enabled = true
19
+ config.public_file_server.headers = {
20
+ "Cache-Control" => "public, max-age=#{1.hour.to_i}"
21
+ }
22
+
23
+ # Show full error reports and disable caching.
24
+ config.consider_all_requests_local = true
25
+ config.action_controller.perform_caching = false
26
+
27
+ # Raise exceptions instead of rendering exception templates.
28
+ config.action_dispatch.show_exceptions = false
29
+
30
+ # Disable request forgery protection in test environment.
31
+ config.action_controller.allow_forgery_protection = false
32
+
33
+ # Store uploaded files on the local file system in a temporary directory
34
+ # config.active_storage.service = :test
35
+
36
+ # Print deprecation notices to the stderr.
37
+ config.active_support.deprecation = :stderr
38
+
39
+ # Raises error for missing translations
40
+ # config.action_view.raise_on_missing_translations = true
41
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # ActiveSupport::Reloader.to_prepare do
6
+ # ApplicationController.renderer.defaults.merge!(
7
+ # http_host: 'example.org',
8
+ # https: false
9
+ # )
10
+ # end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Version of your assets, change this if you want to expire all your assets.
6
+ Rails.application.config.assets.version = "1.0"
7
+
8
+ # Add additional assets to the asset load path.
9
+ # Rails.application.config.assets.paths << Emoji.images_path
10
+ # Add Yarn node_modules folder to the asset load path.
11
+ Rails.application.config.assets.paths << Rails.root.join("node_modules")
12
+
13
+ # Precompile additional assets.
14
+ # application.js, application.css, and all non-JS/CSS in the app/assets
15
+ # folder are already added.
16
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
6
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
7
+
8
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
9
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Define an application-wide content security policy
6
+ # For further information see the following documentation
7
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
8
+
9
+ # Rails.application.config.content_security_policy do |policy|
10
+ # policy.default_src :self, :https
11
+ # policy.font_src :self, :https, :data
12
+ # policy.img_src :self, :https, :data
13
+ # policy.object_src :none
14
+ # policy.script_src :self, :https
15
+ # policy.style_src :self, :https
16
+
17
+ # # Specify URI for violation reports
18
+ # # policy.report_uri "/csp-violation-report-endpoint"
19
+ # end
20
+
21
+ # If you are using UJS then enable automatic nonce generation
22
+ # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
23
+
24
+ # Report CSP violations to a specified URI
25
+ # For further information see the following documentation:
26
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
27
+ # Rails.application.config.content_security_policy_report_only = true
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Specify a serializer for the signed and encrypted cookie jars.
6
+ # Valid options are :json, :marshal, and :hybrid.
7
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Configure sensitive parameters which will be filtered from the log file.
6
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ FormCore.virtual_model_class = ::VirtualModel
4
+ FormCore.virtual_model_coder_class = FormCore::HashCoder
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add new inflection rules using the following format. Inflections
6
+ # are locale specific, and you may define rules for as many different
7
+ # locales as you wish. All of these examples are active by default:
8
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
9
+ # inflect.plural /^(ox)$/i, '\1en'
10
+ # inflect.singular /^(ox)en/i, '\1'
11
+ # inflect.irregular 'person', 'people'
12
+ # inflect.uncountable %w( fish sheep )
13
+ # end
14
+
15
+ # These inflection rules are supported but not enabled by default:
16
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
17
+ # inflect.acronym 'RESTful'
18
+ # end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add new mime types for use in respond_to blocks:
6
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # This file contains settings for ActionController::ParamsWrapper which
6
+ # is enabled by default.
7
+
8
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
9
+ ActiveSupport.on_load(:action_controller) do
10
+ wrap_parameters format: [:json]
11
+ end
12
+
13
+ # To enable root element in JSON for ActiveRecord objects.
14
+ # ActiveSupport.on_load(:active_record) do
15
+ # self.include_root_in_json = true
16
+ # 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 http://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Puma can serve each request in a thread from an internal thread pool.
4
+ # The `threads` method setting takes two numbers: a minimum and maximum.
5
+ # Any libraries that use thread pools should be configured to match
6
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
7
+ # and maximum; this matches the default thread size of Active Record.
8
+ #
9
+ threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
10
+ threads threads_count, threads_count
11
+
12
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
13
+ #
14
+ port ENV.fetch("PORT") { 3000 }
15
+
16
+ # Specifies the `environment` that Puma will run in.
17
+ #
18
+ environment ENV.fetch("RAILS_ENV") { "development" }
19
+
20
+ # Specifies the number of `workers` to boot in clustered mode.
21
+ # Workers are forked webserver processes. If using threads and workers together
22
+ # the concurrency of the application would be max `threads` * `workers`.
23
+ # Workers do not work on JRuby or Windows (both of which do not support
24
+ # processes).
25
+ #
26
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
27
+
28
+ # Use the `preload_app!` method when specifying a `workers` number.
29
+ # This directive tells Puma to first boot the application and load code
30
+ # before forking the application. This takes advantage of Copy On Write
31
+ # process behavior so workers use less memory.
32
+ #
33
+ # preload_app!
34
+
35
+ # Allow puma to be restarted by `rails restart` command.
36
+ plugin :tmp_restart
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.routes.draw do
4
+ root to: "home#index"
5
+
6
+ resource :playground, only: %i[show create]
7
+
8
+ resources :forms, except: %i[show] do
9
+ scope module: :forms do
10
+ resources :fields, except: %i[show]
11
+ resources :formulas, except: %i[show] do
12
+ scope module: :formulas do
13
+ resource :playground, only: %i[show create]
14
+ end
15
+ end
16
+ end
17
+ end
18
+
19
+ resources :fields, only: %i[] do
20
+ scope module: :fields do
21
+ resource :validations, only: %i[edit update]
22
+ resource :options, only: %i[edit update]
23
+ end
24
+ end
25
+
26
+ resources :nested_forms, only: %i[] do
27
+ scope module: :nested_forms do
28
+ resources :fields, except: %i[show]
29
+ end
30
+ end
31
+ end