inline_forms 8.1.47 → 8.1.53
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/.gitignore +3 -0
- data/CHANGELOG.md +149 -0
- data/Gemfile +3 -0
- data/README.rdoc +47 -0
- data/app/assets/stylesheets/inline_forms/inline_forms.scss +34 -0
- data/app/controllers/concerns/file_slots_concern.rb +211 -0
- data/app/controllers/inline_forms/file_trash_controller.rb +115 -0
- data/app/controllers/inline_forms_controller.rb +82 -16
- data/app/helpers/inline_forms_file_trash_helper.rb +131 -0
- data/app/helpers/inline_forms_helper.rb +5 -1
- data/app/models/concerns/inline_forms/stored_files.rb +350 -0
- data/app/models/inline_forms/current.rb +8 -0
- data/app/models/inline_forms/file_trash_sweep.rb +37 -0
- data/app/models/inline_forms/trashed_file.rb +205 -0
- data/app/views/inline_forms/_file_slot.html.erb +39 -0
- data/app/views/inline_forms/_header.html.erb +3 -0
- data/app/views/inline_forms/_model_top_bar.html.erb +3 -4
- data/app/views/inline_forms/_show.html.erb +6 -0
- data/app/views/inline_forms/_versions.html.erb +4 -4
- data/app/views/inline_forms/_versions_file_entry.html.erb +36 -0
- data/app/views/inline_forms/_versions_list.html.erb +11 -2
- data/app/views/inline_forms/file_field_frame.html.erb +22 -0
- data/app/views/inline_forms/file_trash/index.html.erb +112 -0
- data/app/views/inline_forms/file_trash_panel.html.erb +90 -0
- data/app/views/layouts/inline_forms.html.erb +5 -1
- data/lib/generators/inline_forms/file_trash_generator.rb +36 -0
- data/lib/generators/inline_forms/templates/create_inline_forms_file_trash.rb.erb +41 -0
- data/lib/generators/inline_forms_addto_generator.rb +47 -0
- data/lib/generators/inline_forms_generator.rb +19 -2
- data/lib/generators/templates/model.erb +4 -0
- data/lib/inline_forms/form_element_from_callee.rb +25 -0
- data/lib/inline_forms/form_elements/simple_file_field_helper.rb +30 -2
- data/lib/inline_forms/gem_files.rb +5 -0
- data/lib/inline_forms/version.rb +1 -1
- data/lib/inline_forms.rb +55 -0
- data/lib/locales/inline_forms.en.yml +87 -0
- data/lib/locales/inline_forms.nl.yml +87 -3
- data/lib/tasks/inline_forms_files.rake +61 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/documents_controller.rb +4 -0
- data/test/dummy/app/controllers/dossiers_controller.rb +4 -0
- data/test/dummy/app/models/ability.rb +15 -0
- data/test/dummy/app/models/document.rb +33 -0
- data/test/dummy/app/models/dossier.rb +38 -0
- data/test/dummy/config/application.rb +4 -3
- data/test/dummy/config/routes.rb +13 -0
- data/test/inline_forms_addto_generator_test.rb +47 -0
- data/test/inline_forms_generator_test.rb +24 -0
- data/test/integration/field_authorization_test.rb +131 -0
- data/test/integration/file_slots_test.rb +574 -0
- data/test/integration/layout_title_test.rb +56 -0
- data/test/integration/model_top_bar_test.rb +9 -0
- data/test/integration/revert_skipped_columns_test.rb +59 -0
- data/test/integration_test_helper.rb +62 -0
- metadata +34 -3
- data/.claude/settings.local.json +0 -9
- data/CLAUDE.md +0 -68
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../integration_test_helper"
|
|
4
|
+
|
|
5
|
+
# Reverting a version must leave columns excluded via `has_paper_trail skip:`
|
|
6
|
+
# alone. PaperTrail's reify defaults to `unversioned_attributes: :nil`, which
|
|
7
|
+
# set every skipped column to nil on the live record; revert's save! then
|
|
8
|
+
# persisted that, so in StProject reverting any Client edit NULLed the file
|
|
9
|
+
# bytes (`*_data`) while keeping `*_filename` (downloads returned empty files).
|
|
10
|
+
class RevertSkippedColumnsTest < InlineFormsIntegrationTestCase
|
|
11
|
+
BYTES = "%PDF-1.4 fake bytes \x00\x01\x02".b
|
|
12
|
+
|
|
13
|
+
setup do
|
|
14
|
+
@dossier = Dossier.create!(name: "Original", data_filename: "plan.pdf", data: BYTES)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def turbo_stream_headers(frame_id)
|
|
18
|
+
frame_headers(frame_id).merge("Accept" => "text/vnd.turbo-stream.html")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def versions_for(event)
|
|
22
|
+
PaperTrail::Version.where(item_type: "Dossier", item_id: @dossier.id, event: event)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
test "the skipped column is really not versioned" do
|
|
26
|
+
refute_includes versions_for("create").last.object_changes.to_s, "fake bytes"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
test "reverting an unrelated update keeps the skipped column's bytes" do
|
|
30
|
+
@dossier.update!(name: "Renamed")
|
|
31
|
+
update_version = versions_for("update").last
|
|
32
|
+
frame = "dossier_#{@dossier.id}"
|
|
33
|
+
|
|
34
|
+
post revert_dossier_path(update_version.id, update: frame),
|
|
35
|
+
headers: turbo_stream_headers(frame)
|
|
36
|
+
|
|
37
|
+
assert_response :success
|
|
38
|
+
@dossier.reload
|
|
39
|
+
assert_equal "Original", @dossier.name, "revert must restore the versioned attribute"
|
|
40
|
+
assert_equal "plan.pdf", @dossier.data_filename
|
|
41
|
+
assert_equal BYTES, @dossier.data, "revert must not NULL a has_paper_trail skip: column"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
test "replaying a destroy revert on an existing row keeps the skipped column's bytes" do
|
|
45
|
+
frame = "dossier_#{@dossier.id}"
|
|
46
|
+
delete dossier_path(@dossier, update: frame), headers: frame_headers(frame)
|
|
47
|
+
destroy_version = versions_for("destroy").last
|
|
48
|
+
# The destroy snapshot cannot hold the bytes (skipped); put the row back
|
|
49
|
+
# with its file, as the user would after the first undo + re-upload.
|
|
50
|
+
Dossier.create!(id: @dossier.id, name: "Original", data_filename: "plan.pdf", data: BYTES)
|
|
51
|
+
|
|
52
|
+
post revert_dossier_path(destroy_version.id, update: "dossiers_list"),
|
|
53
|
+
headers: turbo_stream_headers("dossiers_list")
|
|
54
|
+
|
|
55
|
+
assert_response :success
|
|
56
|
+
assert_equal BYTES, Dossier.find(@dossier.id).data,
|
|
57
|
+
"idempotent destroy revert must not copy a nil skipped column onto the live row"
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -58,6 +58,59 @@ ActiveRecord::Schema.define do
|
|
|
58
58
|
t.timestamps
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
+
# Dossier: `data` is in `has_paper_trail skip:` (file bytes, as in
|
|
62
|
+
# StProject's Client/Attachment); see revert_skipped_columns_test.rb.
|
|
63
|
+
create_table :dossiers, force: true do |t|
|
|
64
|
+
t.string :name
|
|
65
|
+
t.string :data_filename
|
|
66
|
+
t.binary :data
|
|
67
|
+
t.timestamps
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Document: declared file slots (InlineForms::StoredFiles); see
|
|
71
|
+
# file_slots_test.rb. The trash tables mirror the inline_forms:file_trash
|
|
72
|
+
# generator's migration.
|
|
73
|
+
create_table :documents, force: true do |t|
|
|
74
|
+
t.string :title
|
|
75
|
+
t.string :filename
|
|
76
|
+
t.binary :data
|
|
77
|
+
t.string :content_type
|
|
78
|
+
t.string :plan_filename
|
|
79
|
+
t.binary :plan_data
|
|
80
|
+
t.string :plan_content_type
|
|
81
|
+
t.timestamps
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
create_table :inline_forms_trashed_files, force: true do |t|
|
|
85
|
+
t.string :record_type, null: false
|
|
86
|
+
t.bigint :record_id, null: false
|
|
87
|
+
t.string :attribute_name, null: false
|
|
88
|
+
t.string :filename
|
|
89
|
+
t.string :content_type
|
|
90
|
+
t.bigint :byte_size
|
|
91
|
+
t.string :checksum, limit: 64
|
|
92
|
+
t.binary :data
|
|
93
|
+
t.string :reason, null: false
|
|
94
|
+
t.boolean :redacted, null: false, default: false
|
|
95
|
+
t.bigint :trashed_by_id
|
|
96
|
+
t.datetime :trashed_at, null: false
|
|
97
|
+
t.bigint :restored_by_id
|
|
98
|
+
t.datetime :restored_at
|
|
99
|
+
t.bigint :purged_by_id
|
|
100
|
+
t.datetime :purged_at
|
|
101
|
+
t.datetime :purge_after
|
|
102
|
+
t.timestamps
|
|
103
|
+
end
|
|
104
|
+
add_index :inline_forms_trashed_files, [ :record_type, :record_id, :attribute_name ]
|
|
105
|
+
add_index :inline_forms_trashed_files, [ :purged_at, :restored_at, :purge_after ]
|
|
106
|
+
|
|
107
|
+
create_table :inline_forms_file_trash_sweeps, force: true do |t|
|
|
108
|
+
t.datetime :ran_at, null: false
|
|
109
|
+
t.integer :purged_count, null: false, default: 0
|
|
110
|
+
t.text :error
|
|
111
|
+
t.timestamps
|
|
112
|
+
end
|
|
113
|
+
|
|
61
114
|
# Schema-GUI batch pipeline (inline_forms_schema_edit). Mirrors the gem's
|
|
62
115
|
# install-generator migration.
|
|
63
116
|
create_table :inline_forms_schema_batches, force: true do |t|
|
|
@@ -109,11 +162,20 @@ class InlineFormsIntegrationTestCase < ActionDispatch::IntegrationTest
|
|
|
109
162
|
end
|
|
110
163
|
|
|
111
164
|
setup do
|
|
165
|
+
Ability.restrictions = nil
|
|
112
166
|
Widget.delete_all
|
|
113
167
|
Kind.delete_all
|
|
114
168
|
Part.delete_all
|
|
115
169
|
Machine.delete_all
|
|
116
170
|
Gizmo.delete_all
|
|
171
|
+
Dossier.delete_all
|
|
172
|
+
Document.delete_all
|
|
173
|
+
Document.require_filename = false
|
|
174
|
+
InlineForms::TrashedFile.delete_all
|
|
175
|
+
InlineForms::FileTrashSweep.delete_all
|
|
176
|
+
InlineForms.file_trash_retention = 30.days
|
|
177
|
+
InlineForms.file_trash_redact_on_purge = false
|
|
178
|
+
InlineForms.max_file_size = nil
|
|
117
179
|
PaperTrail::Version.delete_all
|
|
118
180
|
InlineForms::SchemaIntentRecord.delete_all
|
|
119
181
|
InlineForms::SchemaBatch.delete_all
|
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.
|
|
4
|
+
version: 8.1.53
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ace Suares
|
|
@@ -94,7 +94,6 @@ executables: []
|
|
|
94
94
|
extensions: []
|
|
95
95
|
extra_rdoc_files: []
|
|
96
96
|
files:
|
|
97
|
-
- ".claude/settings.local.json"
|
|
98
97
|
- ".document"
|
|
99
98
|
- ".forgejo/workflows/ci.yml"
|
|
100
99
|
- ".forgejo/workflows/full-gate.yml"
|
|
@@ -103,7 +102,6 @@ files:
|
|
|
103
102
|
- ".rubocop_todo.yml"
|
|
104
103
|
- ".ruby-version"
|
|
105
104
|
- CHANGELOG.md
|
|
106
|
-
- CLAUDE.md
|
|
107
105
|
- Gemfile
|
|
108
106
|
- LICENSE.txt
|
|
109
107
|
- README.rdoc
|
|
@@ -122,11 +120,18 @@ files:
|
|
|
122
120
|
- app/assets/stylesheets/inline_forms/inline_forms.scss
|
|
123
121
|
- app/assets/stylesheets/inline_forms_fonts.css.erb
|
|
124
122
|
- app/controllers/concerns/cancan_concern.rb
|
|
123
|
+
- app/controllers/concerns/file_slots_concern.rb
|
|
125
124
|
- app/controllers/concerns/versions_concern.rb
|
|
125
|
+
- app/controllers/inline_forms/file_trash_controller.rb
|
|
126
126
|
- app/controllers/inline_forms_application_controller.rb
|
|
127
127
|
- app/controllers/inline_forms_controller.rb
|
|
128
|
+
- app/helpers/inline_forms_file_trash_helper.rb
|
|
128
129
|
- app/helpers/inline_forms_helper.rb
|
|
129
130
|
- app/models/concerns/inline_forms/soft_deletable.rb
|
|
131
|
+
- app/models/concerns/inline_forms/stored_files.rb
|
|
132
|
+
- app/models/inline_forms/current.rb
|
|
133
|
+
- app/models/inline_forms/file_trash_sweep.rb
|
|
134
|
+
- app/models/inline_forms/trashed_file.rb
|
|
130
135
|
- app/validators/curacao_id_number_validator.rb
|
|
131
136
|
- app/validators/is_curacao_phone_validator.rb
|
|
132
137
|
- app/validators/is_email_address_validator.rb
|
|
@@ -147,6 +152,7 @@ files:
|
|
|
147
152
|
- app/views/inline_forms/_attribute_label.html.erb
|
|
148
153
|
- app/views/inline_forms/_close.html.erb
|
|
149
154
|
- app/views/inline_forms/_edit.html.erb
|
|
155
|
+
- app/views/inline_forms/_file_slot.html.erb
|
|
150
156
|
- app/views/inline_forms/_flash.html.erb
|
|
151
157
|
- app/views/inline_forms/_generic_search.html.erb
|
|
152
158
|
- app/views/inline_forms/_header.html.erb
|
|
@@ -157,11 +163,15 @@ files:
|
|
|
157
163
|
- app/views/inline_forms/_pending_migration_row.html.erb
|
|
158
164
|
- app/views/inline_forms/_show.html.erb
|
|
159
165
|
- app/views/inline_forms/_versions.html.erb
|
|
166
|
+
- app/views/inline_forms/_versions_file_entry.html.erb
|
|
160
167
|
- app/views/inline_forms/_versions_list.html.erb
|
|
161
168
|
- app/views/inline_forms/create_list_frame.html.erb
|
|
162
169
|
- app/views/inline_forms/field_edit.html.erb
|
|
163
170
|
- app/views/inline_forms/field_pending.html.erb
|
|
164
171
|
- app/views/inline_forms/field_show.html.erb
|
|
172
|
+
- app/views/inline_forms/file_field_frame.html.erb
|
|
173
|
+
- app/views/inline_forms/file_trash/index.html.erb
|
|
174
|
+
- app/views/inline_forms/file_trash_panel.html.erb
|
|
165
175
|
- app/views/inline_forms/new_record.html.erb
|
|
166
176
|
- app/views/inline_forms/row_close.html.erb
|
|
167
177
|
- app/views/inline_forms/row_destroyed.html.erb
|
|
@@ -199,6 +209,8 @@ files:
|
|
|
199
209
|
- inline_forms.gemspec
|
|
200
210
|
- lib/generators/USAGE
|
|
201
211
|
- lib/generators/assets/stylesheets/inline_forms_devise.css
|
|
212
|
+
- lib/generators/inline_forms/file_trash_generator.rb
|
|
213
|
+
- lib/generators/inline_forms/templates/create_inline_forms_file_trash.rb.erb
|
|
202
214
|
- lib/generators/inline_forms_addto/USAGE
|
|
203
215
|
- lib/generators/inline_forms_addto/templates/add_columns_migration.erb
|
|
204
216
|
- lib/generators/inline_forms_addto_generator.rb
|
|
@@ -264,18 +276,24 @@ files:
|
|
|
264
276
|
- lib/otherstuff/add_roles.sql
|
|
265
277
|
- lib/otherstuff/mkrole
|
|
266
278
|
- lib/otherstuff/roles_users.sql
|
|
279
|
+
- lib/tasks/inline_forms_files.rake
|
|
267
280
|
- lib/vagrant/vagrantbox-inline_forms.zip
|
|
268
281
|
- script/migrate_form_elements.rb
|
|
269
282
|
- test/archived_form_elements_test.rb
|
|
270
283
|
- test/attribute_list_test.rb
|
|
271
284
|
- test/dummy/app/controllers/application_controller.rb
|
|
285
|
+
- test/dummy/app/controllers/documents_controller.rb
|
|
286
|
+
- test/dummy/app/controllers/dossiers_controller.rb
|
|
272
287
|
- test/dummy/app/controllers/gizmos_controller.rb
|
|
273
288
|
- test/dummy/app/controllers/machines_controller.rb
|
|
274
289
|
- test/dummy/app/controllers/parts_controller.rb
|
|
275
290
|
- test/dummy/app/controllers/stats_controller.rb
|
|
276
291
|
- test/dummy/app/controllers/widgets_controller.rb
|
|
277
292
|
- test/dummy/app/helpers/application_helper.rb
|
|
293
|
+
- test/dummy/app/models/ability.rb
|
|
278
294
|
- test/dummy/app/models/application_record.rb
|
|
295
|
+
- test/dummy/app/models/document.rb
|
|
296
|
+
- test/dummy/app/models/dossier.rb
|
|
279
297
|
- test/dummy/app/models/gizmo.rb
|
|
280
298
|
- test/dummy/app/models/kind.rb
|
|
281
299
|
- test/dummy/app/models/machine.rb
|
|
@@ -293,12 +311,16 @@ files:
|
|
|
293
311
|
- test/inline_edit_polymorphic_path_test.rb
|
|
294
312
|
- test/inline_forms_addto_generator_test.rb
|
|
295
313
|
- test/inline_forms_generator_test.rb
|
|
314
|
+
- test/integration/field_authorization_test.rb
|
|
315
|
+
- test/integration/file_slots_test.rb
|
|
296
316
|
- test/integration/inline_forms_crud_test.rb
|
|
317
|
+
- test/integration/layout_title_test.rb
|
|
297
318
|
- test/integration/legacy_elements_test.rb
|
|
298
319
|
- test/integration/model_top_bar_test.rb
|
|
299
320
|
- test/integration/native_inputs_test.rb
|
|
300
321
|
- test/integration/open_after_create_test.rb
|
|
301
322
|
- test/integration/pending_migration_gate_test.rb
|
|
323
|
+
- test/integration/revert_skipped_columns_test.rb
|
|
302
324
|
- test/integration/schema_batch_pipeline_test.rb
|
|
303
325
|
- test/integration/schema_edit_test.rb
|
|
304
326
|
- test/integration/schema_preview_test.rb
|
|
@@ -340,13 +362,18 @@ test_files:
|
|
|
340
362
|
- test/archived_form_elements_test.rb
|
|
341
363
|
- test/attribute_list_test.rb
|
|
342
364
|
- test/dummy/app/controllers/application_controller.rb
|
|
365
|
+
- test/dummy/app/controllers/documents_controller.rb
|
|
366
|
+
- test/dummy/app/controllers/dossiers_controller.rb
|
|
343
367
|
- test/dummy/app/controllers/gizmos_controller.rb
|
|
344
368
|
- test/dummy/app/controllers/machines_controller.rb
|
|
345
369
|
- test/dummy/app/controllers/parts_controller.rb
|
|
346
370
|
- test/dummy/app/controllers/stats_controller.rb
|
|
347
371
|
- test/dummy/app/controllers/widgets_controller.rb
|
|
348
372
|
- test/dummy/app/helpers/application_helper.rb
|
|
373
|
+
- test/dummy/app/models/ability.rb
|
|
349
374
|
- test/dummy/app/models/application_record.rb
|
|
375
|
+
- test/dummy/app/models/document.rb
|
|
376
|
+
- test/dummy/app/models/dossier.rb
|
|
350
377
|
- test/dummy/app/models/gizmo.rb
|
|
351
378
|
- test/dummy/app/models/kind.rb
|
|
352
379
|
- test/dummy/app/models/machine.rb
|
|
@@ -364,12 +391,16 @@ test_files:
|
|
|
364
391
|
- test/inline_edit_polymorphic_path_test.rb
|
|
365
392
|
- test/inline_forms_addto_generator_test.rb
|
|
366
393
|
- test/inline_forms_generator_test.rb
|
|
394
|
+
- test/integration/field_authorization_test.rb
|
|
395
|
+
- test/integration/file_slots_test.rb
|
|
367
396
|
- test/integration/inline_forms_crud_test.rb
|
|
397
|
+
- test/integration/layout_title_test.rb
|
|
368
398
|
- test/integration/legacy_elements_test.rb
|
|
369
399
|
- test/integration/model_top_bar_test.rb
|
|
370
400
|
- test/integration/native_inputs_test.rb
|
|
371
401
|
- test/integration/open_after_create_test.rb
|
|
372
402
|
- test/integration/pending_migration_gate_test.rb
|
|
403
|
+
- test/integration/revert_skipped_columns_test.rb
|
|
373
404
|
- test/integration/schema_batch_pipeline_test.rb
|
|
374
405
|
- test/integration/schema_edit_test.rb
|
|
375
406
|
- test/integration/schema_preview_test.rb
|
data/.claude/settings.local.json
DELETED
data/CLAUDE.md
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md — inline_forms
|
|
2
|
-
|
|
3
|
-
Instructions for any work in the inline_forms repo (`/home/code/inline_forms`).
|
|
4
|
-
These apply to all work here and take precedence over global defaults where they
|
|
5
|
-
conflict. Consolidated from the former `stuff/prompt/workflow.md` and
|
|
6
|
-
`stuff/prompt/test-the-example-app.md`.
|
|
7
|
-
|
|
8
|
-
## Workflow after any significant change
|
|
9
|
-
|
|
10
|
-
1. Run the full example-app test (see **Testing the example app** below). Keep
|
|
11
|
-
improving until all tests succeed.
|
|
12
|
-
2. Bump the **patch** version. Stay in the **8.1** line until further notice.
|
|
13
|
-
Never bump the minor version — even for big or breaking changes.
|
|
14
|
-
- Change the version in **all four gems** so they stay in lockstep, always,
|
|
15
|
-
even if nothing changed in some of them:
|
|
16
|
-
`validation_hints`, `inline_forms`, `inline_forms_installer`, and
|
|
17
|
-
`inline_forms_schema_edit` (in this repo under `inline_forms_schema_edit/`).
|
|
18
|
-
3. Update the Changelog of all four gems.
|
|
19
|
-
4. Commit everything.
|
|
20
|
-
5. After committing, push to the `forgejo` remote
|
|
21
|
-
(`ssh://forgejo@dev02:2222/ace/...`) in **both repos** (inline_forms and
|
|
22
|
-
validation_hints) so every commit runs through CI (Forgejo Actions on dev02).
|
|
23
|
-
- Check the run at http://dev02:3300/ace/inline_forms/actions and fix
|
|
24
|
-
failures.
|
|
25
|
-
6. Never push to `origin` (GitHub). Only Ace pushes there, and GitHub must not
|
|
26
|
-
run anything (no `.github/workflows`).
|
|
27
|
-
|
|
28
|
-
## Testing the example app
|
|
29
|
-
|
|
30
|
-
Goal: build the current gem, install it into `/home/code/testInline`, recreate
|
|
31
|
-
`MyApp` from scratch using `--example`, and verify it with Rails tests.
|
|
32
|
-
|
|
33
|
-
Do all steps end-to-end without asking for confirmation unless a command fails.
|
|
34
|
-
|
|
35
|
-
### Steps
|
|
36
|
-
|
|
37
|
-
1. In `/home/code/inline_forms`:
|
|
38
|
-
- Ensure the latest code is used.
|
|
39
|
-
- Run: `rvm use .`
|
|
40
|
-
- Build gems:
|
|
41
|
-
`gem build inline_forms.gemspec && gem build inline_forms_installer.gemspec && (cd inline_forms_schema_edit && gem build inline_forms_schema_edit.gemspec)`
|
|
42
|
-
- Confirm the built file names/versions
|
|
43
|
-
(`inline_forms-<version>.gem`, `inline_forms_installer-<version>.gem`,
|
|
44
|
-
`inline_forms_schema_edit/inline_forms_schema_edit-<version>.gem`).
|
|
45
|
-
|
|
46
|
-
2. In `/home/code/testInline`:
|
|
47
|
-
- Remove the old app if present: `/home/code/testInline/MyApp`
|
|
48
|
-
- Run: `rvm use .`
|
|
49
|
-
- Install the freshly built gems from
|
|
50
|
-
`/home/code/inline_forms/inline_forms-<version>.gem`,
|
|
51
|
-
`inline_forms_installer-<version>.gem`, and
|
|
52
|
-
`inline_forms_schema_edit/inline_forms_schema_edit-<version>.gem`.
|
|
53
|
-
|
|
54
|
-
3. Still in `/home/code/testInline`:
|
|
55
|
-
- Generate a fresh example app:
|
|
56
|
-
`inline_forms create MyApp -d sqlite --example`
|
|
57
|
-
|
|
58
|
-
4. In `/home/code/testInline/MyApp`:
|
|
59
|
-
- Run: `rvm use .`
|
|
60
|
-
- Run verification: `rails test`
|
|
61
|
-
|
|
62
|
-
### Output requirements
|
|
63
|
-
|
|
64
|
-
- Briefly report each phase result (build, install, app generation, test run).
|
|
65
|
-
- Include the exact commands run.
|
|
66
|
-
- Include the test summary (runs/assertions/failures/errors/skips).
|
|
67
|
-
- If anything fails, stop at the failing step and include the exact error and
|
|
68
|
-
the next corrective command you recommend.
|