inline_forms 8.1.70 → 8.1.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +81 -0
  3. data/README.rdoc +3 -3
  4. data/inline_forms.gemspec +0 -1
  5. data/lib/generators/USAGE +1 -1
  6. data/lib/generators/inline_forms_addto/USAGE +1 -1
  7. data/lib/generators/inline_forms_addto/templates/add_columns_migration.erb +0 -2
  8. data/lib/generators/inline_forms_addto_generator.rb +40 -121
  9. data/lib/generators/inline_forms_attribute_list_editor.rb +211 -0
  10. data/lib/generators/inline_forms_attribute_overrides.rb +9 -0
  11. data/lib/generators/inline_forms_generator.rb +34 -41
  12. data/lib/generators/templates/migration.erb +0 -2
  13. data/lib/generators/templates/test.erb +1 -1
  14. data/lib/inline_forms/gem_files.rb +20 -17
  15. data/lib/inline_forms/version.rb +1 -1
  16. metadata +3 -142
  17. data/.document +0 -5
  18. data/.forgejo/brakeman-engine.sh +0 -51
  19. data/.forgejo/brakeman.ignore +0 -211
  20. data/.forgejo/workflows/ci.yml +0 -74
  21. data/.forgejo/workflows/full-gate.yml +0 -104
  22. data/.gitignore +0 -39
  23. data/.rubocop.yml +0 -31
  24. data/.rubocop_todo.yml +0 -151
  25. data/.ruby-version +0 -1
  26. data/Gemfile +0 -28
  27. data/Rakefile +0 -103
  28. data/script/migrate_form_elements.rb +0 -62
  29. data/test/archived_form_elements_test.rb +0 -101
  30. data/test/attribute_list_test.rb +0 -165
  31. data/test/dummy/app/controllers/application_controller.rb +0 -32
  32. data/test/dummy/app/controllers/daily_reports_controller.rb +0 -4
  33. data/test/dummy/app/controllers/documents_controller.rb +0 -4
  34. data/test/dummy/app/controllers/dossiers_controller.rb +0 -4
  35. data/test/dummy/app/controllers/gizmos_controller.rb +0 -4
  36. data/test/dummy/app/controllers/machines_controller.rb +0 -4
  37. data/test/dummy/app/controllers/parts_controller.rb +0 -4
  38. data/test/dummy/app/controllers/stats_controller.rb +0 -10
  39. data/test/dummy/app/controllers/widgets_controller.rb +0 -4
  40. data/test/dummy/app/helpers/application_helper.rb +0 -13
  41. data/test/dummy/app/models/ability.rb +0 -15
  42. data/test/dummy/app/models/application_record.rb +0 -27
  43. data/test/dummy/app/models/daily_report.rb +0 -21
  44. data/test/dummy/app/models/document.rb +0 -33
  45. data/test/dummy/app/models/dossier.rb +0 -38
  46. data/test/dummy/app/models/gizmo.rb +0 -25
  47. data/test/dummy/app/models/kind.rb +0 -8
  48. data/test/dummy/app/models/machine.rb +0 -24
  49. data/test/dummy/app/models/part.rb +0 -17
  50. data/test/dummy/app/models/phase.rb +0 -9
  51. data/test/dummy/app/models/widget.rb +0 -40
  52. data/test/dummy/app/views/_gizmos_search.html.erb +0 -3
  53. data/test/dummy/app/views/stats/show.html.erb +0 -1
  54. data/test/dummy/config/application.rb +0 -49
  55. data/test/dummy/config/database.yml +0 -3
  56. data/test/dummy/config/environment.rb +0 -5
  57. data/test/dummy/config/initializers/inline_forms.rb +0 -6
  58. data/test/dummy/config/initializers/paper_trail_yaml_safe_load.rb +0 -28
  59. data/test/dummy/config/routes.rb +0 -51
  60. data/test/form_element_from_callee_test.rb +0 -73
  61. data/test/gem_package_modes_test.rb +0 -86
  62. data/test/inline_edit_polymorphic_path_test.rb +0 -81
  63. data/test/inline_forms_addto_generator_test.rb +0 -518
  64. data/test/inline_forms_generator_test.rb +0 -261
  65. data/test/integration/csp_nonce_test.rb +0 -50
  66. data/test/integration/dropdown_test.rb +0 -186
  67. data/test/integration/field_authorization_test.rb +0 -131
  68. data/test/integration/file_slots_test.rb +0 -665
  69. data/test/integration/html_refusal_test.rb +0 -152
  70. data/test/integration/inline_forms_crud_test.rb +0 -165
  71. data/test/integration/layout_title_test.rb +0 -56
  72. data/test/integration/legacy_elements_test.rb +0 -99
  73. data/test/integration/list_params_test.rb +0 -200
  74. data/test/integration/locale_test.rb +0 -234
  75. data/test/integration/model_top_bar_test.rb +0 -85
  76. data/test/integration/native_inputs_test.rb +0 -138
  77. data/test/integration/open_after_create_test.rb +0 -85
  78. data/test/integration/pending_migration_gate_test.rb +0 -75
  79. data/test/integration/presentation_escaping_test.rb +0 -80
  80. data/test/integration/revert_skipped_columns_test.rb +0 -59
  81. data/test/integration/schema_batch_pipeline_test.rb +0 -189
  82. data/test/integration/schema_edit_test.rb +0 -141
  83. data/test/integration/schema_preview_test.rb +0 -65
  84. data/test/integration/turbo_menu_test.rb +0 -60
  85. data/test/integration_test_helper.rb +0 -203
  86. data/test/plain_text_configuration_test.rb +0 -90
  87. data/test/schema_apply_test.rb +0 -73
  88. data/test/schema_intent_test.rb +0 -53
  89. data/test/schema_label_test.rb +0 -61
  90. data/test/tabs_test.rb +0 -98
  91. data/test/test_helper.rb +0 -10
  92. data/test/user_model_config_test.rb +0 -44
