bard-file_field 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +7 -0
  2. data/.nvmrc +1 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +8 -0
  6. data/Gemfile.lock +98 -0
  7. data/LICENSE +21 -0
  8. data/README.md +29 -0
  9. data/Rakefile +4 -0
  10. data/app/assets/javascripts/bard-file.js +4913 -0
  11. data/app/controllers/bard/file_field/blobs_controller.rb +11 -0
  12. data/bard-file/.gitignore +1 -0
  13. data/bard-file/bun.lockb +0 -0
  14. data/bard-file/index.js +2 -0
  15. data/bard-file/package.json +20 -0
  16. data/bard-file/rollup.config.js +26 -0
  17. data/bard-file_field.gemspec +34 -0
  18. data/config/routes.rb +6 -0
  19. data/dummy/.gitattributes +7 -0
  20. data/dummy/.gitignore +36 -0
  21. data/dummy/Gemfile +29 -0
  22. data/dummy/Gemfile.lock +353 -0
  23. data/dummy/README.md +24 -0
  24. data/dummy/Rakefile +13 -0
  25. data/dummy/app/assets/config/manifest.js +3 -0
  26. data/dummy/app/assets/images/.keep +0 -0
  27. data/dummy/app/assets/stylesheets/application.css +22 -0
  28. data/dummy/app/controllers/application_controller.rb +2 -0
  29. data/dummy/app/controllers/concerns/.keep +0 -0
  30. data/dummy/app/controllers/edge_cases_controller.rb +23 -0
  31. data/dummy/app/controllers/posts_controller.rb +33 -0
  32. data/dummy/app/controllers/validations_controller.rb +18 -0
  33. data/dummy/app/helpers/application_helper.rb +2 -0
  34. data/dummy/app/javascript/application.js +2 -0
  35. data/dummy/app/javascript/controllers/application.js +9 -0
  36. data/dummy/app/javascript/controllers/index.js +11 -0
  37. data/dummy/app/models/application_record.rb +3 -0
  38. data/dummy/app/models/concerns/.keep +0 -0
  39. data/dummy/app/models/post.rb +9 -0
  40. data/dummy/app/views/edge_cases/rails_validation_error.html.erb +16 -0
  41. data/dummy/app/views/layouts/application.html.erb +18 -0
  42. data/dummy/app/views/layouts/mailer.html.erb +13 -0
  43. data/dummy/app/views/layouts/mailer.text.erb +1 -0
  44. data/dummy/app/views/posts/form.html.erb +39 -0
  45. data/dummy/app/views/posts/show.html.erb +16 -0
  46. data/dummy/app/views/validations/form.html.erb +19 -0
  47. data/dummy/app/views/validations/optional_file.html.erb +10 -0
  48. data/dummy/app/views/validations/optional_file_with_max_size.html.erb +10 -0
  49. data/dummy/app/views/validations/optional_image.html.erb +10 -0
  50. data/dummy/app/views/validations/required_file.html.erb +10 -0
  51. data/dummy/app/views/validations/required_media.html.erb +10 -0
  52. data/dummy/bin/bundle +114 -0
  53. data/dummy/bin/importmap +4 -0
  54. data/dummy/bin/rails +4 -0
  55. data/dummy/bin/rake +4 -0
  56. data/dummy/bin/setup +33 -0
  57. data/dummy/config/application.rb +22 -0
  58. data/dummy/config/boot.rb +4 -0
  59. data/dummy/config/cable.yml +10 -0
  60. data/dummy/config/credentials.yml.enc +1 -0
  61. data/dummy/config/cucumber.yml +2 -0
  62. data/dummy/config/database.yml +25 -0
  63. data/dummy/config/environment.rb +5 -0
  64. data/dummy/config/environments/development.rb +70 -0
  65. data/dummy/config/environments/production.rb +93 -0
  66. data/dummy/config/environments/test.rb +60 -0
  67. data/dummy/config/importmap.rb +4 -0
  68. data/dummy/config/initializers/assets.rb +12 -0
  69. data/dummy/config/initializers/content_security_policy.rb +25 -0
  70. data/dummy/config/initializers/filter_parameter_logging.rb +8 -0
  71. data/dummy/config/initializers/inflections.rb +16 -0
  72. data/dummy/config/initializers/permissions_policy.rb +11 -0
  73. data/dummy/config/locales/en.yml +33 -0
  74. data/dummy/config/puma.rb +43 -0
  75. data/dummy/config/routes.rb +7 -0
  76. data/dummy/config/storage.yml +34 -0
  77. data/dummy/config.ru +6 -0
  78. data/dummy/db/migrate/20231013175203_create_posts.rb +8 -0
  79. data/dummy/db/migrate/20231013175257_create_active_storage_tables.active_storage.rb +57 -0
  80. data/dummy/db/migrate/20231102131420_add_name_to_posts.rb +5 -0
  81. data/dummy/db/schema.rb +50 -0
  82. data/dummy/db/seeds.rb +7 -0
  83. data/dummy/features/edge_cases.feature +17 -0
  84. data/dummy/features/form-persistence.feature +40 -0
  85. data/dummy/features/form_bard_file_field_helper.feature +98 -0
  86. data/dummy/features/support/env.rb +21 -0
  87. data/dummy/features/support/fixtures/empty.3gpp +0 -0
  88. data/dummy/features/support/fixtures/empty.JPEG +0 -0
  89. data/dummy/features/support/fixtures/empty.M4V +0 -0
  90. data/dummy/features/support/fixtures/empty.avi +0 -0
  91. data/dummy/features/support/fixtures/empty.bmp +0 -0
  92. data/dummy/features/support/fixtures/empty.flv +0 -0
  93. data/dummy/features/support/fixtures/empty.gif +0 -0
  94. data/dummy/features/support/fixtures/empty.heic +0 -0
  95. data/dummy/features/support/fixtures/empty.jpeg +0 -0
  96. data/dummy/features/support/fixtures/empty.jpg +0 -0
  97. data/dummy/features/support/fixtures/empty.m4v +0 -0
  98. data/dummy/features/support/fixtures/empty.mkv +0 -0
  99. data/dummy/features/support/fixtures/empty.mov +0 -0
  100. data/dummy/features/support/fixtures/empty.mp4 +0 -0
  101. data/dummy/features/support/fixtures/empty.png +0 -0
  102. data/dummy/features/support/fixtures/empty.tiff +0 -0
  103. data/dummy/features/support/fixtures/empty.webm +0 -0
  104. data/dummy/features/support/fixtures/empty.wmv +0 -0
  105. data/dummy/features/support/fixtures/image.jpg +0 -0
  106. data/dummy/features/support/fixtures/image2.jpg +0 -0
  107. data/dummy/features/support/fixtures/video.mp4 +0 -0
  108. data/dummy/features/support/selectors.rb +63 -0
  109. data/dummy/features/support/step_definitions/download_steps.rb +4 -0
  110. data/dummy/features/support/step_definitions/web_steps.rb +94 -0
  111. data/dummy/features/validations.feature +71 -0
  112. data/dummy/lib/assets/.keep +0 -0
  113. data/dummy/lib/tasks/.keep +0 -0
  114. data/dummy/log/.keep +0 -0
  115. data/dummy/public/404.html +67 -0
  116. data/dummy/public/422.html +67 -0
  117. data/dummy/public/500.html +66 -0
  118. data/dummy/public/apple-touch-icon-precomposed.png +0 -0
  119. data/dummy/public/apple-touch-icon.png +0 -0
  120. data/dummy/public/favicon.ico +0 -0
  121. data/dummy/public/robots.txt +1 -0
  122. data/dummy/storage/.keep +0 -0
  123. data/dummy/test/application_system_test_case.rb +21 -0
  124. data/dummy/test/channels/application_cable/connection_test.rb +11 -0
  125. data/dummy/test/controllers/.keep +0 -0
  126. data/dummy/test/fixtures/files/.keep +0 -0
  127. data/dummy/test/helpers/.keep +0 -0
  128. data/dummy/test/integration/.keep +0 -0
  129. data/dummy/test/mailers/.keep +0 -0
  130. data/dummy/test/models/.keep +0 -0
  131. data/dummy/test/system/.keep +0 -0
  132. data/dummy/test/system/tests_test.rb +9 -0
  133. data/dummy/test/test_helper.rb +13 -0
  134. data/dummy/tmp/.keep +0 -0
  135. data/dummy/tmp/pids/.keep +0 -0
  136. data/dummy/tmp/storage/.keep +0 -0
  137. data/lib/bard/file_field/field.rb +27 -0
  138. data/lib/bard/file_field/form_builder.rb +12 -0
  139. data/lib/bard/file_field/version.rb +7 -0
  140. data/lib/bard/file_field.rb +20 -0
  141. metadata +197 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8aa0716f97f7d7a16e5901a0b4e3e09eb0c6f412dd579a5e5ceadc6f05ceb112
