bootstrap_form 5.1.0 → 5.2.1
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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +21 -8
- data/.gitignore +4 -2
- data/.rubocop.yml +2 -1
- data/.yarnrc +5 -0
- data/CHANGELOG.md +13 -3
- data/CONTRIBUTING.md +101 -14
- data/Dangerfile +4 -4
- data/Dockerfile +5 -5
- data/Gemfile +5 -21
- data/README.md +108 -42
- data/RELEASING.md +12 -1
- data/Rakefile +7 -6
- data/bootstrap_form.gemspec +6 -8
- data/docker-compose.yml +6 -24
- data/gemfiles/6.0.gemfile +1 -1
- data/gemfiles/6.1.gemfile +1 -1
- data/gemfiles/7.0.gemfile +2 -3
- data/gemfiles/common.gemfile +28 -0
- data/gemfiles/edge.gemfile +3 -2
- data/lib/bootstrap_form/components/labels.rb +3 -9
- data/lib/bootstrap_form/components/validation.rb +36 -19
- data/lib/bootstrap_form/form_builder.rb +4 -1
- data/lib/bootstrap_form/form_group.rb +9 -6
- data/lib/bootstrap_form/form_group_builder.rb +10 -7
- data/lib/bootstrap_form/helpers/bootstrap.rb +7 -8
- data/lib/bootstrap_form/helpers/field.rb +26 -0
- data/lib/bootstrap_form/helpers.rb +1 -0
- data/lib/bootstrap_form/inputs/base.rb +2 -2
- data/lib/bootstrap_form/inputs/check_box.rb +22 -6
- data/lib/bootstrap_form/inputs/radio_button.rb +3 -3
- data/lib/bootstrap_form/inputs/range_field.rb +1 -1
- data/lib/bootstrap_form/inputs.rb +1 -1
- data/lib/bootstrap_form/version.rb +2 -1
- data/lib/bootstrap_form.rb +1 -1
- metadata +14 -146
- data/demo/.postcssrc.yml +0 -3
- data/demo/.ruby-version +0 -1
- data/demo/Gemfile +0 -80
- data/demo/Gemfile.lock +0 -261
- data/demo/Procfile.dev +0 -2
- data/demo/README.md +0 -17
- data/demo/Rakefile +0 -6
- data/demo/app/assets/builds/.keep +0 -0
- data/demo/app/assets/builds/application.js.LICENSE.txt +0 -9
- data/demo/app/assets/config/manifest.js +0 -2
- data/demo/app/assets/stylesheets/actiontext.css +0 -31
- data/demo/app/assets/stylesheets/actiontext.scss +0 -38
- data/demo/app/assets/stylesheets/application.scss +0 -1
- data/demo/app/controllers/application_controller.rb +0 -2
- data/demo/app/controllers/bootstrap_controller.rb +0 -29
- data/demo/app/controllers/users_controller.rb +0 -9
- data/demo/app/helpers/bootstrap_helper.rb +0 -27
- data/demo/app/javascript/application.js +0 -3
- data/demo/app/javascript/channels/consumer.js +0 -6
- data/demo/app/javascript/channels/index.js +0 -5
- data/demo/app/javascript/packs/application.js +0 -11
- data/demo/app/models/address.rb +0 -3
- data/demo/app/models/application_record.rb +0 -3
- data/demo/app/models/faux_user.rb +0 -9
- data/demo/app/models/skill.rb +0 -15
- data/demo/app/models/super_user.rb +0 -2
- data/demo/app/models/user.rb +0 -25
- data/demo/app/views/active_storage/blobs/_blob.html.erb +0 -14
- data/demo/app/views/bootstrap/form.html.erb +0 -67
- data/demo/app/views/layouts/action_text/contents/_content.html.erb +0 -3
- data/demo/app/views/layouts/application.html.erb +0 -76
- data/demo/bin/bundle +0 -3
- data/demo/bin/dev +0 -9
- data/demo/bin/rails +0 -4
- data/demo/bin/rake +0 -4
- data/demo/bin/setup +0 -36
- data/demo/bin/update +0 -31
- data/demo/bin/webpack +0 -15
- data/demo/bin/webpack-dev-server +0 -15
- data/demo/bin/yarn +0 -11
- data/demo/config/application.rb +0 -21
- data/demo/config/boot.rb +0 -5
- data/demo/config/database.yml +0 -21
- data/demo/config/environment.rb +0 -5
- data/demo/config/environments/development.rb +0 -60
- data/demo/config/environments/production.rb +0 -48
- data/demo/config/environments/test.rb +0 -46
- data/demo/config/initializers/application_controller_renderer.rb +0 -8
- data/demo/config/initializers/backtrace_silencers.rb +0 -7
- data/demo/config/initializers/cookies_serializer.rb +0 -5
- data/demo/config/initializers/filter_parameter_logging.rb +0 -4
- data/demo/config/initializers/inflections.rb +0 -16
- data/demo/config/initializers/mime_types.rb +0 -4
- data/demo/config/initializers/wrap_parameters.rb +0 -14
- data/demo/config/locales/en.yml +0 -33
- data/demo/config/puma.rb +0 -56
- data/demo/config/routes.rb +0 -6
- data/demo/config/spring.rb +0 -6
- data/demo/config/storage.yml +0 -35
- data/demo/config/webpack/development.js +0 -5
- data/demo/config/webpack/environment.js +0 -3
- data/demo/config/webpack/production.js +0 -5
- data/demo/config/webpack/test.js +0 -5
- data/demo/config/webpacker.yml +0 -92
- data/demo/config.ru +0 -5
- data/demo/db/schema.rb +0 -84
- data/demo/doc/screenshots/bootstrap/index/00_horizontal_form.png +0 -0
- data/demo/doc/screenshots/bootstrap/index/01_with_validation_error.png +0 -0
- data/demo/doc/screenshots/bootstrap/index/02_inline_form.png +0 -0
- data/demo/doc/screenshots/bootstrap/index/03_simple_action_text_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/index/04_floating_labels.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/00_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/01_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/02_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/03_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/04_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/05_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/06_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/07_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/08_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/09_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/10_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/11_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/12_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/13_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/14_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/15_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/16_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/17_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/18_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/19_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/20_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/21_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/22_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/23_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/24_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/25_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/26_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/27_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/28_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/29_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/30_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/31_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/32_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/33_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/34_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/35_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/36_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/37_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/38_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/39_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/40_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/41_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/42_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/43_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/44_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/45_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/46_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/47_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/48_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/49_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/50_example.png +0 -0
- data/demo/log/.keep +0 -0
- data/demo/package.json +0 -21
- data/demo/public/favicon.ico +0 -0
- data/demo/test/application_system_test_case.rb +0 -8
- data/demo/test/controllers/bootstrap_controller_test.rb +0 -8
- data/demo/test/controllers/users_controller_test.rb +0 -13
- data/demo/test/fixtures/action_text/rich_texts.yml +0 -4
- data/demo/test/fixtures/users.yml +0 -2
- data/demo/test/system/bootstrap_test.rb +0 -84
- data/demo/test/test_helper.rb +0 -10
- data/demo/webpack.config.js +0 -20
- data/demo/yarn.lock +0 -7176
- data/gemfiles/5.2.gemfile +0 -4
data/demo/config/puma.rb
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
|
|
8
|
-
threads threads_count, threads_count
|
|
9
|
-
|
|
10
|
-
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
|
11
|
-
#
|
|
12
|
-
port ENV.fetch("PORT", 3000)
|
|
13
|
-
|
|
14
|
-
# Specifies the `environment` that Puma will run in.
|
|
15
|
-
#
|
|
16
|
-
environment ENV.fetch("RAILS_ENV") { "development" }
|
|
17
|
-
|
|
18
|
-
# Specifies the number of `workers` to boot in clustered mode.
|
|
19
|
-
# Workers are forked webserver processes. If using threads and workers together
|
|
20
|
-
# the concurrency of the application would be max `threads` * `workers`.
|
|
21
|
-
# Workers do not work on JRuby or Windows (both of which do not support
|
|
22
|
-
# processes).
|
|
23
|
-
#
|
|
24
|
-
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
|
25
|
-
|
|
26
|
-
# Use the `preload_app!` method when specifying a `workers` number.
|
|
27
|
-
# This directive tells Puma to first boot the application and load code
|
|
28
|
-
# before forking the application. This takes advantage of Copy On Write
|
|
29
|
-
# process behavior so workers use less memory. If you use this option
|
|
30
|
-
# you need to make sure to reconnect any threads in the `on_worker_boot`
|
|
31
|
-
# block.
|
|
32
|
-
#
|
|
33
|
-
# preload_app!
|
|
34
|
-
|
|
35
|
-
# If you are preloading your application and using Active Record, it's
|
|
36
|
-
# recommended that you close any connections to the database before workers
|
|
37
|
-
# are forked to prevent connection leakage.
|
|
38
|
-
#
|
|
39
|
-
# before_fork do
|
|
40
|
-
# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
|
|
41
|
-
# end
|
|
42
|
-
|
|
43
|
-
# The code in the `on_worker_boot` will be called if you are using
|
|
44
|
-
# clustered mode by specifying a number of `workers`. After each worker
|
|
45
|
-
# process is booted, this block will be run. If you are using the `preload_app!`
|
|
46
|
-
# option, you will want to use this block to reconnect to any threads
|
|
47
|
-
# or connections that may have been created at application boot, as Ruby
|
|
48
|
-
# cannot share connections between processes.
|
|
49
|
-
#
|
|
50
|
-
# on_worker_boot do
|
|
51
|
-
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
|
52
|
-
# end
|
|
53
|
-
#
|
|
54
|
-
|
|
55
|
-
# Allow puma to be restarted by `rails restart` command.
|
|
56
|
-
plugin :tmp_restart
|
data/demo/config/routes.rb
DELETED
data/demo/config/spring.rb
DELETED
data/demo/config/storage.yml
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
# keyfile: <%= 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
|
-
# path: your_azure_storage_path
|
|
28
|
-
# storage_account_name: your_account_name
|
|
29
|
-
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
|
30
|
-
# container: your_container_name
|
|
31
|
-
|
|
32
|
-
# mirror:
|
|
33
|
-
# service: Mirror
|
|
34
|
-
# primary: local
|
|
35
|
-
# mirrors: [ amazon, google, microsoft ]
|
data/demo/config/webpack/test.js
DELETED
data/demo/config/webpacker.yml
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
|
2
|
-
|
|
3
|
-
default: &default
|
|
4
|
-
source_path: app/javascript
|
|
5
|
-
source_entry_path: packs
|
|
6
|
-
public_root_path: public
|
|
7
|
-
public_output_path: packs
|
|
8
|
-
cache_path: tmp/cache/webpacker
|
|
9
|
-
check_yarn_integrity: false
|
|
10
|
-
webpack_compile_output: false
|
|
11
|
-
|
|
12
|
-
# Additional paths webpack should lookup modules
|
|
13
|
-
# ['app/assets', 'engine/foo/app/assets']
|
|
14
|
-
resolved_paths: []
|
|
15
|
-
|
|
16
|
-
# Reload manifest.json on all requests so we reload latest compiled packs
|
|
17
|
-
cache_manifest: false
|
|
18
|
-
|
|
19
|
-
# Extract and emit a css file
|
|
20
|
-
extract_css: false
|
|
21
|
-
|
|
22
|
-
static_assets_extensions:
|
|
23
|
-
- .jpg
|
|
24
|
-
- .jpeg
|
|
25
|
-
- .png
|
|
26
|
-
- .gif
|
|
27
|
-
- .tiff
|
|
28
|
-
- .ico
|
|
29
|
-
- .svg
|
|
30
|
-
- .eot
|
|
31
|
-
- .otf
|
|
32
|
-
- .ttf
|
|
33
|
-
- .woff
|
|
34
|
-
- .woff2
|
|
35
|
-
extensions:
|
|
36
|
-
- .mjs
|
|
37
|
-
- .js
|
|
38
|
-
- .sass
|
|
39
|
-
- .scss
|
|
40
|
-
- .css
|
|
41
|
-
- .module.sass
|
|
42
|
-
- .module.scss
|
|
43
|
-
- .module.css
|
|
44
|
-
- .png
|
|
45
|
-
- .svg
|
|
46
|
-
- .gif
|
|
47
|
-
- .jpeg
|
|
48
|
-
- .jpg
|
|
49
|
-
|
|
50
|
-
development:
|
|
51
|
-
<<: *default
|
|
52
|
-
compile: true
|
|
53
|
-
|
|
54
|
-
# Verifies that versions and hashed value of the package contents in the project's package.json
|
|
55
|
-
check_yarn_integrity: true
|
|
56
|
-
# Reference: https://webpack.js.org/configuration/dev-server/
|
|
57
|
-
dev_server:
|
|
58
|
-
https: false
|
|
59
|
-
host: localhost
|
|
60
|
-
port: 3035
|
|
61
|
-
public: localhost:3035
|
|
62
|
-
hmr: false
|
|
63
|
-
# Inline should be set to true if using HMR
|
|
64
|
-
inline: true
|
|
65
|
-
overlay: true
|
|
66
|
-
compress: true
|
|
67
|
-
disable_host_check: true
|
|
68
|
-
use_local_ip: false
|
|
69
|
-
quiet: false
|
|
70
|
-
headers:
|
|
71
|
-
'Access-Control-Allow-Origin': '*'
|
|
72
|
-
watch_options:
|
|
73
|
-
ignored: '**/node_modules/**'
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
test:
|
|
77
|
-
<<: *default
|
|
78
|
-
compile: true
|
|
79
|
-
|
|
80
|
-
# Compile test packs to a separate directory
|
|
81
|
-
public_output_path: packs-test
|
|
82
|
-
|
|
83
|
-
production:
|
|
84
|
-
<<: *default
|
|
85
|
-
|
|
86
|
-
# Production depends on precompilation of packs prior to booting for performance.
|
|
87
|
-
compile: false
|
|
88
|
-
# Extract and emit a css file
|
|
89
|
-
extract_css: true
|
|
90
|
-
|
|
91
|
-
# Cache manifest.json for performance
|
|
92
|
-
cache_manifest: true
|
data/demo/config.ru
DELETED
data/demo/db/schema.rb
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
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.define(version: 2022_01_09_230956) do
|
|
14
|
-
|
|
15
|
-
create_table "action_text_rich_texts", force: :cascade do |t|
|
|
16
|
-
t.string "name", null: false
|
|
17
|
-
t.text "body"
|
|
18
|
-
t.string "record_type", null: false
|
|
19
|
-
t.bigint "record_id", null: false
|
|
20
|
-
t.datetime "created_at", precision: 6, null: false
|
|
21
|
-
t.datetime "updated_at", precision: 6, null: false
|
|
22
|
-
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
create_table "active_storage_attachments", force: :cascade do |t|
|
|
26
|
-
t.string "name", null: false
|
|
27
|
-
t.string "record_type", null: false
|
|
28
|
-
t.bigint "record_id", null: false
|
|
29
|
-
t.bigint "blob_id", null: false
|
|
30
|
-
t.datetime "created_at", precision: 6, null: false
|
|
31
|
-
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
|
32
|
-
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
create_table "active_storage_blobs", force: :cascade do |t|
|
|
36
|
-
t.string "key", null: false
|
|
37
|
-
t.string "filename", null: false
|
|
38
|
-
t.string "content_type"
|
|
39
|
-
t.text "metadata"
|
|
40
|
-
t.string "service_name", null: false
|
|
41
|
-
t.bigint "byte_size", null: false
|
|
42
|
-
t.string "checksum"
|
|
43
|
-
t.datetime "created_at", precision: 6, null: false
|
|
44
|
-
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
create_table "active_storage_variant_records", force: :cascade do |t|
|
|
48
|
-
t.bigint "blob_id", null: false
|
|
49
|
-
t.string "variation_digest", null: false
|
|
50
|
-
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
create_table "addresses", force: :cascade do |t|
|
|
54
|
-
t.integer "user_id"
|
|
55
|
-
t.string "street"
|
|
56
|
-
t.string "city"
|
|
57
|
-
t.string "state"
|
|
58
|
-
t.string "zip_code"
|
|
59
|
-
t.datetime "created_at", precision: 6, null: false
|
|
60
|
-
t.datetime "updated_at", precision: 6, null: false
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
create_table "bogons", force: :cascade do |t|
|
|
64
|
-
t.datetime "created_at", precision: 6, null: false
|
|
65
|
-
t.datetime "updated_at", precision: 6, null: false
|
|
66
|
-
t.integer "food_waste_main"
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
create_table "users", force: :cascade do |t|
|
|
70
|
-
t.string "email"
|
|
71
|
-
t.string "password"
|
|
72
|
-
t.text "comments"
|
|
73
|
-
t.string "status"
|
|
74
|
-
t.string "misc"
|
|
75
|
-
t.text "preferences"
|
|
76
|
-
t.boolean "terms", default: false
|
|
77
|
-
t.string "type"
|
|
78
|
-
t.datetime "created_at", precision: 6, null: false
|
|
79
|
-
t.datetime "updated_at", precision: 6, null: false
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
|
83
|
-
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
|
84
|
-
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/demo/log/.keep
DELETED
|
File without changes
|
data/demo/package.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dummy",
|
|
3
|
-
"private": true,
|
|
4
|
-
"dependencies": {
|
|
5
|
-
"@rails/actioncable": "^6.1.0",
|
|
6
|
-
"@rails/actiontext": "^6.1.0",
|
|
7
|
-
"@rails/activestorage": "^6.1.0",
|
|
8
|
-
"@rails/ujs": "^6.1.0",
|
|
9
|
-
"@rails/webpacker": "^5.0.0",
|
|
10
|
-
"trix": "^1.0.0",
|
|
11
|
-
"turbolinks": "^5.2.0"
|
|
12
|
-
},
|
|
13
|
-
"version": "0.1.0",
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"webpack-dev-server": "^4.0.0"
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "webpack --config webpack.config.js",
|
|
19
|
-
"build:css": "webpack --config webpack.config.js"
|
|
20
|
-
}
|
|
21
|
-
}
|
data/demo/public/favicon.ico
DELETED
|
File without changes
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
require "test_helper"
|
|
2
|
-
|
|
3
|
-
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
|
4
|
-
include Capybara::Screenshot::Diff
|
|
5
|
-
driven_by :selenium, using: :headless_chrome, screen_size: [960, 720] do |capabilities|
|
|
6
|
-
capabilities.add_argument "force-device-scale-factor=1"
|
|
7
|
-
end
|
|
8
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
require "test_helper"
|
|
2
|
-
|
|
3
|
-
class UsersControllerTest < ActionDispatch::IntegrationTest
|
|
4
|
-
test "should post create" do
|
|
5
|
-
post users_url
|
|
6
|
-
assert_redirected_to root_path
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
test "should patch update" do
|
|
10
|
-
patch user_url(users(:one))
|
|
11
|
-
assert_redirected_to root_path
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
require "application_system_test_case"
|
|
2
|
-
|
|
3
|
-
class BootstrapTest < ApplicationSystemTestCase
|
|
4
|
-
setup { screenshot_section :bootstrap }
|
|
5
|
-
|
|
6
|
-
test "visiting the index" do
|
|
7
|
-
screenshot_group :index
|
|
8
|
-
visit root_url
|
|
9
|
-
|
|
10
|
-
all(".toggle").each { |btn| execute_script "arguments[0].remove()", btn }
|
|
11
|
-
|
|
12
|
-
all("h3").each do |header|
|
|
13
|
-
example = header.first(:xpath, "./following-sibling::div")
|
|
14
|
-
scroll_to example
|
|
15
|
-
sleep 0.5
|
|
16
|
-
screenshot header.text.downcase.tr(" ", "_"), crop: bounds(example), color_distance_limit: 2
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
HEADERS = ["Generated HTML", "This generates", "Which outputs", "will be rendered as"].join("|").freeze
|
|
21
|
-
REGEXP =
|
|
22
|
-
/(?:!\[[^\]]*\]\([^)]+\)\s*)?```erb\n(.*?)\n```\s*((?:#{HEADERS}).*?$)?\s*(```html\n(?:.*?)\n```\s*)?/mi
|
|
23
|
-
.freeze
|
|
24
|
-
test "readme examples" do
|
|
25
|
-
screenshot_group :readme
|
|
26
|
-
|
|
27
|
-
readme = File.read(File.expand_path("../../../README.md", __dir__))
|
|
28
|
-
augmented_readme = readme.gsub(REGEXP) do |_|
|
|
29
|
-
erb = Regexp.last_match(1)
|
|
30
|
-
header = Regexp.last_match(2)
|
|
31
|
-
unless /\A<%= bootstrap[^>]*>\n\s*...\s*<% end %>\z/.match? erb
|
|
32
|
-
wrapped_erb = erb.starts_with?("<%= bootstrap") ? erb : <<~ERB
|
|
33
|
-
<%= bootstrap_form_with model: @user do |f| %>
|
|
34
|
-
#{erb}
|
|
35
|
-
<% end %>
|
|
36
|
-
ERB
|
|
37
|
-
|
|
38
|
-
visit fragment_path erb: wrapped_erb
|
|
39
|
-
wrapper = find(".p-3")
|
|
40
|
-
i = @screenshot_counter
|
|
41
|
-
screenshot :example, crop: bounds(wrapper)
|
|
42
|
-
wrapper = wrapper.find("form") if wrapped_erb != erb
|
|
43
|
-
html = wrapper["innerHTML"].strip.gsub("><", ">\n<")
|
|
44
|
-
assert html.present?, erb
|
|
45
|
-
doc = Nokogiri::HTML.fragment(html)
|
|
46
|
-
doc.traverse do |node|
|
|
47
|
-
if node.is_a?(Nokogiri::XML::Element)
|
|
48
|
-
node.attributes.sort_by(&:first).each do |name, value|
|
|
49
|
-
node.delete(name)
|
|
50
|
-
node[name] = value
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
html = doc.to_html
|
|
55
|
-
image = <<~MD
|
|
56
|
-
}_example.png "Example #{i}")
|
|
57
|
-
MD
|
|
58
|
-
html = <<~MD
|
|
59
|
-
|
|
60
|
-
#{header || 'Generated HTML:'}
|
|
61
|
-
|
|
62
|
-
```html
|
|
63
|
-
#{HtmlBeautifier.beautify(html)}
|
|
64
|
-
```
|
|
65
|
-
MD
|
|
66
|
-
end
|
|
67
|
-
<<~MD
|
|
68
|
-
#{image}```erb
|
|
69
|
-
#{erb}
|
|
70
|
-
```
|
|
71
|
-
#{html}
|
|
72
|
-
MD
|
|
73
|
-
end
|
|
74
|
-
augmented_readme.gsub!(/127.0.0.1:\d+/, "test.host")
|
|
75
|
-
File.write(File.expand_path("../../../README.md", __dir__), augmented_readme)
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
private
|
|
79
|
-
|
|
80
|
-
def bounds(node)
|
|
81
|
-
client_rect = evaluate_script("arguments[0].getBoundingClientRect()", node.native)
|
|
82
|
-
[client_rect["left"].floor, client_rect["top"].floor, client_rect["right"].ceil, client_rect["bottom"].ceil]
|
|
83
|
-
end
|
|
84
|
-
end
|
data/demo/test/test_helper.rb
DELETED
data/demo/webpack.config.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const path = require("path")
|
|
2
|
-
const webpack = require("webpack")
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
mode: "production",
|
|
6
|
-
devtool: "source-map",
|
|
7
|
-
entry: {
|
|
8
|
-
application: "./app/javascript/application.js"
|
|
9
|
-
},
|
|
10
|
-
output: {
|
|
11
|
-
filename: "[name].js",
|
|
12
|
-
sourceMapFilename: "[name].js.map",
|
|
13
|
-
path: path.resolve(__dirname, "app/assets/builds"),
|
|
14
|
-
},
|
|
15
|
-
plugins: [
|
|
16
|
-
new webpack.optimize.LimitChunkCountPlugin({
|
|
17
|
-
maxChunks: 1
|
|
18
|
-
})
|
|
19
|
-
]
|
|
20
|
-
}
|