@@ -68,6 +68,7 @@ module InlineForms
68
68
  @carrierwave_mounters = "\n"
69
69
  @stored_files = String.new
70
70
  @inline_forms_attribute_list = String.new
71
+ rows = []
71
72
 
72
73
  for attribute in attributes
73
74
  if attribute.column_type == :belongs_to
@@ -81,7 +82,7 @@ module InlineForms
81
82
  if attribute.type == :has_many ||
82
83
  attribute.type == :has_many_destroy
83
84
  @has_many << ' has_many :' + attribute.name
84
- @has_many << ', :dependent => :destroy' if attribute.type == :has_many_destroy
85
+ @has_many << ', dependent: :destroy' if attribute.type == :has_many_destroy
85
86
  @has_many << "\n"
86
87
  end
87
88
  if attribute.type == :has_one
@@ -126,15 +127,18 @@ module InlineForms
126
127
  @list_scopes << " inline_forms_search_on :#{attribute.type}\n"
127
128
  end
128
129
  if attribute.attribute?
129
- attribute.attribute_type == :unknown ? commenter = '#' : commenter = ' '
130
- @inline_forms_attribute_list << commenter +
131
- ' [ :' +
132
- attribute.name +
133
- ', :' + attribute.attribute_type.to_s +
134
- " ], \n"
130
+ commenter = attribute.attribute_type == :unknown ? '# ' : ''
131
+ rows << " #{commenter}[ :#{attribute.name}, :#{attribute.attribute_type} ]"
135
132
  end
136
133
  end
137
- unless @inline_forms_attribute_list.empty?
134
+ unless rows.empty?
135
+ # No comma after the last row (RuboCop omakase); inline_forms_addto adds
136
+ # it when it appends one. Commented-out rows at the end go above that
137
+ # last row, so that uncommenting one gives valid Ruby.
138
+ last_row = rows.rindex { |row| !row.lstrip.start_with?('#') }
139
+ last_row = rows.delete_at(last_row) if last_row
140
+ rows.each { |row| @inline_forms_attribute_list << row << ",\n" }
141
+ @inline_forms_attribute_list << last_row << "\n" if last_row
138
142
  @inline_forms_attribute_list = "\n" +
139
143
  " def inline_forms_attribute_list\n" +
140
144
  " @inline_forms_attribute_list ||= [\n" +
@@ -143,7 +147,7 @@ module InlineForms
143
147
  " end\n" +
144
148
  "\n"
145
149
  end
146
- template "model.erb", "app/models/#{model_file_name}.rb"
150
+ template("model.erb", "app/models/#{model_file_name}.rb") { |content| tidy_class_body(content) }
147
151
  end
148
152
  end
149
153
 
@@ -152,8 +156,8 @@ module InlineForms
152
156
  file_routes = file_slot_attributes.any? ? "\n InlineForms.file_routes(self)" : ""
153
157
  route <<-ROUTE.strip_heredoc
154
158
  resources :#{resource_name} do
155
- post 'revert', :on => :member
156
- get 'list_versions', :on => :member#{file_routes}
159
+ post "revert", on: :member
160
+ get "list_versions", on: :member#{file_routes}
157
161
  end
158
162
  ROUTE
159
163
  end
@@ -176,31 +180,9 @@ module InlineForms
176
180
  @columns << ' t.datetime :' + attribute.name + "_updated_at\n"
177
181
  else
178
182
  if attribute.migration?
179
- attribute.attribute_type == :unknown ? commenter = '#' : commenter = ' '
180
- # Render precision/scale for real :decimal columns. The override
181
- # in lib/generators/inline_forms_attribute_overrides.rb teaches
182
- # `Rails::Generators::GeneratedAttribute.parse` to extract
183
- # `{p,s}` off the type for :decimal_field (Rails' own parser
184
- # only honors `{…}` for a hardcoded list of built-in types
185
- # and otherwise glues the braces onto the type symbol).
186
- # Apply sensible defaults — precision: 10, scale: 2 — so a
187
- # bare `name:decimal_field` becomes a real decimal column
188
- # instead of the legacy varchar that 8.1.9 and earlier
189
- # emitted. Existing apps keep their varchar columns until
190
- # they migrate; only newly-generated tables get :decimal.
191
- column_opts = ""
192
- if attribute.column_type == :decimal
193
- precision = attribute.attr_options[:precision] || 10
194
- scale = attribute.attr_options[:scale] || 2
195
- column_opts = ", precision: #{precision}, scale: #{scale}"
196
- end
197
- @columns << commenter +
198
- ' t.' +
199
- attribute.column_type.to_s +
200
- " :" +
201
- attribute.name +
202
- column_opts +
203
- " \n"
183
+ commenter = attribute.attribute_type == :unknown ? '# ' : ''
184
+ @columns << " #{commenter}t.#{attribute.column_type} :#{attribute.name}" \
185
+ "#{attribute.inline_forms_column_options}\n"
204
186
  end
205
187
  end
206
188
  end
@@ -212,7 +194,8 @@ module InlineForms
212
194
  def add_tab
213
195
  return if @flag_not_accessible_through_html
214
196
 
215
- # The installer seeds `MODEL_TABS = %w(<user_model_route> )` in
197
+ # The installer seeds `MODEL_TABS = %w[<user_model_route> ]` (`%w( )`
198
+ # before 8.1.72) in
216
199
  # `config/initializers/inline_forms.rb` before any `rails g inline_forms`
217
200
  # runs. Inject each generated model's pluralised route token into that
218
201
  # list so the inline_forms top-bar dropdown (rendered by
@@ -221,16 +204,18 @@ module InlineForms
221
204
  # consumer running `rails g inline_forms` in a non-installer-shaped app)
222
205
  # or when the token is already present (idempotent re-run).
223
206
  relative_path = "config/initializers/inline_forms.rb"
