docsmith 0.1.0

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 (45) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rspec_status +212 -0
  4. data/CHANGELOG.md +5 -0
  5. data/CODE_OF_CONDUCT.md +132 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +66 -0
  8. data/Rakefile +8 -0
  9. data/USAGE.md +510 -0
  10. data/docs/superpowers/plans/2026-04-01-docsmith-full-plan.md +6459 -0
  11. data/docs/superpowers/plans/2026-04-08-parsers-remove-branches-docs.md +2112 -0
  12. data/docs/superpowers/specs/2026-04-01-docsmith-phase1-design.md +340 -0
  13. data/docsmith_spec.md +630 -0
  14. data/lib/docsmith/auto_save.rb +29 -0
  15. data/lib/docsmith/comments/anchor.rb +68 -0
  16. data/lib/docsmith/comments/comment.rb +44 -0
  17. data/lib/docsmith/comments/manager.rb +73 -0
  18. data/lib/docsmith/comments/migrator.rb +64 -0
  19. data/lib/docsmith/configuration.rb +95 -0
  20. data/lib/docsmith/diff/engine.rb +39 -0
  21. data/lib/docsmith/diff/parsers/html.rb +64 -0
  22. data/lib/docsmith/diff/parsers/markdown.rb +60 -0
  23. data/lib/docsmith/diff/renderers/base.rb +62 -0
  24. data/lib/docsmith/diff/renderers/registry.rb +41 -0
  25. data/lib/docsmith/diff/renderers.rb +10 -0
  26. data/lib/docsmith/diff/result.rb +77 -0
  27. data/lib/docsmith/diff.rb +6 -0
  28. data/lib/docsmith/document.rb +44 -0
  29. data/lib/docsmith/document_version.rb +50 -0
  30. data/lib/docsmith/errors.rb +18 -0
  31. data/lib/docsmith/events/event.rb +19 -0
  32. data/lib/docsmith/events/hook_registry.rb +14 -0
  33. data/lib/docsmith/events/notifier.rb +22 -0
  34. data/lib/docsmith/rendering/html_renderer.rb +36 -0
  35. data/lib/docsmith/rendering/json_renderer.rb +29 -0
  36. data/lib/docsmith/version.rb +5 -0
  37. data/lib/docsmith/version_manager.rb +143 -0
  38. data/lib/docsmith/version_tag.rb +25 -0
  39. data/lib/docsmith/versionable.rb +252 -0
  40. data/lib/docsmith.rb +52 -0
  41. data/lib/generators/docsmith/install/install_generator.rb +27 -0
  42. data/lib/generators/docsmith/install/templates/create_docsmith_tables.rb.erb +64 -0
  43. data/lib/generators/docsmith/install/templates/docsmith_initializer.rb.erb +19 -0
  44. data/sig/docsmith.rbs +4 -0
  45. metadata +196 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2ac73e1aab94e9ac08a563be17f38f86c7bc3c054b1e160de5853f954f9265db