4
+ data.tar.gz: 0a03b00f05bc8933f3ad39e915fd3bb0aba55693e5797f3433bc40eaae828614
5
+ SHA512:
6
+ metadata.gz: d65b4fabbd776b9571f1ee4e66e4089d457f4e505e59b4975b7c48dc4b091ea29e56a49dd46f3d664a792cf456d07edc1a2fe07edd0b4e13cb91d7b1eba0845a
7
+ data.tar.gz: 00afc54d4069ae20a3e9549b3043b0a9b9b3495b7a068d42906d98f604073bfc8afd60c80c79f701bb8eca3ff4e2bb7223ec59414ec9219888854660db02a010
data/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v14.17.6
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ bard-file_field
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-3.1.3
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in bard-file.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,98 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bard-file_field (0.1.0)
5
+ activestorage (~> 7.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (7.1.1)
11
+ actionview (= 7.1.1)
12
+ activesupport (= 7.1.1)
13
+ nokogiri (>= 1.8.5)
14
+ rack (>= 2.2.4)
15
+ rack-session (>= 1.0.1)
16
+ rack-test (>= 0.6.3)
17
+ rails-dom-testing (~> 2.2)
18
+ rails-html-sanitizer (~> 1.6)
19
+ actionview (7.1.1)
20
+ activesupport (= 7.1.1)
21
+ builder (~> 3.1)
22
+ erubi (~> 1.11)
23
+ rails-dom-testing (~> 2.2)
24
+ rails-html-sanitizer (~> 1.6)
25
+ activejob (7.1.1)
26
+ activesupport (= 7.1.1)
27
+ globalid (>= 0.3.6)
28
+ activemodel (7.1.1)
29
+ activesupport (= 7.1.1)
30
+ activerecord (7.1.1)
31
+ activemodel (= 7.1.1)
32
+ activesupport (= 7.1.1)
33
+ timeout (>= 0.4.0)
34
+ activestorage (7.1.1)
35
+ actionpack (= 7.1.1)
36
+ activejob (= 7.1.1)
37
+ activerecord (= 7.1.1)
38
+ activesupport (= 7.1.1)
39
+ marcel (~> 1.0)
40
+ activesupport (7.1.1)
41
+ base64
42
+ bigdecimal
43
+ concurrent-ruby (~> 1.0, >= 1.0.2)
44
+ connection_pool (>= 2.2.5)
45
+ drb
46
+ i18n (>= 1.6, < 2)
47
+ minitest (>= 5.1)
48
+ mutex_m
49
+ tzinfo (~> 2.0)
50
+ base64 (0.2.0)
51
+ bigdecimal (3.1.4)
52
+ builder (3.2.4)
53
+ concurrent-ruby (1.2.2)
54
+ connection_pool (2.4.1)
55
+ crass (1.0.6)
56
+ drb (2.2.0)
57
+ ruby2_keywords
58
+ erubi (1.12.0)
59
+ globalid (1.2.1)
60
+ activesupport (>= 6.1)
61
+ i18n (1.14.1)
62
+ concurrent-ruby (~> 1.0)
63
+ loofah (2.21.4)
64
+ crass (~> 1.0.2)
65
+ nokogiri (>= 1.12.0)
66
+ marcel (1.0.2)
67
+ minitest (5.20.0)
68
+ mutex_m (0.2.0)
69
+ nokogiri (1.15.4-x86_64-linux)
70
+ racc (~> 1.4)
71
+ racc (1.7.3)
72
+ rack (3.0.8)
73
+ rack-session (2.0.0)
74
+ rack (>= 3.0.0)
75
+ rack-test (2.1.0)
76
+ rack (>= 1.3)
77
+ rails-dom-testing (2.2.0)
78
+ activesupport (>= 5.0.0)
79
+ minitest
80
+ nokogiri (>= 1.6)
81
+ rails-html-sanitizer (1.6.0)
82
+ loofah (~> 2.21)
83
+ nokogiri (~> 1.14)
84
+ rake (13.0.6)
85
+ ruby2_keywords (0.0.5)
86
+ timeout (0.4.1)
87
+ tzinfo (2.0.6)
88
+ concurrent-ruby (~> 1.0)
89
+
90
+ PLATFORMS
91
+ x86_64-linux
92
+
93
+ DEPENDENCIES
94
+ bard-file_field!
95
+ rake (~> 13.0)
96
+
97
+ BUNDLED WITH
98
+ 2.3.26
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 bard-file
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Bard::File
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/bard/file`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add bard-file
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ $ gem install bard-file
16
+
17
+ ## Usage
18
+
19
+ TODO: Write usage instructions here
20
+
21
+ ## Development
22
+
23
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+
25
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
+
27
+ ## Contributing
28
+
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bard-file.
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]