224
- marker = "MODEL_TABS = %w("
207
+ marker = /MODEL_TABS = %w[\[(]/
225
208
  tab_token = "#{name.pluralize.underscore} "
226
209
  full_path = File.join(destination_root, relative_path)
227
210
  return unless File.exist?(full_path)
228
211
 
229
212
  content = File.read(full_path)
230
- return unless content.include?(marker)
231
- return if content.include?(tab_token.rstrip)
213
+ return unless content.match?(marker)
214
+ # One of the words, not a substring: "showcases" is not there because
215
+ # "form_element_showcases" is. force: Thor skips on a substring too.
216
+ return if content[/MODEL_TABS = %w[\[(]([^\])]*)/, 1].to_s.split.include?(tab_token.rstrip)
232
217
 
233
- inject_into_file relative_path, tab_token, after: marker
218
+ inject_into_file relative_path, tab_token, after: marker, force: true
234
219
  end
235
220
 
236
221
  def generate_test
@@ -243,6 +228,14 @@ module InlineForms
243
228
 
244
229
 
245
230
  private
231
+ # The optional parts of model.erb each bring their own blank lines: none
232
+ # right after `class` or before its `end`, and never two in a row.
233
+ def tidy_class_body(content)
234
+ content.gsub(/\n{3,}/, "\n\n")
235
+ .sub(/\A(class [^\n]*\n)\n+/, '\1')
236
+ .sub(/\n+end\s*\z/, "\nend\n")
237
+ end
238
+
246
239
  def file_slot_attributes
247
240
  attributes.select { |attribute| attribute.type == :simple_file_field }
248
241
  end
@@ -1,5 +1,4 @@
1
1
  class InlineFormsCreate<%= table_name.camelize %> < ActiveRecord::Migration[8.1]
2
-
3
2
  def self.up
4
3
  create_table :<%= table_name + @primary_key_option %> do |t|
5
4
  <%= @columns -%>
@@ -10,5 +9,4 @@ class InlineFormsCreate<%= table_name.camelize %> < ActiveRecord::Migration[8.1]
10
9
  def self.down
11
10
  drop_table :<%= table_name %>
12
11
  end
13
-
14
12
  end
@@ -3,4 +3,4 @@ class <%= test_name %> < ActiveSupport::TestCase
3
3
  test "the truth" do
4
4
  assert true
5
5
  end
6
- end
6
+ end
@@ -19,21 +19,24 @@ module InlineFormsGemFiles
19
19
  inline_forms_schema_edit/
20
20
  ].freeze
21
21
 
22
- # Scratch / local-notes dir. It holds working notes and, crucially, secrets
23
- # such as stuff/forgejo-token (mode 0600, only used by CI pushes to forgejo).
24
- # It must NEVER be packaged into a gem. Do not rely on git ignore for this:
25
- # gem_files sweeps untracked files too, and the global excludes file that
26
- # ignores stuff/ is per-machine (present here, absent on the release box), so
27
- # the token leaked into `gem build` on the release machine. Exclude it hard,
28
- # independent of any ignore configuration.
29
- #
30
- # Same for Claude Code files: .claude/ (untracked, per checkout:
31
- # launch.json, settings.local.json, worktrees) and CLAUDE.md (committed so
32
- # worktrees see it, but repo instructions, not gem content).
33
- EXCLUDED_FILE_PREFIXES = %w[
34
- stuff/
35
- .claude/
36
- CLAUDE.md
22
+ # What an installed gem needs: the engine, the archived form elements (hosts
23
+ # copy them; ArchivedFormElements points there) and the documents. Everything
24
+ # else in the checkout stays out: tests, CI, RuboCop and Ruby version files, and
25
+ # above all untracked files, which gem_files sweeps too. stuff/ holds working notes and secrets such as stuff/forgejo-token; the
26
+ # global excludes file that ignores it is per-machine and absent on the release
27
+ # box, where the token once leaked into `gem build`. Hence a list of what goes
28
+ # in, not of what stays out.
29
+ PACKAGED_PREFIXES = %w[
30
+ app/
31
+ archived/
32
+ bin/
33
+ lib/
34
+ vendor/assets/
35
+ CHANGELOG.md
36
+ LICENSE.txt
37
+ README.rdoc
38
+ inline_forms.gemspec
39
+ inline_forms_installer.gemspec
37
40
  ].freeze
38
41
 
39
42
  module_function
@@ -59,8 +62,8 @@ module InlineFormsGemFiles
59
62
 
60
63
  files.select! { |f| File.file?(File.join(REPO_ROOT, f)) }
61
64
 
62
- files.reject! do |f|
63
- EXCLUDED_FILE_PREFIXES.any? { |prefix| f == prefix || f.start_with?(prefix) }
65
+ files.select! do |f|
66
+ PACKAGED_PREFIXES.any? { |prefix| prefix.end_with?("/") ? f.start_with?(prefix) : f == prefix }
64
67
  end
65
68
 
66
69
  files.reject! do |f|
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module InlineForms
4
- VERSION = "8.1.70"
4
+ VERSION = "8.1.76"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.70
4
+ version: 8.1.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares
@@ -94,20 +94,9 @@ executables: []
94
94
  extensions: []
95
95
  extra_rdoc_files: []
96
96
  files:
97
- - ".document"
98
- - ".forgejo/brakeman-engine.sh"
99
- - ".forgejo/brakeman.ignore"
100
- - ".forgejo/workflows/ci.yml"
101
- - ".forgejo/workflows/full-gate.yml"
102
- - ".gitignore"
103
- - ".rubocop.yml"
104
- - ".rubocop_todo.yml"
105
- - ".ruby-version"
106
97
  - CHANGELOG.md
107
- - Gemfile
108
98
  - LICENSE.txt
109
99
  - README.rdoc
110
- - Rakefile
111
100
  - app/assets/fonts/foundation-icons.svg
112
101
  - app/assets/fonts/foundation-icons.ttf
113
102
  - app/assets/fonts/foundation-icons.woff
@@ -215,6 +204,7 @@ files:
215
204
  - lib/generators/inline_forms_addto/USAGE
216
205
  - lib/generators/inline_forms_addto/templates/add_columns_migration.erb
217
206
  - lib/generators/inline_forms_addto_generator.rb
207
+ - lib/generators/inline_forms_attribute_list_editor.rb
218
208
  - lib/generators/inline_forms_attribute_overrides.rb
219
209
  - lib/generators/inline_forms_generator.rb
220
210
  - lib/generators/templates/application_record.rb
@@ -281,71 +271,6 @@ files:
281
271
  - lib/otherstuff/roles_users.sql
282
272
  - lib/tasks/inline_forms_files.rake
283
273
  - lib/vagrant/vagrantbox-inline_forms.zip
284
- - script/migrate_form_elements.rb
285
- - test/archived_form_elements_test.rb
286
- - test/attribute_list_test.rb
287
- - test/dummy/app/controllers/application_controller.rb
288
- - test/dummy/app/controllers/daily_reports_controller.rb
289
- - test/dummy/app/controllers/documents_controller.rb
290
- - test/dummy/app/controllers/dossiers_controller.rb
291
- - test/dummy/app/controllers/gizmos_controller.rb
292
- - test/dummy/app/controllers/machines_controller.rb
293
- - test/dummy/app/controllers/parts_controller.rb
294
- - test/dummy/app/controllers/stats_controller.rb
295
- - test/dummy/app/controllers/widgets_controller.rb
296
- - test/dummy/app/helpers/application_helper.rb
297
- - test/dummy/app/models/ability.rb
298
- - test/dummy/app/models/application_record.rb
299
- - test/dummy/app/models/daily_report.rb
300
- - test/dummy/app/models/document.rb
301
- - test/dummy/app/models/dossier.rb
302
- - test/dummy/app/models/gizmo.rb
303
- - test/dummy/app/models/kind.rb
304
- - test/dummy/app/models/machine.rb
305
- - test/dummy/app/models/part.rb
306
- - test/dummy/app/models/phase.rb
307
- - test/dummy/app/models/widget.rb
308
- - test/dummy/app/views/_gizmos_search.html.erb
309
- - test/dummy/app/views/stats/show.html.erb
310
- - test/dummy/config/application.rb
311
- - test/dummy/config/database.yml
312
- - test/dummy/config/environment.rb
313
- - test/dummy/config/initializers/inline_forms.rb
314
- - test/dummy/config/initializers/paper_trail_yaml_safe_load.rb
315
- - test/dummy/config/routes.rb
316
- - test/form_element_from_callee_test.rb
317
- - test/gem_package_modes_test.rb
318
- - test/inline_edit_polymorphic_path_test.rb
319
- - test/inline_forms_addto_generator_test.rb
320
- - test/inline_forms_generator_test.rb
321
- - test/integration/csp_nonce_test.rb
322
- - test/integration/dropdown_test.rb
323
- - test/integration/field_authorization_test.rb
324
- - test/integration/file_slots_test.rb
325
- - test/integration/html_refusal_test.rb
326
- - test/integration/inline_forms_crud_test.rb
327
- - test/integration/layout_title_test.rb
328
- - test/integration/legacy_elements_test.rb
329
- - test/integration/list_params_test.rb
330
- - test/integration/locale_test.rb
331
- - test/integration/model_top_bar_test.rb
332
- - test/integration/native_inputs_test.rb
333
- - test/integration/open_after_create_test.rb
334
- - test/integration/pending_migration_gate_test.rb
335
- - test/integration/presentation_escaping_test.rb
336
- - test/integration/revert_skipped_columns_test.rb
337
- - test/integration/schema_batch_pipeline_test.rb
338
- - test/integration/schema_edit_test.rb
339
- - test/integration/schema_preview_test.rb
340
- - test/integration/turbo_menu_test.rb
341
- - test/integration_test_helper.rb
342
- - test/plain_text_configuration_test.rb
343
- - test/schema_apply_test.rb
344
- - test/schema_intent_test.rb
345
- - test/schema_label_test.rb
346
- - test/tabs_test.rb
347
- - test/test_helper.rb
348
- - test/user_model_config_test.rb
349
274
  - vendor/assets/javascripts/popper.min.js
350
275
  - vendor/assets/javascripts/tippy-bundle.umd.min.js
351
276
  - vendor/assets/javascripts/trix.min.js
@@ -372,68 +297,4 @@ requirements: []
372
297
  rubygems_version: 4.0.20
373
298
  specification_version: 4
374
299
  summary: Inline editing of forms for Rails 8.
375
- test_files:
376
- - test/archived_form_elements_test.rb
377
- - test/attribute_list_test.rb
378
- - test/dummy/app/controllers/application_controller.rb
379
- - test/dummy/app/controllers/daily_reports_controller.rb
380
- - test/dummy/app/controllers/documents_controller.rb
381
- - test/dummy/app/controllers/dossiers_controller.rb
382
- - test/dummy/app/controllers/gizmos_controller.rb
383
- - test/dummy/app/controllers/machines_controller.rb
384
- - test/dummy/app/controllers/parts_controller.rb
385
- - test/dummy/app/controllers/stats_controller.rb
386
- - test/dummy/app/controllers/widgets_controller.rb
387
- - test/dummy/app/helpers/application_helper.rb
388
- - test/dummy/app/models/ability.rb
389
- - test/dummy/app/models/application_record.rb
390
- - test/dummy/app/models/daily_report.rb
391
- - test/dummy/app/models/document.rb
392
- - test/dummy/app/models/dossier.rb
393
- - test/dummy/app/models/gizmo.rb
394
- - test/dummy/app/models/kind.rb
395
- - test/dummy/app/models/machine.rb
396
- - test/dummy/app/models/part.rb
397
- - test/dummy/app/models/phase.rb
398
- - test/dummy/app/models/widget.rb
399
- - test/dummy/app/views/_gizmos_search.html.erb
400
- - test/dummy/app/views/stats/show.html.erb
401
- - test/dummy/config/application.rb
402
- - test/dummy/config/database.yml
403
- - test/dummy/config/environment.rb
404
- - test/dummy/config/initializers/inline_forms.rb
405
- - test/dummy/config/initializers/paper_trail_yaml_safe_load.rb
406
- - test/dummy/config/routes.rb
407
- - test/form_element_from_callee_test.rb
408
- - test/gem_package_modes_test.rb
409
- - test/inline_edit_polymorphic_path_test.rb
410
- - test/inline_forms_addto_generator_test.rb
411
- - test/inline_forms_generator_test.rb
412
- - test/integration/csp_nonce_test.rb
413
- - test/integration/dropdown_test.rb
414
- - test/integration/field_authorization_test.rb
415
- - test/integration/file_slots_test.rb
416
- - test/integration/html_refusal_test.rb
417
- - test/integration/inline_forms_crud_test.rb
418
- - test/integration/layout_title_test.rb
419
- - test/integration/legacy_elements_test.rb
420
- - test/integration/list_params_test.rb
421
- - test/integration/locale_test.rb
422
- - test/integration/model_top_bar_test.rb
423
- - test/integration/native_inputs_test.rb
424
- - test/integration/open_after_create_test.rb
425
- - test/integration/pending_migration_gate_test.rb
426
- - test/integration/presentation_escaping_test.rb
427
- - test/integration/revert_skipped_columns_test.rb
428
- - test/integration/schema_batch_pipeline_test.rb
429
- - test/integration/schema_edit_test.rb
430
- - test/integration/schema_preview_test.rb
431
- - test/integration/turbo_menu_test.rb
432
- - test/integration_test_helper.rb
433
- - test/plain_text_configuration_test.rb
434
- - test/schema_apply_test.rb
435
- - test/schema_intent_test.rb
436
- - test/schema_label_test.rb
437
- - test/tabs_test.rb
438
- - test/test_helper.rb
439
- - test/user_model_config_test.rb
300
+ test_files: []
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # Brakeman on a generated app together with the engine code.
4
- #
5
- # .forgejo/brakeman-engine.sh APP [extra brakeman options]
6
- #
7
- # Brakeman skips gem code, so scanning the app alone never looks at the
8
- # engine's controllers, helpers and views. Scanning the engine alone does not
9
- # work either: without an app Brakeman cannot tell the Rails version and the
10
- # templates do not parse. So: a temporary copy of APP with the engine's code
11
- # in engines/, scanned as one application. APP itself is not touched.
12
- #
13
- # Accepted warnings, each with its reason, are in brakeman.ignore beside this
14
- # file; --ensure-ignore-notes fails on one without a reason, and
15
- # --ensure-no-obsolete-ignore-entries on one that no longer occurs. The paths
16
- # in the copy are relative and fixed (engines/...), because Brakeman's
17
- # fingerprints include them.
18
- #
19
- # Not scanned: lib/installer_templates and lib/generators (they produce code;
20
- # what they produce is in APP).
21
-
22
- set -euo pipefail
23
-
24
- here=$(cd "$(dirname "$0")" && pwd)
25
- root=$(dirname "$here")
26
- app=$(cd "${1:?usage: brakeman-engine.sh APP [brakeman options]}" && pwd)
27
- shift
28
-
29
- work=$(mktemp -d)
30
- trap 'rm -rf "$work"' EXIT
31
- mkdir -p "$work/app/engines/inline_forms" "$work/app/engines/inline_forms_schema_edit"
32
-
33
- # No keys or credentials: Brakeman does not need them.
34
- tar -C "$app" --exclude='*.key' --exclude='credentials*' -cf - \
35
- app config lib Gemfile Gemfile.lock | tar -C "$work/app" -xf -
36
-
37
- for part in app config lib; do
38
- if [ -d "$root/$part" ]; then
39
- cp -R "$root/$part" "$work/app/engines/inline_forms/"
40
- fi
41
- if [ -d "$root/inline_forms_schema_edit/$part" ]; then
42
- cp -R "$root/inline_forms_schema_edit/$part" "$work/app/engines/inline_forms_schema_edit/"
43
- fi
44
- done
45
- rm -rf "$work/app/engines/inline_forms/lib/installer_templates" \
46
- "$work/app/engines/inline_forms/lib/generators"
47
-
48
- brakeman --no-pager \
49
- --add-engines-path engines/inline_forms,engines/inline_forms_schema_edit \
50
- -i "$here/brakeman.ignore" --ensure-ignore-notes --ensure-no-obsolete-ignore-entries \
51
- --path "$work/app" "$@"