4
+ data.tar.gz: eab3d09587f2d63754f5b6f2d7a2e8cee767815797ac6a6412416230f97dd8b3
5
+ SHA512:
6
+ metadata.gz: dc5e70e6755c883572dd43c5ccbc66477da572d20c4bd280d128c5d0f899af92c29ecc6635fa57b1cd607ea49a1deeb6a0567909c8c250c34147e8399e359c45
7
+ data.tar.gz: 826aaf0e992b57f172f128c05651256d72ca18fa3eb93bfa2df6c9d9073ccc79187e3264a2dae53f60321ae5e8b7bbac113615f52cbb1ef8ee96d1ab23b8de9a
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
data/.rspec_status ADDED
@@ -0,0 +1,212 @@
1
+ example_id | status | run_time |
2
+ ----------------------------------------------------------- | ------ | --------------- |
3
+ ./spec/docsmith/auto_save_spec.rb[1:1:1] | passed | 0.00927 seconds |
4
+ ./spec/docsmith/auto_save_spec.rb[1:1:2] | passed | 0.00065 seconds |
5
+ ./spec/docsmith/auto_save_spec.rb[1:1:3] | passed | 0.00042 seconds |
6
+ ./spec/docsmith/auto_save_spec.rb[1:1:4] | passed | 0.00048 seconds |
7
+ ./spec/docsmith/auto_save_spec.rb[1:2:1] | passed | 0.001 seconds |
8
+ ./spec/docsmith/auto_save_spec.rb[1:2:2] | passed | 0.005 seconds |
9
+ ./spec/docsmith/comments/anchor_spec.rb[1:1:1] | passed | 0.00173 seconds |
10
+ ./spec/docsmith/comments/anchor_spec.rb[1:1:2] | passed | 0.0001 seconds |
11
+ ./spec/docsmith/comments/anchor_spec.rb[1:1:3] | passed | 0.00008 seconds |
12
+ ./spec/docsmith/comments/anchor_spec.rb[1:1:4] | passed | 0.00007 seconds |
13
+ ./spec/docsmith/comments/anchor_spec.rb[1:2:1:1] | passed | 0.0001 seconds |
14
+ ./spec/docsmith/comments/anchor_spec.rb[1:2:2:1] | passed | 0.00312 seconds |
15
+ ./spec/docsmith/comments/anchor_spec.rb[1:2:3:1] | passed | 0.0001 seconds |
16
+ ./spec/docsmith/comments/comment_spec.rb[1:1:1] | passed | 0.01138 seconds |
17
+ ./spec/docsmith/comments/comment_spec.rb[1:1:2] | passed | 0.00657 seconds |
18
+ ./spec/docsmith/comments/comment_spec.rb[1:2:1] | passed | 0.00551 seconds |
19
+ ./spec/docsmith/comments/comment_spec.rb[1:2:2] | passed | 0.00112 seconds |
20
+ ./spec/docsmith/comments/comment_spec.rb[1:3:1] | passed | 0.00272 seconds |
21
+ ./spec/docsmith/comments/comment_spec.rb[1:3:2] | passed | 0.00182 seconds |
22
+ ./spec/docsmith/comments/comment_spec.rb[1:3:3] | passed | 0.00198 seconds |
23
+ ./spec/docsmith/comments/comment_spec.rb[1:4:1] | passed | 0.00345 seconds |
24
+ ./spec/docsmith/comments/manager_spec.rb[1:1:1:1] | passed | 0.0013 seconds |
25
+ ./spec/docsmith/comments/manager_spec.rb[1:1:1:2] | passed | 0.0012 seconds |
26
+ ./spec/docsmith/comments/manager_spec.rb[1:1:1:3] | passed | 0.00128 seconds |
27
+ ./spec/docsmith/comments/manager_spec.rb[1:1:2:1] | passed | 0.00121 seconds |
28
+ ./spec/docsmith/comments/manager_spec.rb[1:1:3:1] | passed | 0.00147 seconds |
29
+ ./spec/docsmith/comments/manager_spec.rb[1:1:4] | passed | 0.00211 seconds |
30
+ ./spec/docsmith/comments/manager_spec.rb[1:2:1] | passed | 0.00285 seconds |
31
+ ./spec/docsmith/comments/manager_spec.rb[1:2:2] | passed | 0.00171 seconds |
32
+ ./spec/docsmith/comments/migrator_spec.rb[1:1:1:1] | passed | 0.00301 seconds |
33
+ ./spec/docsmith/comments/migrator_spec.rb[1:1:2:1] | passed | 0.00268 seconds |
34
+ ./spec/docsmith/comments/migrator_spec.rb[1:1:3:1] | passed | 0.01342 seconds |
35
+ ./spec/docsmith/configuration_spec.rb[1:1:1] | passed | 0.00226 seconds |
36
+ ./spec/docsmith/configuration_spec.rb[1:1:2] | passed | 0.00009 seconds |
37
+ ./spec/docsmith/configuration_spec.rb[2:1] | passed | 0.00011 seconds |
38
+ ./spec/docsmith/configuration_spec.rb[2:2] | passed | 0.00452 seconds |
39
+ ./spec/docsmith/configuration_spec.rb[2:3] | passed | 0.00009 seconds |
40
+ ./spec/docsmith/configuration_spec.rb[2:4] | passed | 0.00008 seconds |
41
+ ./spec/docsmith/configuration_spec.rb[2:5] | passed | 0.00007 seconds |
42
+ ./spec/docsmith/configuration_spec.rb[2:6] | passed | 0.00006 seconds |
43
+ ./spec/docsmith/configuration_spec.rb[2:7] | passed | 0.00006 seconds |
44
+ ./spec/docsmith/configuration_spec.rb[3:1] | passed | 0.00016 seconds |
45
+ ./spec/docsmith/configuration_spec.rb[3:2] | passed | 0.00006 seconds |
46
+ ./spec/docsmith/configuration_spec.rb[4:1] | passed | 0.00008 seconds |
47
+ ./spec/docsmith/configuration_spec.rb[4:2] | passed | 0.00008 seconds |
48
+ ./spec/docsmith/configuration_spec.rb[4:3] | passed | 0.00006 seconds |
49
+ ./spec/docsmith/configuration_spec.rb[4:4] | passed | 0.00007 seconds |
50
+ ./spec/docsmith/configuration_spec.rb[4:5] | passed | 0.00006 seconds |
51
+ ./spec/docsmith/diff/engine_spec.rb[1:1:1] | passed | 0.00169 seconds |
52
+ ./spec/docsmith/diff/engine_spec.rb[1:1:2] | passed | 0.00116 seconds |
53
+ ./spec/docsmith/diff/engine_spec.rb[1:1:3] | passed | 0.00113 seconds |
54
+ ./spec/docsmith/diff/engine_spec.rb[1:1:4] | passed | 0.00109 seconds |
55
+ ./spec/docsmith/diff/engine_spec.rb[1:2:1] | passed | 0.00116 seconds |
56
+ ./spec/docsmith/diff/engine_spec.rb[1:3:1] | passed | 0.00106 seconds |
57
+ ./spec/docsmith/diff/engine_spec.rb[1:3:2] | passed | 0.00109 seconds |
58
+ ./spec/docsmith/diff/parsers/html_spec.rb[1:1:1] | passed | 0.00016 seconds |
59
+ ./spec/docsmith/diff/parsers/html_spec.rb[1:1:2] | passed | 0.0001 seconds |
60
+ ./spec/docsmith/diff/parsers/html_spec.rb[1:1:3] | passed | 0.00017 seconds |
61
+ ./spec/docsmith/diff/parsers/html_spec.rb[1:1:4] | passed | 0.00009 seconds |
62
+ ./spec/docsmith/diff/parsers/html_spec.rb[1:1:5] | passed | 0.00009 seconds |
63
+ ./spec/docsmith/diff/parsers/html_spec.rb[1:1:6] | passed | 0.00009 seconds |
64
+ ./spec/docsmith/diff/parsers/html_spec.rb[1:1:7] | passed | 0.00009 seconds |
65
+ ./spec/docsmith/diff/parsers/markdown_spec.rb[1:1:1] | passed | 0.00009 seconds |
66
+ ./spec/docsmith/diff/parsers/markdown_spec.rb[1:1:2] | passed | 0.00009 seconds |
67
+ ./spec/docsmith/diff/parsers/markdown_spec.rb[1:1:3] | passed | 0.00008 seconds |
68
+ ./spec/docsmith/diff/parsers/markdown_spec.rb[1:1:4] | passed | 0.00008 seconds |
69
+ ./spec/docsmith/diff/parsers/markdown_spec.rb[1:1:5] | passed | 0.00016 seconds |
70
+ ./spec/docsmith/diff/parsers/markdown_spec.rb[1:1:6] | passed | 0.00009 seconds |
71
+ ./spec/docsmith/diff/parsers/markdown_spec.rb[1:1:7] | passed | 0.00008 seconds |
72
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[1:1:1] | passed | 0.00009 seconds |
73
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[1:1:2] | passed | 0.00008 seconds |
74
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[1:1:3] | passed | 0.00008 seconds |
75
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[1:1:4] | passed | 0.00007 seconds |
76
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[1:1:5] | passed | 0.00008 seconds |
77
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[1:2:1] | passed | 0.00008 seconds |
78
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[1:2:2] | passed | 0.00007 seconds |
79
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[1:2:3] | passed | 0.00011 seconds |
80
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[1:2:4] | passed | 0.00076 seconds |
81
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[2:1:1] | passed | 0.00009 seconds |
82
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[2:1:2] | passed | 0.00007 seconds |
83
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[2:1:3] | passed | 0.00006 seconds |
84
+ ./spec/docsmith/diff/renderers/base_renderer_spec.rb[2:2:1] | passed | 0.00007 seconds |
85
+ ./spec/docsmith/diff/result_spec.rb[1:1] | passed | 0.00007 seconds |
86
+ ./spec/docsmith/diff/result_spec.rb[1:2:1] | passed | 0.00007 seconds |
87
+ ./spec/docsmith/diff/result_spec.rb[1:3:1] | passed | 0.00006 seconds |
88
+ ./spec/docsmith/diff/result_spec.rb[1:4:1] | passed | 0.00008 seconds |
89
+ ./spec/docsmith/diff/result_spec.rb[1:5:1] | passed | 0.00019 seconds |
90
+ ./spec/docsmith/diff/result_spec.rb[1:5:2] | passed | 0.00008 seconds |
91
+ ./spec/docsmith/diff/result_spec.rb[1:5:3] | passed | 0.00009 seconds |
92
+ ./spec/docsmith/diff/result_spec.rb[1:5:4] | passed | 0.00009 seconds |
93
+ ./spec/docsmith/diff/result_spec.rb[1:5:5] | passed | 0.00008 seconds |
94
+ ./spec/docsmith/document_spec.rb[1:1:1] | passed | 0.00009 seconds |
95
+ ./spec/docsmith/document_spec.rb[1:2:1] | passed | 0.0011 seconds |
96
+ ./spec/docsmith/document_spec.rb[1:3:1] | passed | 0.00019 seconds |
97
+ ./spec/docsmith/document_spec.rb[1:3:2] | passed | 0.00014 seconds |
98
+ ./spec/docsmith/document_spec.rb[1:3:3] | passed | 0.00027 seconds |
99
+ ./spec/docsmith/document_spec.rb[1:4:1] | passed | 0.00358 seconds |
100
+ ./spec/docsmith/document_spec.rb[1:4:2] | passed | 0.0016 seconds |
101
+ ./spec/docsmith/document_spec.rb[1:4:3] | passed | 0.00147 seconds |
102
+ ./spec/docsmith/document_spec.rb[1:4:4] | passed | 0.00148 seconds |
103
+ ./spec/docsmith/document_spec.rb[1:5:1] | passed | 0.00054 seconds |
104
+ ./spec/docsmith/document_version_spec.rb[1:1:1] | passed | 0.00009 seconds |
105
+ ./spec/docsmith/document_version_spec.rb[1:2:1] | passed | 0.00051 seconds |
106
+ ./spec/docsmith/document_version_spec.rb[1:2:2] | passed | 0.00048 seconds |
107
+ ./spec/docsmith/document_version_spec.rb[1:2:3] | passed | 0.00079 seconds |
108
+ ./spec/docsmith/document_version_spec.rb[1:3:1] | passed | 0.00036 seconds |
109
+ ./spec/docsmith/document_version_spec.rb[1:4:1] | passed | 0.00084 seconds |
110
+ ./spec/docsmith/document_version_spec.rb[1:4:2] | passed | 0.0011 seconds |
111
+ ./spec/docsmith/document_version_spec.rb[1:5:1] | passed | 0.0008 seconds |
112
+ ./spec/docsmith/document_version_spec.rb[1:5:2] | passed | 0.00071 seconds |
113
+ ./spec/docsmith/document_version_spec.rb[1:5:3] | passed | 0.00072 seconds |
114
+ ./spec/docsmith/errors_spec.rb[1:1] | passed | 0.00009 seconds |
115
+ ./spec/docsmith/errors_spec.rb[1:2] | passed | 0.00006 seconds |
116
+ ./spec/docsmith/errors_spec.rb[1:3] | passed | 0.00007 seconds |
117
+ ./spec/docsmith/events/event_spec.rb[1:1] | passed | 0.00006 seconds |
118
+ ./spec/docsmith/events/event_spec.rb[1:2] | passed | 0.00007 seconds |
119
+ ./spec/docsmith/events/event_spec.rb[1:3] | passed | 0.00007 seconds |
120
+ ./spec/docsmith/events/notifier_spec.rb[1:1:1] | passed | 0.00012 seconds |
121
+ ./spec/docsmith/events/notifier_spec.rb[1:1:2] | passed | 0.00011 seconds |
122
+ ./spec/docsmith/events/notifier_spec.rb[1:1:3] | passed | 0.00008 seconds |
123
+ ./spec/docsmith/phase1_integration_spec.rb[1:1] | passed | 0.01372 seconds |
124
+ ./spec/docsmith/phase1_integration_spec.rb[1:2] | passed | 0.00205 seconds |
125
+ ./spec/docsmith/phase1_integration_spec.rb[1:3] | passed | 0.00303 seconds |
126
+ ./spec/docsmith/phase1_integration_spec.rb[1:4] | passed | 0.00009 seconds |
127
+ ./spec/docsmith/phase2_integration_spec.rb[1:1] | passed | 0.00268 seconds |
128
+ ./spec/docsmith/phase2_integration_spec.rb[1:2] | passed | 0.00278 seconds |
129
+ ./spec/docsmith/phase2_integration_spec.rb[1:3] | passed | 0.00258 seconds |
130
+ ./spec/docsmith/phase2_integration_spec.rb[1:4] | passed | 0.00254 seconds |
131
+ ./spec/docsmith/phase2_integration_spec.rb[1:5] | passed | 0.00249 seconds |
132
+ ./spec/docsmith/phase2_integration_spec.rb[1:6] | passed | 0.00505 seconds |
133
+ ./spec/docsmith/phase3_integration_spec.rb[1:1] | passed | 0.00395 seconds |
134
+ ./spec/docsmith/phase3_integration_spec.rb[1:2] | passed | 0.00288 seconds |
135
+ ./spec/docsmith/phase3_integration_spec.rb[1:3] | passed | 0.00322 seconds |
136
+ ./spec/docsmith/phase3_integration_spec.rb[1:4] | passed | 0.00344 seconds |
137
+ ./spec/docsmith/phase3_integration_spec.rb[1:5] | passed | 0.00365 seconds |
138
+ ./spec/docsmith/phase3_integration_spec.rb[1:6] | passed | 0.00325 seconds |
139
+ ./spec/docsmith/rendering/html_renderer_spec.rb[1:1:1:1] | passed | 0.00012 seconds |
140
+ ./spec/docsmith/rendering/html_renderer_spec.rb[1:1:2:1] | passed | 0.0001 seconds |
141
+ ./spec/docsmith/rendering/html_renderer_spec.rb[1:1:3:1] | passed | 0.0001 seconds |
142
+ ./spec/docsmith/rendering/html_renderer_spec.rb[1:1:4:1] | passed | 0.0001 seconds |
143
+ ./spec/docsmith/rendering/json_renderer_spec.rb[1:1:1:1] | passed | 0.00009 seconds |
144
+ ./spec/docsmith/rendering/json_renderer_spec.rb[1:1:2:1] | passed | 0.0001 seconds |
145
+ ./spec/docsmith/rendering/json_renderer_spec.rb[1:1:3:1] | passed | 0.00009 seconds |
146
+ ./spec/docsmith/version_manager_spec.rb[1:1:1] | passed | 0.00118 seconds |
147
+ ./spec/docsmith/version_manager_spec.rb[1:1:2] | passed | 0.00167 seconds |
148
+ ./spec/docsmith/version_manager_spec.rb[1:1:3] | passed | 0.00119 seconds |
149
+ ./spec/docsmith/version_manager_spec.rb[1:1:4] | passed | 0.00243 seconds |
150
+ ./spec/docsmith/version_manager_spec.rb[1:1:5] | passed | 0.00134 seconds |
151
+ ./spec/docsmith/version_manager_spec.rb[1:1:6] | passed | 0.00128 seconds |
152
+ ./spec/docsmith/version_manager_spec.rb[1:1:7] | passed | 0.00135 seconds |
153
+ ./spec/docsmith/version_manager_spec.rb[1:1:8] | passed | 0.00132 seconds |
154
+ ./spec/docsmith/version_manager_spec.rb[1:1:9:1] | passed | 0.00384 seconds |
155
+ ./spec/docsmith/version_manager_spec.rb[1:1:9:2] | passed | 0.00309 seconds |
156
+ ./spec/docsmith/version_manager_spec.rb[1:2:1] | passed | 0.00222 seconds |
157
+ ./spec/docsmith/version_manager_spec.rb[1:2:2] | passed | 0.00225 seconds |
158
+ ./spec/docsmith/version_manager_spec.rb[1:2:3] | passed | 0.00217 seconds |
159
+ ./spec/docsmith/version_manager_spec.rb[1:2:4] | passed | 0.00222 seconds |
160
+ ./spec/docsmith/version_manager_spec.rb[1:2:5] | passed | 0.00182 seconds |
161
+ ./spec/docsmith/version_manager_spec.rb[1:3:1] | passed | 0.00165 seconds |
162
+ ./spec/docsmith/version_manager_spec.rb[1:3:2] | passed | 0.00159 seconds |
163
+ ./spec/docsmith/version_manager_spec.rb[1:3:3] | passed | 0.00183 seconds |
164
+ ./spec/docsmith/version_manager_spec.rb[1:3:4] | passed | 0.00119 seconds |
165
+ ./spec/docsmith/version_tag_spec.rb[1:1:1] | passed | 0.00009 seconds |
166
+ ./spec/docsmith/version_tag_spec.rb[1:2:1] | passed | 0.00082 seconds |
167
+ ./spec/docsmith/version_tag_spec.rb[1:2:2] | passed | 0.00102 seconds |
168
+ ./spec/docsmith/version_tag_spec.rb[1:2:3] | passed | 0.00149 seconds |
169
+ ./spec/docsmith/versionable_spec.rb[1:1:1] | passed | 0.00011 seconds |
170
+ ./spec/docsmith/versionable_spec.rb[1:1:2] | passed | 0.00007 seconds |
171
+ ./spec/docsmith/versionable_spec.rb[1:1:3] | passed | 0.00007 seconds |
172
+ ./spec/docsmith/versionable_spec.rb[1:1:4] | passed | 0.00006 seconds |
173
+ ./spec/docsmith/versionable_spec.rb[1:2:1] | passed | 0.00159 seconds |
174
+ ./spec/docsmith/versionable_spec.rb[1:2:2] | passed | 0.0013 seconds |
175
+ ./spec/docsmith/versionable_spec.rb[1:2:3] | passed | 0.0013 seconds |
176
+ ./spec/docsmith/versionable_spec.rb[1:2:4] | passed | 0.00127 seconds |
177
+ ./spec/docsmith/versionable_spec.rb[1:3:1] | passed | 0.0032 seconds |
178
+ ./spec/docsmith/versionable_spec.rb[1:3:2] | passed | 0.00155 seconds |
179
+ ./spec/docsmith/versionable_spec.rb[1:3:3] | passed | 0.0015 seconds |
180
+ ./spec/docsmith/versionable_spec.rb[1:3:4] | passed | 0.00159 seconds |
181
+ ./spec/docsmith/versionable_spec.rb[1:3:5] | passed | 0.00051 seconds |
182
+ ./spec/docsmith/versionable_spec.rb[1:3:6] | passed | 0.00232 seconds |
183
+ ./spec/docsmith/versionable_spec.rb[1:4:1] | passed | 0.0017 seconds |
184
+ ./spec/docsmith/versionable_spec.rb[1:4:2] | passed | 0.00183 seconds |
185
+ ./spec/docsmith/versionable_spec.rb[1:4:3] | passed | 0.00186 seconds |
186
+ ./spec/docsmith/versionable_spec.rb[1:4:4] | passed | 0.00043 seconds |
187
+ ./spec/docsmith/versionable_spec.rb[1:5:1] | passed | 0.00043 seconds |
188
+ ./spec/docsmith/versionable_spec.rb[1:5:2] | passed | 0.00149 seconds |
189
+ ./spec/docsmith/versionable_spec.rb[1:6:1:1] | passed | 0.00289 seconds |
190
+ ./spec/docsmith/versionable_spec.rb[1:6:2:1] | passed | 0.00316 seconds |
191
+ ./spec/docsmith/versionable_spec.rb[1:6:3:1] | passed | 0.00315 seconds |
192
+ ./spec/docsmith/versionable_spec.rb[1:6:3:2] | passed | 0.00267 seconds |
193
+ ./spec/docsmith/versionable_spec.rb[1:7:1] | passed | 0.00317 seconds |
194
+ ./spec/docsmith/versionable_spec.rb[1:7:2] | passed | 0.00432 seconds |
195
+ ./spec/docsmith/versionable_spec.rb[1:7:3] | passed | 0.00276 seconds |
196
+ ./spec/docsmith/versionable_spec.rb[1:8:1:1] | passed | 0.00246 seconds |
197
+ ./spec/docsmith/versionable_spec.rb[1:8:1:2] | passed | 0.00253 seconds |
198
+ ./spec/docsmith/versionable_spec.rb[1:8:2:1] | passed | 0.00244 seconds |
199
+ ./spec/docsmith/versionable_spec.rb[1:8:2:2] | passed | 0.00169 seconds |
200
+ ./spec/docsmith/versionable_spec.rb[1:8:3:1] | passed | 0.00281 seconds |
201
+ ./spec/docsmith/versionable_spec.rb[1:8:3:2] | passed | 0.00235 seconds |
202
+ ./spec/docsmith/versionable_spec.rb[1:9:1] | passed | 0.00295 seconds |
203
+ ./spec/docsmith/versionable_spec.rb[1:9:2] | passed | 0.00248 seconds |
204
+ ./spec/docsmith/versionable_spec.rb[1:10:1] | passed | 0.00416 seconds |
205
+ ./spec/docsmith/versionable_spec.rb[1:11:1] | passed | 0.00204 seconds |
206
+ ./spec/docsmith/versionable_spec.rb[1:11:2] | passed | 0.00192 seconds |
207
+ ./spec/docsmith/versionable_spec.rb[1:12:1] | passed | 0.00402 seconds |
208
+ ./spec/docsmith/versionable_spec.rb[1:13:1] | passed | 0.00376 seconds |
209
+ ./spec/docsmith/versionable_spec.rb[1:14:1] | passed | 0.00383 seconds |
210
+ ./spec/docsmith/versionable_spec.rb[1:15:1] | passed | 0.00384 seconds |
211
+ ./spec/docsmith_spec.rb[1:1] | passed | 0.00009 seconds |
212
+ ./spec/docsmith_spec.rb[1:2] | passed | 0.0018 seconds |
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2026-03-31
4
+
5
+ - Initial release
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 swastik009
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Docsmith
2
+
3
+ Docsmith adds snapshot-based versioning, format-aware diffs, and inline comments to any
4
+ ActiveRecord model — with zero system dependencies.
5
+
6
+ ## Features
7
+
8
+ - **Full content snapshots** for HTML, Markdown, and JSON — instant rollback to any version
9
+ - **Format-aware diffs** — word-level diffs for Markdown; HTML tags treated as atomic tokens
10
+ - **Inline and document-level comments** with threading, resolution, and version migration
11
+ - **Debounced auto-save** with per-class and global configuration
12
+ - **Lifecycle events** — hook into version_created, version_restored, version_tagged
13
+ - **Clean service API** — works standalone without any model mixin
14
+
15
+ ## Quick Start
16
+
17
+ ```ruby
18
+ # Gemfile
19
+ gem "docsmith"
20
+ ```
21
+
22
+ ```bash
23
+ rails generate docsmith:install
24
+ rails db:migrate
25
+ ```
26
+
27
+ ```ruby
28
+ class Article < ApplicationRecord
29
+ include Docsmith::Versionable
30
+ docsmith_config { content_field :body; content_type :markdown }
31
+ end
32
+
33
+ article.body = "New draft"
34
+ article.save!
35
+ article.save_version!(author: current_user, summary: "First draft")
36
+
37
+ result = article.diff_from(1)
38
+ result.additions # word-level count for markdown
39
+ result.to_html # <ins>/<del> markup
40
+ ```
41
+
42
+ ## Documentation
43
+
44
+ See **[USAGE.md](USAGE.md)** for full documentation including:
45
+
46
+ - Installation and migration
47
+ - Per-class and global configuration
48
+ - Saving, querying, and restoring versions
49
+ - Version tagging
50
+ - Format-aware diffs (Markdown and HTML parsers)
51
+ - Inline and document-level comments
52
+ - Events and hooks
53
+ - Standalone Document API
54
+ - Configuration reference
55
+
56
+ ## Development
57
+
58
+ ```bash
59
+ bin/setup
60
+ bundle exec rspec # run tests
61
+ bin/console # interactive console
62
+ ```
63
+
64
+ ## License
65
+
66
+ MIT — see [LICENSE.txt](LICENSE.txt).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec