scriptorium 0.6.1 → 0.7.2

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 (358) hide show
  1. checksums.yaml +4 -4
  2. data/assets/icons/social/reddit.png +0 -0
  3. data/assets/icons/social/x-logo.png +0 -0
  4. data/assets/imagenotfound.jpg +0 -0
  5. data/bin/sblog +84 -5
  6. data/bin/scriptorium +1 -0
  7. data/doc/anti-amnesia/20250727-054000-scriptorium-overview.md +0 -1
  8. data/doc/anti-amnesia/20250727-123000-anti-amnesia-conventions.md +0 -29
  9. data/doc/anti-amnesia/20250727-172600-cursor-rbenv-ruby-version-mystery.md +0 -19
  10. data/doc/anti-amnesia/20250727-172900-ai-cognitive-assessment-capabilities.md +1 -1
  11. data/doc/anti-amnesia/20250728-124243-aaa-syntax-clarification.md +1 -1
  12. data/doc/anti-amnesia/20250729-210000-reddit-autopost-integration-complete.md +1 -1
  13. data/doc/anti-amnesia/20250804-190500-cognitive-loop-bug.md +0 -10
  14. data/doc/anti-amnesia/20250804-190700-anti-amnesia-timestamping-fix.md +1 -4
  15. data/doc/anti-amnesia/20250901-211714-codemirror-integration-and-web-tests.md +172 -0
  16. data/doc/anti-amnesia/20250902-002402-backup-restore-system.md +126 -0
  17. data/doc/anti-amnesia/20250907-203339-backup-metadata-implementation.md +66 -0
  18. data/doc/imported/0001-elixir-conf-2014/metadata.txt +7 -0
  19. data/doc/imported/0001-elixir-conf-2014/post.html +37 -0
  20. data/doc/imported/0001-elixir-conf-2014/source.lt3 +22 -0
  21. data/doc/imported/0002-programmers-and-word-processing/metadata.txt +7 -0
  22. data/doc/imported/0002-programmers-and-word-processing/post.html +192 -0
  23. data/doc/imported/0002-programmers-and-word-processing/source.lt3 +146 -0
  24. data/doc/imported/0003-how-to-turn-your-brain-sideways/metadata.txt +7 -0
  25. data/doc/imported/0003-how-to-turn-your-brain-sideways/post.html +60 -0
  26. data/doc/imported/0003-how-to-turn-your-brain-sideways/source.lt3 +40 -0
  27. data/doc/imported/0004-upcoming-lone-star-ruby-conference/metadata.txt +7 -0
  28. data/doc/imported/0004-upcoming-lone-star-ruby-conference/post.html +42 -0
  29. data/doc/imported/0004-upcoming-lone-star-ruby-conference/source.lt3 +24 -0
  30. data/doc/imported/0005-elixir-conf-2015-announced/metadata.txt +7 -0
  31. data/doc/imported/0005-elixir-conf-2015-announced/post.html +30 -0
  32. data/doc/imported/0005-elixir-conf-2015-announced/source.lt3 +16 -0
  33. data/doc/imported/0006-ruby-for-dinosaurs/metadata.txt +7 -0
  34. data/doc/imported/0006-ruby-for-dinosaurs/post.html +43 -0
  35. data/doc/imported/0006-ruby-for-dinosaurs/source.lt3 +27 -0
  36. data/doc/imported/0007-phoenix-isnt-rails/metadata.txt +7 -0
  37. data/doc/imported/0007-phoenix-isnt-rails/post.html +116 -0
  38. data/doc/imported/0007-phoenix-isnt-rails/source.lt3 +87 -0
  39. data/doc/imported/0008-concerning-the-term-monkeypatching/metadata.txt +7 -0
  40. data/doc/imported/0008-concerning-the-term-monkeypatching/post.html +129 -0
  41. data/doc/imported/0008-concerning-the-term-monkeypatching/source.lt3 +92 -0
  42. data/doc/imported/0009-announcement-coming-soon/metadata.txt +7 -0
  43. data/doc/imported/0009-announcement-coming-soon/post.html +33 -0
  44. data/doc/imported/0009-announcement-coming-soon/source.lt3 +19 -0
  45. data/doc/imported/0010-immutable-data-ditching-the-wax-tablet/metadata.txt +7 -0
  46. data/doc/imported/0010-immutable-data-ditching-the-wax-tablet/post.html +175 -0
  47. data/doc/imported/0010-immutable-data-ditching-the-wax-tablet/source.lt3 +139 -0
  48. data/doc/imported/0011-computer-science-as-a-lost-art/metadata.txt +7 -0
  49. data/doc/imported/0011-computer-science-as-a-lost-art/post.html +139 -0
  50. data/doc/imported/0011-computer-science-as-a-lost-art/source.lt3 +104 -0
  51. data/doc/imported/0012-ruby-day-in-turin-italy/metadata.txt +7 -0
  52. data/doc/imported/0012-ruby-day-in-turin-italy/post.html +42 -0
  53. data/doc/imported/0012-ruby-day-in-turin-italy/source.lt3 +24 -0
  54. data/doc/imported/0013-rubyday-was-a-success/metadata.txt +7 -0
  55. data/doc/imported/0013-rubyday-was-a-success/post.html +44 -0
  56. data/doc/imported/0013-rubyday-was-a-success/source.lt3 +27 -0
  57. data/doc/imported/0014-working-on-the-blogging-software/metadata.txt +7 -0
  58. data/doc/imported/0014-working-on-the-blogging-software/post.html +63 -0
  59. data/doc/imported/0014-working-on-the-blogging-software/source.lt3 +41 -0
  60. data/doc/imported/0015-ok-its-not-really-a-lost-art/metadata.txt +7 -0
  61. data/doc/imported/0015-ok-its-not-really-a-lost-art/post.html +172 -0
  62. data/doc/imported/0015-ok-its-not-really-a-lost-art/source.lt3 +134 -0
  63. data/doc/imported/0016-an-in-operator-for-ruby/metadata.txt +7 -0
  64. data/doc/imported/0016-an-in-operator-for-ruby/post.html +155 -0
  65. data/doc/imported/0016-an-in-operator-for-ruby/source.lt3 +106 -0
  66. data/doc/imported/0017-the-forgotten-mathematician/metadata.txt +7 -0
  67. data/doc/imported/0017-the-forgotten-mathematician/post.html +161 -0
  68. data/doc/imported/0017-the-forgotten-mathematician/source.lt3 +119 -0
  69. data/doc/imported/0018-ruby-puns/metadata.txt +7 -0
  70. data/doc/imported/0018-ruby-puns/post.html +46 -0
  71. data/doc/imported/0018-ruby-puns/source.lt3 +28 -0
  72. data/doc/imported/0019-custom-exceptions-via-metaprogramming/metadata.txt +7 -0
  73. data/doc/imported/0019-custom-exceptions-via-metaprogramming/post.html +138 -0
  74. data/doc/imported/0019-custom-exceptions-via-metaprogramming/source.lt3 +101 -0
  75. data/doc/imported/0020-fffff/metadata.txt +7 -0
  76. data/doc/imported/0020-fffff/post.html +24 -0
  77. data/doc/imported/0020-fffff/source.lt3 +12 -0
  78. data/doc/imported/0021-trying-ror-yet-again/metadata.txt +7 -0
  79. data/doc/imported/0021-trying-ror-yet-again/post.html +26 -0
  80. data/doc/imported/0021-trying-ror-yet-again/source.lt3 +12 -0
  81. data/doc/imported/0023-doctor-sleep/metadata.txt +7 -0
  82. data/doc/imported/0023-doctor-sleep/post.html +63 -0
  83. data/doc/imported/0023-doctor-sleep/source.lt3 +44 -0
  84. data/doc/imported/0024-just-a-test/metadata.txt +7 -0
  85. data/doc/imported/0024-just-a-test/post.html +24 -0
  86. data/doc/imported/0024-just-a-test/source.lt3 +12 -0
  87. data/doc/imported/import_summary.txt +98 -0
  88. data/doc/livetext-informal-spec.txt +65 -0
  89. data/doc/myuserdoc/ch-0.lt3 +31 -0
  90. data/doc/myuserdoc/ch-1.lt3 +37 -0
  91. data/doc/myuserdoc/ch-10.lt3 +22 -0
  92. data/doc/myuserdoc/ch-2.lt3 +37 -0
  93. data/doc/myuserdoc/ch-3.lt3 +19 -0
  94. data/doc/myuserdoc/ch-4.lt3 +43 -0
  95. data/doc/myuserdoc/ch-5.lt3 +22 -0
  96. data/doc/myuserdoc/ch-6.lt3 +19 -0
  97. data/doc/myuserdoc/ch-7.lt3 +16 -0
  98. data/doc/myuserdoc/ch-8.lt3 +13 -0
  99. data/doc/myuserdoc/ch-9.lt3 +19 -0
  100. data/doc/myuserdoc/tweak.rb +18 -0
  101. data/doc/{userdoc-toc.txt → myuserdoc/userdoc-toc.txt} +27 -27
  102. data/doc/old-posts/0001-elixir-conf-2014.lt3 +24 -0
  103. data/doc/old-posts/0002-programmers-and-word-processing.lt3 +150 -0
  104. data/doc/old-posts/0003-how-to-turn-your-brain-sideways.lt3 +43 -0
  105. data/doc/old-posts/0004-upcoming-lone-star-ruby-conference.lt3 +26 -0
  106. data/doc/old-posts/0005-elixir-conf-2015-announced.lt3 +17 -0
  107. data/doc/old-posts/0006-ruby-for-dinosaurs.lt3 +30 -0
  108. data/doc/old-posts/0007-phoenix-isnt-rails.lt3 +90 -0
  109. data/doc/old-posts/0008-concerning-the-term-monkeypatching.lt3 +105 -0
  110. data/doc/old-posts/0009-announcement-coming-soon.lt3 +20 -0
  111. data/doc/old-posts/0010-immutable-data-ditching-the-wax-tablet.lt3 +142 -0
  112. data/doc/old-posts/0011-computer-science-as-a-lost-art.lt3 +117 -0
  113. data/doc/old-posts/0012-ruby-day-in-turin-italy.lt3 +26 -0
  114. data/doc/old-posts/0013-rubyday-was-a-success.lt3 +28 -0
  115. data/doc/old-posts/0014-working-on-the-blogging-software.lt3 +42 -0
  116. data/doc/old-posts/0015-ok-its-not-really-a-lost-art.lt3 +137 -0
  117. data/doc/old-posts/0016-an-in-operator-for-ruby.lt3 +142 -0
  118. data/doc/old-posts/0017-the-forgotten-mathematician.lt3 +129 -0
  119. data/doc/old-posts/0018-ruby-puns.lt3 +31 -0
  120. data/doc/old-posts/0019-custom-exceptions-via-metaprogramming.lt3 +116 -0
  121. data/doc/old-posts/0021-trying-ror-yet-again.lt3 +35 -0
  122. data/doc/old-posts/0023-doctor-sleep.lt3 +43 -0
  123. data/doc/old-posts/0024-just-a-test.lt3 +12 -0
  124. data/doc/old-posts/0025-trying-another-post.lt3 +12 -0
  125. data/doc/old-repo +1 -0
  126. data/doc/reddit_integration.md +2 -2
  127. data/doc/user.lt3 +0 -3
  128. data/lib/scriptorium/api.rb +1811 -78
  129. data/lib/scriptorium/banner_svg.rb +55 -68
  130. data/lib/scriptorium/contract.rb +3 -2
  131. data/lib/scriptorium/exceptions.rb +133 -102
  132. data/lib/scriptorium/helpers.rb +282 -82
  133. data/lib/scriptorium/post.rb +81 -17
  134. data/lib/scriptorium/reddit.rb +1 -1
  135. data/lib/scriptorium/repo.rb +478 -164
  136. data/lib/scriptorium/standard_files.rb +30 -396
  137. data/lib/scriptorium/support/common_js/clipboard.js +35 -0
  138. data/lib/scriptorium/support/common_js/content-loader.js +187 -0
  139. data/lib/scriptorium/support/common_js/navigation.js +52 -0
  140. data/lib/scriptorium/support/common_js/syntax-highlighting.js +27 -0
  141. data/lib/scriptorium/support/config/reddit_template.txt +17 -0
  142. data/{test/scriptorium-TEST-1754622690-146/views/sample → lib/scriptorium/support}/config/social.txt +1 -0
  143. data/lib/scriptorium/support/highlight/css.txt +2 -0
  144. data/lib/scriptorium/support/highlight/custom.css +119 -0
  145. data/lib/scriptorium/support/highlight/js.txt +1 -0
  146. data/lib/scriptorium/support/post_index/config.txt +15 -0
  147. data/lib/scriptorium/support/post_index/style.css +55 -0
  148. data/lib/scriptorium/support/templates/index_entry.lt3 +16 -0
  149. data/{test/scriptorium-TEST-1754622690-146/themes/standard/initial/post.lt3 → lib/scriptorium/support/templates/initial_post.lt3} +5 -5
  150. data/lib/scriptorium/support/templates/post.lt3 +104 -0
  151. data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/header.txt → lib/scriptorium/support/theme/header.lt3} +1 -1
  152. data/lib/scriptorium/theme.rb +83 -70
  153. data/lib/scriptorium/version.rb +2 -2
  154. data/lib/scriptorium/view.rb +194 -149
  155. data/lib/scriptorium.rb +24 -1
  156. data/lib/skeleton.rb +4 -1
  157. data/scriptorium.gemspec +2 -1
  158. data/test/WEB_INTEGRATION_README.md +196 -0
  159. data/test/all +40 -0
  160. data/test/banner_svg/unit.rb +267 -35
  161. data/test/config/deployment.txt +5 -0
  162. data/test/integration/integration_test.rb +7 -7
  163. data/test/integration/preview_flow_test.rb +94 -0
  164. data/test/livetext_plugin_test.rb +453 -182
  165. data/test/manual/banner-tests/test01.html +82 -18
  166. data/test/manual/banner-tests/test02.html +82 -18
  167. data/test/manual/banner-tests/test03.html +82 -18
  168. data/test/manual/banner-tests/test04.html +89 -25
  169. data/test/manual/banner-tests/test05.html +89 -25
  170. data/test/manual/banner-tests/test06.html +89 -25
  171. data/test/manual/banner-tests/test07.html +89 -25
  172. data/test/manual/banner-tests/test08.html +82 -18
  173. data/test/manual/banner-tests/test09.html +82 -18
  174. data/test/manual/banner-tests/test10.html +82 -18
  175. data/test/manual/banner-tests/test11.html +82 -18
  176. data/test/manual/banner-tests/test12.html +82 -18
  177. data/test/manual/banner-tests/test13.html +82 -18
  178. data/test/manual/banner-tests/test14.html +82 -18
  179. data/test/manual/banner-tests/test15.html +82 -18
  180. data/test/manual/banner-tests/test16.html +82 -18
  181. data/test/manual/banner-tests/test17.html +82 -18
  182. data/test/manual/banner-tests/test18.html +90 -26
  183. data/test/manual/banner-tests/test19.html +90 -26
  184. data/test/manual/banner-tests/test20.html +90 -26
  185. data/test/manual/banner-tests/test21.html +90 -26
  186. data/test/manual/banner-tests/test22.html +90 -26
  187. data/test/manual/banner-tests/test23.html +90 -26
  188. data/test/manual/banner-tests/test24.html +90 -26
  189. data/test/manual/banner-tests/test25.html +89 -25
  190. data/test/manual/banner_environment.rb +15 -2
  191. data/test/manual/codemirror_demo.html +773 -0
  192. data/test/manual/create_posts_for_web.rb +114 -0
  193. data/test/manual/preview_manual_test.rb +129 -0
  194. data/test/manual/test_banner_features.rb +14 -14
  195. data/test/manual/test_banner_integration.rb +115 -0
  196. data/test/manual/test_banner_radial.rb +87 -0
  197. data/test/manual/test_syntax_highlighting.rb +60 -40
  198. data/test/support/preview_utils.rb +88 -0
  199. data/test/test_gem_assets.rb +48 -0
  200. data/test/test_helpers.rb +10 -0
  201. data/test/tui_editor_integration_test.rb +15 -15
  202. data/test/tui_integration_test.rb +687 -441
  203. data/test/unit/api.rb +757 -37
  204. data/test/unit/asset_management.rb +195 -221
  205. data/test/unit/backup_test.rb +451 -0
  206. data/test/unit/contract_test.rb +1 -23
  207. data/test/unit/core.rb +415 -61
  208. data/test/unit/deploy_config_test.rb +248 -0
  209. data/test/unit/deploy_test.rb +312 -21
  210. data/test/unit/edit_post_test.rb +168 -0
  211. data/test/unit/gem_asset_management.rb +36 -42
  212. data/test/unit/livetext_basic.rb +23 -35
  213. data/test/unit/livetext_compatibility.rb +7 -14
  214. data/test/unit/parse_cmd_test.rb +260 -0
  215. data/test/unit/{symlink_test.rb → permalink_copy_test.rb} +47 -49
  216. data/test/unit/post.rb +91 -26
  217. data/test/unit/post_index_config_test.rb +258 -0
  218. data/test/unit/post_state_helpers_test.rb +137 -0
  219. data/test/unit/read_commented_file_test.rb +8 -6
  220. data/test/unit/repo.rb +75 -54
  221. data/test/unit/social_test.rb +41 -44
  222. data/test/unit/syntax_highlighting.rb +70 -0
  223. data/test/unit/theme_management_test.rb +91 -0
  224. data/test/unit/view.rb +79 -12
  225. data/test/unit/widgets.rb +8 -8
  226. data/test/web_integration_test.rb +231 -0
  227. data/test/web_test_helper.rb +218 -0
  228. data/test/web_workflow_test.rb +527 -0
  229. data/ui/tui/bin/scriptorium +885 -415
  230. data/ui/web/app/app.rb +1398 -176
  231. data/ui/web/app/assets/livetext_mode.js +244 -0
  232. data/ui/web/app/error_helpers.rb +16 -16
  233. data/ui/web/app/views/advanced_config.erb +8 -2
  234. data/ui/web/app/views/asset_management.erb +56 -0
  235. data/ui/web/app/views/backup_management.erb +238 -0
  236. data/ui/web/app/views/config_widget.erb +232 -0
  237. data/ui/web/app/views/dashboard.erb +64 -72
  238. data/ui/web/app/views/deploy_config.erb +3 -0
  239. data/ui/web/app/views/edit_pages.erb +170 -2
  240. data/ui/web/app/views/edit_post.erb +130 -9
  241. data/ui/web/app/views/edit_theme.erb +73 -0
  242. data/ui/web/app/views/edit_theme_file.erb +74 -0
  243. data/ui/web/app/views/theme_management.erb +130 -0
  244. data/ui/web/app/views/view_dashboard.erb +666 -25
  245. data/ui/web/app/views/widgets.erb +249 -0
  246. data/ui/web/bin/scriptorium-web +35 -24
  247. data/ui/web/tmp/timing.log +17 -0
  248. data/ui/web/tmp/web_server.log +0 -5
  249. metadata +190 -116
  250. data/assets/back-icon.png +0 -0
  251. data/assets/icons/facebook.svg +0 -1
  252. data/assets/icons/github.svg +0 -1
  253. data/assets/icons/instagram.svg +0 -1
  254. data/assets/icons/reddit.svg +0 -1
  255. data/assets/icons/x.svg +0 -1
  256. data/assets/icons/youtube.svg +0 -1
  257. data/bin/scriptorium +0 -1511
  258. data/doc/anti-amnesia/20250727-060000-api-design-tui-planning.md +0 -34
  259. data/doc/anti-amnesia/20250727-061000-runeblog-tui-analysis.md +0 -50
  260. data/doc/anti-amnesia/20250727-154000-livetext-plugin-file-stats.md +0 -73
  261. data/doc/anti-amnesia/20250727-172600-unified-minitest-framework.md +0 -70
  262. data/doc/anti-amnesia/20250727-173000-widget-testing-achievement.md +0 -110
  263. data/doc/anti-amnesia/20250727-180000-post-id-num-refactoring.md +0 -73
  264. data/doc/anti-amnesia/20250728-124421-conversation-summary-concise.md +0 -124
  265. data/doc/anti-amnesia/20250729-190000-scriptorium-tui-testing-complete.md +0 -46
  266. data/doc/anti-amnesia/20250729-200000-scriptorium-tui-testing-edit-file-workflow.md +0 -97
  267. data/doc/anti-amnesia/20250729-211500-dependency-management-system.md +0 -211
  268. data/doc/anti-amnesia/20250729-213000-python-virtual-environment-setup.md +0 -141
  269. data/doc/anti-amnesia/20250729-214500-theme-management-commands.md +0 -211
  270. data/doc/anti-amnesia/20250729-215000-version-update-to-0.6.0.md +0 -134
  271. data/doc/anti-amnesia/20250729-220000-user-guide-complete.md +0 -41
  272. data/doc/anti-amnesia/20250804-213700-publishing-test-fix.md +0 -49
  273. data/doc/anti-amnesia/20250804-214400-additional-test-fixes.md +0 -46
  274. data/doc/anti-amnesia/20250804-220000-asset-function-logic-clarification.md +0 -41
  275. data/doc/anti-amnesia/20250806-202032-asset-function-logic-clarification.md +0 -41
  276. data/doc/anti-amnesia/20250813-082428-syntax-highlighting-and-navigation-improvements.md +0 -256
  277. data/lib/scriptorium/syntax_highlighter.rb +0 -234
  278. data/test/manual/deploy_symlink_demo.rb +0 -142
  279. data/test/manual/symlink_demo.rb +0 -117
  280. data/test/manual/test2.rb +0 -12
  281. data/test/manual/test_banner_from_file.rb +0 -150
  282. data/test/manual/test_banner_in_header.rb +0 -35
  283. data/test/manual/test_code_highlighting.rb +0 -68
  284. data/test/manual/test_complex_header.rb +0 -74
  285. data/test/manual/test_empty_header.rb +0 -32
  286. data/test/manual/test_radial_custom.rb +0 -58
  287. data/test/manual/test_radial_large_radius.rb +0 -52
  288. data/test/manual/test_svg_debug.rb +0 -47
  289. data/test/pages-demo/config/currentview.txt +0 -1
  290. data/test/pages-demo/views/demo/config/common.js +0 -57
  291. data/test/pages-demo/views/demo/config/footer.txt +0 -1
  292. data/test/pages-demo/views/demo/config/global-head.txt +0 -8
  293. data/test/pages-demo/views/demo/config/header.txt +0 -1
  294. data/test/pages-demo/views/demo/config/layout.txt +0 -1
  295. data/test/pages-demo/views/demo/config/left.txt +0 -1
  296. data/test/pages-demo/views/demo/config/main.txt +0 -1
  297. data/test/pages-demo/views/demo/config/right.txt +0 -1
  298. data/test/pages-demo/views/demo/config.txt +0 -3
  299. data/test/pages-demo/views/demo/output/panes/footer.html +0 -1
  300. data/test/pages-demo/views/demo/output/panes/header.html +0 -1
  301. data/test/pages-demo/views/demo/output/panes/left.html +0 -1
  302. data/test/pages-demo/views/demo/output/panes/main.html +0 -1
  303. data/test/pages-demo/views/demo/output/panes/right.html +0 -1
  304. data/test/scriptorium-TEST-1754622690-146/config/bootstrap_css.txt +0 -5
  305. data/test/scriptorium-TEST-1754622690-146/config/bootstrap_js.txt +0 -4
  306. data/test/scriptorium-TEST-1754622690-146/config/common.js +0 -57
  307. data/test/scriptorium-TEST-1754622690-146/config/currentview.txt +0 -1
  308. data/test/scriptorium-TEST-1754622690-146/config/global-head.txt +0 -9
  309. data/test/scriptorium-TEST-1754622690-146/config/last_post_num.txt +0 -1
  310. data/test/scriptorium-TEST-1754622690-146/config/os_helpers.rb +0 -4
  311. data/test/scriptorium-TEST-1754622690-146/config/widgets.txt +0 -3
  312. data/test/scriptorium-TEST-1754622690-146/posts/0001/meta.txt +0 -8
  313. data/test/scriptorium-TEST-1754622690-146/posts/0001/source.lt3 +0 -6
  314. data/test/scriptorium-TEST-1754622690-146/themes/standard/README.txt +0 -1
  315. data/test/scriptorium-TEST-1754622690-146/themes/standard/config.txt +0 -1
  316. data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/gen/text.css +0 -1
  317. data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index.lt3 +0 -1
  318. data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index_entry.lt3 +0 -14
  319. data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/post.lt3 +0 -13
  320. data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/widget.lt3 +0 -1
  321. data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_css.txt +0 -5
  322. data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_js.txt +0 -4
  323. data/test/scriptorium-TEST-1754622690-146/views/sample/config/common.js +0 -57
  324. data/test/scriptorium-TEST-1754622690-146/views/sample/config/deploy.txt +0 -5
  325. data/test/scriptorium-TEST-1754622690-146/views/sample/config/footer.txt +0 -2
  326. data/test/scriptorium-TEST-1754622690-146/views/sample/config/global-head.txt +0 -9
  327. data/test/scriptorium-TEST-1754622690-146/views/sample/config/header.txt +0 -4
  328. data/test/scriptorium-TEST-1754622690-146/views/sample/config/layout.txt +0 -5
  329. data/test/scriptorium-TEST-1754622690-146/views/sample/config/left.txt +0 -3
  330. data/test/scriptorium-TEST-1754622690-146/views/sample/config/main.txt +0 -5
  331. data/test/scriptorium-TEST-1754622690-146/views/sample/config/right.txt +0 -3
  332. data/test/scriptorium-TEST-1754622690-146/views/sample/config/status.txt +0 -7
  333. data/test/scriptorium-TEST-1754622690-146/views/sample/config.txt +0 -3
  334. data/test/scriptorium-TEST-1754622690-146/views/sample/layout/footer.html +0 -3
  335. data/test/scriptorium-TEST-1754622690-146/views/sample/layout/header.html +0 -3
  336. data/test/scriptorium-TEST-1754622690-146/views/sample/layout/left.html +0 -3
  337. data/test/scriptorium-TEST-1754622690-146/views/sample/layout/main.html +0 -3
  338. data/test/scriptorium-TEST-1754622690-146/views/sample/layout/right.html +0 -3
  339. data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/footer.html +0 -1
  340. data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/header.html +0 -1
  341. data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/left.html +0 -1
  342. data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/main.html +0 -1
  343. data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/right.html +0 -1
  344. data/ui/web/tmp/web_server.pid +0 -1
  345. /data/{test/pages-demo/views/demo/config/bootstrap_css.txt → lib/scriptorium/support/bootstrap/css.txt} +0 -0
  346. /data/{test/pages-demo/views/demo/config/bootstrap_js.txt → lib/scriptorium/support/bootstrap/js.txt} +0 -0
  347. /data/{test/scriptorium-TEST-1754622690-146/views/sample → lib/scriptorium/support}/config/reddit.txt +0 -0
  348. /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout → lib/scriptorium/support/templates}/layout.txt +0 -0
  349. /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/footer.txt → lib/scriptorium/support/theme/footer.lt3} +0 -0
  350. /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/left.txt → lib/scriptorium/support/theme/left.lt3} +0 -0
  351. /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/main.txt → lib/scriptorium/support/theme/main.lt3} +0 -0
  352. /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/right.txt → lib/scriptorium/support/theme/right.lt3} +0 -0
  353. /data/test/manual/banner-tests/{config.txt → svg.txt} +0 -0
  354. /data/test/manual/{test6.rb → test_advanced_widgets.rb} +0 -0
  355. /data/test/manual/{test1.rb → test_basic_posts.rb} +0 -0
  356. /data/test/manual/{test4.rb → test_layout_widgets.rb} +0 -0
  357. /data/test/manual/{test5.rb → test_pagination.rb} +0 -0
  358. /data/test/manual/{test3.rb → test_random_posts.rb} +0 -0
@@ -1,34 +0,0 @@
1
- # API Design Decision & TUI Planning
2
-
3
- ## API Design Philosophy
4
- - **Keep mental model consistent** - API should match Repo's repo/view/post model
5
- - **Mental model changes reserved for UI** - different abstractions can be introduced in user interfaces
6
- - **Current API is placeholder** - provides minor conveniences but not fundamentally different from Repo
7
- - **Future API evolution** - may develop more significant differences as we discover real needs
8
-
9
- ## Next Priority: Text UI Development
10
- - **Simple text interface** - command-line based, not curses
11
- - **Wizard-based setup** - guided workflows for common tasks
12
- - **Fast setup wizards** - quick blog creation and configuration
13
- - **Interactive workflows** - step-by-step processes for complex operations
14
-
15
- ## TUI Design Considerations
16
- - **Wizard approach** - guided setup for new users/repositories
17
- - **Simple commands** - basic operations like create post, switch view
18
- - **Context awareness** - remember current view/state
19
- - **Error handling** - clear feedback and recovery options
20
- - **Progressive disclosure** - simple interface with access to advanced features
21
-
22
- ## Potential Wizards
23
- 1. **Repository Setup Wizard** - create new repo with sample content
24
- 2. **View Creation Wizard** - guided view setup with theme selection
25
- 3. **Post Creation Wizard** - interactive post creation with metadata
26
- 4. **Deployment Wizard** - guided deployment process
27
-
28
- ---
29
-
30
- **USER:**
31
- I am not yet noticing any real differences from Repo... maybe we could just say: API = Repo? mostly joking. As for the mental model, I would rather keep the API matching Repo -- that model might change for the UI, possibly. Let's keep it. Maybe we should start working on a simple text UI (with one or two "wizards" for fast setup)?
32
-
33
- **ASST:**
34
- [See above content]
@@ -1,50 +0,0 @@
1
- # Runeblog TUI Analysis
2
-
3
- ## Key Patterns from Runeblog TUI
4
-
5
- ### Auto-Discovery & Setup
6
- - **Repository detection** - checks for existing repo, offers to create if none found
7
- - **Guided initial setup** - "Do you want to do a quick setup?" with editor selection
8
- - **Software-driven questions** - system asks user what they want to do
9
- - **Fast vs. manual setup** - choice between quick defaults or manual configuration
10
-
11
- ### REPL Structure
12
- - **Main loop** - `mainloop()` with command parsing and error handling
13
- - **Context display** - shows current view in prompt: `[viewname]`
14
- - **Command history** - maintains command history and tab completion
15
- - **Error recovery** - comprehensive error handling with logging
16
-
17
- ### Command Patterns
18
- - **Simple commands** - `new post`, `new view`, `list posts`, `rebuild`
19
- - **Context-aware** - commands work with current view automatically
20
- - **Menu system** - `show_top_menu()` for complex operations
21
- - **File editing** - integrated editor support with vim parameters
22
-
23
- ### Key Files Structure
24
- - `bin/blog` - main entry point with auto-discovery
25
- - `lib/repl.rb` - command implementations and REPL logic
26
- - `lib/menus.rb` - menu system and file editing
27
- - `lib/runeblog.rb` - core blog functionality
28
-
29
- ### Interaction Flow
30
- 1. **Startup** - check for repo, create if needed, guided setup
31
- 2. **Main loop** - display context, get command, execute, repeat
32
- 3. **Commands** - simple text commands with context awareness
33
- 4. **Menus** - complex operations via menu system
34
- 5. **Error handling** - comprehensive logging and recovery
35
-
36
- ### Adaptable Patterns for Scriptorium
37
- - **Auto-discovery** - check for Scriptorium repo, offer creation
38
- - **Guided setup** - wizard for initial configuration
39
- - **Context display** - show current view in prompt
40
- - **Simple commands** - `create post`, `switch view`, `generate`
41
- - **Menu system** - for complex operations like configuration
42
- - **Error handling** - robust error recovery and logging
43
-
44
- ---
45
-
46
- **USER:**
47
- ok, the whole runeblog repo is there, bugs and all
48
-
49
- **ASST:**
50
- [See above content]
@@ -1,73 +0,0 @@
1
- # Livetext Plugin File Statistics Feature
2
-
3
- ## Overview
4
- Implemented a `.stats` dot command in the Scriptorium Livetext plugin (`lt3scriptor.rb`) that calculates file statistics and sets variables for use throughout the document.
5
-
6
- ## Implementation Details
7
-
8
- ### Dot Command
9
- - **`.stats`** - Calculates multiple file metrics and sets variables
10
-
11
- ### Variables Set
12
- - `$file.wordcount` - Number of words in the file
13
- - `$file.readingtime` - Estimated reading time in minutes (200 words/minute)
14
- - `$file.charcount` - Total character count
15
-
16
- ### Usage Example
17
- ```
18
- .stats
19
- This post has $file.wordcount words and takes about $file.readingtime minutes to read.
20
- The character count is $file.charcount.
21
- ```
22
-
23
- ## Technical Approach
24
-
25
- ### Why Dot Commands Instead of Functions
26
- - Livetext's `$$function` system is buggy and unreliable
27
- - Dot commands (`.command`) work consistently
28
- - Variable-based approach is more flexible than direct output
29
-
30
- ### Variable Naming Convention
31
- - Uses `file.` prefix to namespace file-related statistics
32
- - Follows lowercase convention after prefix to distinguish from system variables
33
- - System variables are capitalized (e.g., `$File`)
34
- - Custom variables are lowercase after prefix (e.g., `$file.wordcount`)
35
-
36
- ### Future Extensions
37
- Could easily add more metrics:
38
- - `$file.linecount` - Number of lines
39
- - `$file.paragraphcount` - Number of paragraphs
40
- - `$file.sentencecount` - Number of sentences
41
- - `$file.complexityscore` - Readability score
42
-
43
- ## Scriptorium Integration Ideas
44
-
45
- ### Automatic File Stats During Processing
46
- - File statistics could be automatically gathered when Scriptorium processes a post
47
- - This would eliminate the need for users to manually call `.stats`
48
- - Variables like `$file.wordcount` would be automatically available in all posts
49
-
50
- ### Scriptorium-Specific Variables
51
- - Could set additional Scriptorium-specific variables during processing:
52
- - `$post.id` - Post ID/number
53
- - `$post.view` - Current view name
54
- - `$post.theme` - Theme being used
55
- - `$post.created` - Creation timestamp
56
- - `$post.published` - Publication date
57
- - `$post.views` - List of views this post appears in
58
- - `$post.tags` - Post tags
59
- - `$post.blurb` - Post blurb/summary
60
-
61
- ### Processing Pipeline Enhancement
62
- - When `Scriptorium::Repo#generate_post` processes a draft with Livetext
63
- - Could automatically calculate and set file statistics
64
- - Could set post metadata variables
65
- - Would make these variables available in templates and layouts
66
-
67
- ## Testing
68
- - Added `test_stats_command` to `test/livetext_plugin_test.rb`
69
- - Tests that variables are set correctly and can be referenced inline
70
- - Verifies that literal variable names don't appear in output
71
-
72
- ## Potential for Livetext Core
73
- This feature could be a good addition to Livetext core someday, but should prioritize fixing existing bugs in the function system first.
@@ -1,70 +0,0 @@
1
- <!-- 2025-07-27 18:00:00 -->
2
-
3
- **USER:**
4
- I don't want two frameworks. I want to use Minitest.
5
-
6
- **ASST:**
7
- ## Unified Minitest Framework Conversion - COMPLETED
8
-
9
- ### The Problem
10
- - **Two different test frameworks** were being used simultaneously
11
- - **Minitest**: Used by unit tests (core, repo, view, post, banner_svg)
12
- - **Test::Unit**: Used by integration tests (livetext_plugin, tui_integration, tui_interactive)
13
- - **Confusing output**: When running `test/all`, both frameworks executed separately
14
- - **Inconsistent assertion counting**: 101 assertions appeared "missing" due to dual framework execution
15
-
16
- ### The Solution
17
- Converted all Test::Unit tests to Minitest:
18
-
19
- #### Files Converted:
20
- 1. **test/livetext_plugin_test.rb**
21
- - `require 'test/unit'` → `require 'minitest/autorun'`
22
- - `Test::Unit::TestCase` → `Minitest::Test`
23
- - `assert_no_match` → `refute_match` (Minitest syntax)
24
-
25
- 2. **test/tui_integration_test.rb**
26
- - `require 'test/unit'` → `require 'minitest/autorun'`
27
- - `Test::Unit::TestCase` → `Minitest::Test`
28
-
29
- 3. **test/tui_interactive_test.rb**
30
- - `require 'test/unit'` → `require 'minitest/autorun'`
31
- - `Test::Unit::TestCase` → `Minitest::Test`
32
-
33
- ### Results
34
- - ✅ **All tests pass**: 265 runs, 964 assertions, 0 failures
35
- - ✅ **Single framework**: Only Minitest now
36
- - ✅ **Consistent output**: No more dual framework confusion
37
- - ✅ **Clean assertion counting**: All assertions properly counted
38
-
39
- ### Key Changes Made
40
- ```ruby
41
- # Before (Test::Unit)
42
- require 'test/unit'
43
- class MyTest < Test::Unit::TestCase
44
- def test_something
45
- assert_no_match(/pattern/, text)
46
- end
47
- end
48
-
49
- # After (Minitest)
50
- require 'minitest/autorun'
51
- class MyTest < Minitest::Test
52
- def test_something
53
- refute_match(/pattern/, text)
54
- end
55
- end
56
- ```
57
-
58
- ### Benefits
59
- - **Simplified test infrastructure**: One framework to maintain
60
- - **Consistent syntax**: All tests use same assertion methods
61
- - **Better integration**: No framework conflicts
62
- - **Cleaner output**: Single test runner output format
63
- - **Easier debugging**: No confusion about which framework is running
64
-
65
- ### Files Still Using Test::Unit (Experimental)
66
- - `test/test_experimental.rb` - Experimental concatenated test generator
67
- - `test/temp_concatenated_test.rb` - Generated file (excluded from main suite)
68
- - `test/temp_smart_concatenated_test.rb` - Generated file (excluded from main suite)
69
-
70
- These are experimental files and not part of the main test suite, so they can remain as-is for now.
@@ -1,110 +0,0 @@
1
- # Widget Testing Achievement - 1,058 Assertions Reached
2
-
3
- **Date:** 2025-07-27 17:30:00
4
- **Status:** Completed
5
-
6
- ## Summary
7
-
8
- Successfully implemented comprehensive widget testing for the Scriptorium project, adding 94 new assertions and bringing the total test suite to **1,058 assertions** - exceeding the 1,000 assertion goal.
9
-
10
- ## What Was Accomplished
11
-
12
- ### 1. Fixed Widget Infrastructure Issues
13
- - **Problem:** Widget classes didn't have access to helper methods (`read_file`, `write_file`, etc.)
14
- - **Solution:** Added `include Scriptorium::Helpers` to the base `Scriptorium::Widget` class
15
- - **Impact:** All widget classes now have proper file I/O capabilities
16
-
17
- ### 2. Created Comprehensive Widget Test Suite
18
- - **File:** `test/unit/widgets.rb` (new)
19
- - **Tests Added:** 20 test methods with 94 assertions
20
- - **Coverage:** Complete widget system testing
21
-
22
- ### 3. Test Categories Implemented
23
-
24
- #### Base Widget Class Tests (6 tests)
25
- - Widget initialization and attribute setting
26
- - Abstract method implementation verification
27
- - HTML helper methods (`html_body`, `html_card`, `html_container`)
28
- - CSS integration testing
29
-
30
- #### ListWidget Subclass Tests (3 tests)
31
- - Data loading from `list.txt` files
32
- - Error handling for missing files
33
- - Empty file handling
34
-
35
- #### Links Widget Tests (8 tests)
36
- - Initialization and data loading
37
- - URL/title parsing (`get_list` method)
38
- - HTML generation (`link_item`, `write_card`)
39
- - Full widget lifecycle (`generate` method)
40
- - File output verification
41
- - Error handling for missing data files
42
-
43
- #### Widget Integration Tests (3 tests)
44
- - Widget integration with views (`build_widgets`)
45
- - Multiple widget handling
46
- - Error handling for invalid widget names
47
-
48
- ## Technical Details
49
-
50
- ### Widget Data Format
51
- - **Format:** `url, title` per line in `list.txt`
52
- - **Parsing:** Uses `line.chomp.split(/, */, 2)` to handle optional spaces
53
- - **Example:**
54
- ```
55
- https://example.com, Example Site
56
- https://test.com, Test Site
57
- https://spaced.com , Spaced Site
58
- ```
59
-
60
- ### Error Handling
61
- - **File I/O:** Leverages existing `read_file` helper error handling
62
- - **Missing files:** Raises `CannotReadFileNotFound` exception
63
- - **Invalid widget names:** Raises `CannotBuildWidgetNameInvalid` exception
64
- - **Widget class not found:** Raises `NameError` exception
65
-
66
- ### Test Architecture
67
- - **Test classes:** Defined at module level to avoid Ruby syntax restrictions
68
- - **Setup/Teardown:** Proper repository creation and cleanup
69
- - **File isolation:** Each test creates its own test files in isolated directories
70
- - **Assertion types:** Mix of equality, pattern matching, and file existence checks
71
-
72
- ## Test Results
73
-
74
- ```
75
- 20 runs, 94 assertions, 0 failures, 0 errors, 0 skips
76
- ```
77
-
78
- ## Full Test Suite Status
79
-
80
- ```
81
- 285 runs, 1058 assertions, 0 failures, 0 errors, 0 skips
82
- ```
83
-
84
- ## Key Learnings
85
-
86
- 1. **Widget Architecture:** The widget system is well-designed with clear separation between base classes, list widgets, and specific implementations
87
- 2. **Helper Integration:** Adding `include Scriptorium::Helpers` to the base Widget class was the key fix
88
- 3. **File Format:** The `url, title` format is simple but effective for the Links widget
89
- 4. **Error Handling:** The existing exception system works well for widget error cases
90
- 5. **Test Organization:** Module-level class definitions are necessary for Ruby test classes
91
-
92
- ## Next Steps
93
-
94
- The widget system now has comprehensive test coverage. Future enhancements could include:
95
- - Additional widget types (News, ByDates, etc.)
96
- - Widget configuration testing
97
- - Widget theme integration testing
98
- - Performance testing for large widget datasets
99
-
100
- ## Files Modified
101
-
102
- - `lib/scriptorium/widgets/widget.rb` - Added `include Scriptorium::Helpers`
103
- - `test/unit/widgets.rb` - Created comprehensive widget test suite
104
-
105
- ## Achievement
106
-
107
- ✅ **Goal Reached:** Exceeded 1,000 assertions (1,058 total)
108
- ✅ **Widget Coverage:** Complete test coverage for widget system
109
- ✅ **Test Quality:** All tests passing with comprehensive assertions
110
- ✅ **Code Quality:** Well-structured, maintainable test suite
@@ -1,73 +0,0 @@
1
- # Post Class ID/Num Refactoring - Cleaner API Design
2
-
3
- **Date:** 2025-07-27 18:00:00
4
- **Status:** Completed
5
-
6
- ## Summary
7
-
8
- Successfully refactored the `Scriptorium::Post` class to have a cleaner and more intuitive API design:
9
- - **`id`** is now an integer (was previously a string alias for `num`)
10
- - **`num`** remains a zero-padded string for file paths
11
- - **`num!`** method removed (was redundant with new `id`)
12
- - **`num_str`** method removed (was redundant with `num`)
13
-
14
- ## What Was Changed
15
-
16
- ### 1. Post Class Refactoring (`lib/scriptorium/post.rb`)
17
- - **Added `@id` instance variable**: Integer version of the post number
18
- - **Modified `initialize`**: Now sets both `@num` (string) and `@id` (integer)
19
- - **Removed old `id` method**: Was just an alias for `num`
20
- - **Removed `num!` method**: Functionality now provided by `id`
21
- - **Updated `attr_reader`**: Now includes `:id`
22
-
23
- ### 2. Repository Integration (`lib/scriptorium/repo.rb`)
24
- - **Fixed template variable**: `vars[:"post.id"] = num.to_s` to ensure string conversion for templates
25
-
26
- ### 3. API Class Fixes (`lib/scriptorium/api.rb`)
27
- - **Fixed `create_post` method**: Added missing `blurb` parameter support
28
- - **Fixed `quick_post` method**: Was calling wrong method (`post` instead of `create_post`)
29
-
30
- ### 4. Test Updates (`test/unit/post.rb`)
31
- - **Updated `test_id`**: Now expects integer instead of string
32
- - **Removed `num!` tests**: No longer needed
33
- - **All tests pass**: 34 runs, 43 assertions
34
-
35
- ### 5. Manual Test Updates (`test/manual/test5.rb`)
36
- - **Updated `generate_post` call**: Now uses `post.id` instead of `post.num!`
37
-
38
- ## Benefits of the Refactoring
39
-
40
- 1. **Clearer Intent**: `id` as integer clearly indicates it's for programmatic use
41
- 2. **Consistent API**: No more confusion between `num`, `num!`, and `id`
42
- 3. **Better Performance**: No need for string-to-integer conversion in `num!`
43
- 4. **Simpler Code**: Fewer methods to maintain and understand
44
-
45
- ## Usage Examples
46
-
47
- ```ruby
48
- post = Scriptorium::Post.new(repo, 123)
49
-
50
- # File operations (use num)
51
- post.num # => "0123"
52
- post.dir # => "posts/0123/"
53
-
54
- # Programmatic operations (use id)
55
- post.id # => 123
56
- @repo.generate_post(post.id) # Pass integer to generate_post
57
- ```
58
-
59
- ## Test Results
60
-
61
- - **All tests pass**: 283 runs, 1056 assertions, 0 failures
62
- - **API demo works**: Successfully creates posts with new integer `id`
63
- - **Backward compatibility**: Existing code using `num` continues to work
64
-
65
- ## Files Modified
66
-
67
- 1. `lib/scriptorium/post.rb` - Core refactoring
68
- 2. `lib/scriptorium/repo.rb` - Template variable fix
69
- 3. `lib/scriptorium/api.rb` - Method signature fixes
70
- 4. `test/unit/post.rb` - Test updates
71
- 5. `test/manual/test5.rb` - Manual test fix
72
-
73
- This refactoring eliminates the "clunkiness" in the Post class by providing a clear separation between string-based file operations (`num`) and integer-based programmatic operations (`id`).
@@ -1,124 +0,0 @@
1
- # Conversation Summary - Concise Version
2
-
3
- **Date**: 2025-07-28 12:44:21
4
- **Topic**: Scriptorium API enhancement and testing
5
- **Status**: Completed major API improvements
6
-
7
- ## Overview
8
-
9
- Extended conversation focused on enhancing the Scriptorium API, implementing missing methods, and improving the overall system architecture. Successfully implemented 15+ new API methods and resolved numerous technical issues.
10
-
11
- ## Key Accomplishments
12
-
13
- ### 1. Post Class Refactoring
14
- - **Made `id` an integer, `num` a zero-padded string**
15
- - **Removed redundant methods** (`num!`, `num_str`)
16
- - **Updated throughout codebase** (Post, Repo, API classes)
17
- - **Fixed all related tests**
18
-
19
- ### 2. File Renaming
20
- - **Renamed `header_svg.rb` to `banner_svg.rb`**
21
- - **Updated all require statements** across multiple files
22
- - **No broken dependencies**
23
-
24
- ### 3. API Method Implementations
25
- Implemented comprehensive set of new API methods:
26
-
27
- **Post Management:**
28
- - `select_posts(&block)` - Filter posts using blocks
29
- - `search_posts(**criteria)` - Text search across title, body, tags, blurb
30
- - `update_post(id, fields)` - Update post source files with field hash
31
- - `delete_post(id)` / `undelete_post(id)` - Safe delete with directory renaming
32
- - `post_add_view(id, view)` / `post_remove_view(id, view)` - View management
33
- - `post_add_tag(id, tag)` / `post_remove_tag(id, tag)` - Tag management
34
-
35
- **View Management:**
36
- - `views()` - List available views
37
- - `views_for(post_or_id)` - Get views for a post
38
- - `apply_theme(theme)` - Apply theme to current view
39
- - `themes_available()` - List available themes
40
- - `widgets_available()` - List configured widgets
41
-
42
- **Content Generation:**
43
- - `generate_widget(widget_name)` - Generate specific widgets
44
- - `generate_all()` - Generate all content for current view
45
- - `drafts()` - List draft files with titles
46
- - `delete_draft(draft_path)` - Delete draft files
47
-
48
- **Utility:**
49
- - `edit_file(path)` - Open files in editor
50
- - `post_attrs(post_id, *keys)` - Get multiple post attributes
51
-
52
- ### 4. System Improvements
53
- - **Safe delete mechanism**: Posts renamed to `_0123/` instead of permanent deletion
54
- - **Source file rename**: `draft.lt3` → `source.lt3` when drafts become posts
55
- - **Blurb integration**: Made blurb a first-class citizen in Post metadata
56
- - **Comprehensive error handling**: Robust validation and clear error messages
57
-
58
- ### 5. Testing Infrastructure
59
- - **Unified to Minitest**: Converted all Test::Unit tests to Minitest
60
- - **Comprehensive API tests**: 53 tests, 199 assertions, all passing
61
- - **Fixed multiple test issues**: Order dependencies, string vs array handling, metadata synchronization
62
- - **Created demo script**: Showcasing all new API functionality
63
-
64
- ## Technical Challenges Resolved
65
-
66
- ### Metadata Synchronization
67
- - **Problem**: Post metadata not updating after source file changes
68
- - **Solution**: Regenerate posts after updates to sync metadata
69
-
70
- ### String vs Array Handling
71
- - **Problem**: Views and tags returned as strings vs arrays inconsistently
72
- - **Solution**: Standardized on strings from metadata, arrays for processing
73
-
74
- ### Test Environment Issues
75
- - **Problem**: Test directory conflicts and cleanup issues
76
- - **Solution**: Consistent test directory handling and proper teardown
77
-
78
- ### Widget System Integration
79
- - **Problem**: Widget generation required manual file setup
80
- - **Solution**: Implemented `generate_widget()` with proper validation and error handling
81
-
82
- ## Files Modified
83
-
84
- **Core Classes:**
85
- - `lib/scriptorium/post.rb` - Refactored id/num handling
86
- - `lib/scriptorium/repo.rb` - Safe delete, source file rename
87
- - `lib/scriptorium/api.rb` - 15+ new methods implemented
88
- - `lib/scriptorium/banner_svg.rb` - Renamed from header_svg.rb
89
-
90
- **Templates:**
91
- - `lib/scriptorium/standard_files.rb` - Added blurb to post template
92
-
93
- **Tests:**
94
- - `test/unit/api.rb` - Comprehensive API testing (739 lines)
95
- - `test/unit/post.rb` - Updated for id/num refactoring
96
- - `test/api_demo.rb` - Demo script for new functionality
97
-
98
- **Integration:**
99
- - Updated all require statements for banner_svg rename
100
- - Fixed manual test scripts
101
-
102
- ## Current Status
103
-
104
- **✅ Completed:**
105
- - All major API methods implemented and tested
106
- - Post class refactoring complete
107
- - File renaming and dependency updates
108
- - Comprehensive test suite passing
109
- - Demo script working
110
-
111
- **🔄 Remaining:**
112
- - `edit_post(id)` - Smart editing (source vs body file)
113
- - `publish_draft(draft_path)` - Convenience method (commented out)
114
-
115
- ## Impact
116
-
117
- The Scriptorium API is now significantly more powerful and user-friendly. Users can:
118
- - Search and filter posts with flexible criteria
119
- - Manage post metadata through high-level methods
120
- - Safely delete and restore posts
121
- - Generate widgets and content programmatically
122
- - Work with drafts and themes efficiently
123
-
124
- The system is ready for production use with a robust, well-tested API.
@@ -1,46 +0,0 @@
1
- # Scriptorium TUI Testing and Refactoring Complete
2
-
3
- **Date:** 2025-07-29
4
- **Status:** Complete
5
- **Impact:** Major testing infrastructure and code quality improvements
6
-
7
- ## **Major Accomplishments:**
8
-
9
- 1. **Comprehensive TUI Testing** - Added extensive integration tests covering all TUI commands, error handling, edge cases, and interactive flows
10
-
11
- 2. **Editor Testing Infrastructure** - Created robust `ed` testing framework to verify editor interaction capabilities for automated testing
12
-
13
- 3. **Test Suite Consolidation** - Streamlined test organization by removing redundant tests and consolidating TUI integration tests
14
-
15
- 4. **Code Cleanup** - Removed debug logging code from TUI, making it production-ready
16
-
17
- 5. **API Architecture Refinement** - Updated API initialization pattern and fixed various edge cases in repository and post management
18
-
19
- ## **Test Coverage Achieved:**
20
- - **355 tests** with **1,348 assertions** - all passing
21
- - **Complete TUI command coverage** - help, view management, content creation, error handling
22
- - **Interactive flow testing** - setup wizard, editor configuration, user prompts
23
- - **Edge case handling** - unknown commands, empty input, whitespace parsing
24
- - **Non-TTY compatibility** - automated testing without interactive prompts
25
-
26
- ## **Key Technical Improvements:**
27
- - **Robust editor testing** using `ed` for reliable non-interactive testing
28
- - **Comprehensive error handling** tests for all failure scenarios
29
- - **Clean separation** between test and production code paths
30
- - **Simplified test maintenance** with consolidated test files
31
-
32
- ## **Files Modified:**
33
- - Enhanced TUI integration tests with missing functionality coverage
34
- - Created `ed_test.rb` for editor interaction testing
35
- - Removed logging code from `bin/scriptorium`
36
- - Consolidated and renamed setup tests
37
- - Updated API tests for new initialization pattern
38
-
39
- ## **Outcome:**
40
- The Scriptorium TUI now has enterprise-grade testing coverage and is ready for production use with confidence in its reliability and functionality.
41
-
42
- ## **Lessons Learned:**
43
- - `ed` is perfect for automated testing due to its non-interactive nature
44
- - Comprehensive TUI testing requires both unit and integration approaches
45
- - Debug logging should be removed from production code
46
- - Test consolidation improves maintainability significantly
@@ -1,97 +0,0 @@
1
- # Scriptorium TUI Testing: Edit File Logic Flow
2
-
3
- **Date**: 2025-07-29 20:00:00
4
- **Context**: Continuing development of Scriptorium TUI testing infrastructure
5
-
6
- ## Objective
7
- Test the complete interactive editing workflow that a real user experiences, including actual file content changes using the `edit_file` method. Focus on testing the logic flow where users select `ed` as the editor and make actual file changes.
8
-
9
- ## Key Technical Concepts
10
- - **Scriptorium TUI**: Command-line interface with wizard-based setups and interactive workflows
11
- - **`edit_file` method**: API method that opens files in user's chosen editor (determined by `ENV['EDITOR']` or falls back to `vim`)
12
- - **`ed` editor**: Line-oriented text editor chosen for automated testing due to non-interactive nature
13
- - **`Open3.popen3`**: Ruby module for running external processes and interacting with stdin/stdout/stderr
14
- - **`IO.select`**: Ruby method for monitoring I/O readiness, initially misused causing timing issues
15
-
16
- ## Files Modified
17
-
18
- ### `bin/scriptorium`
19
- - **Fixed `@@test_repo_path` NameError**: Removed undefined class variable reference in `discover_repo` method
20
- - **Fixed `edit_file` calls**: Changed all instances from `edit_file(...)` to `@api.edit_file(...)` to fix `NoMethodError`
21
- - **Added "Create new repository?" prompt**: Modified main execution block to ask before creating repo
22
- - **Mocked `which` method**: Added test-mode mocking to prevent hanging during editor detection
23
- - **Removed post-setup message**: Removed "You can now use 'create post <title>'..." to ensure "Goodbye!" is final message
24
- - **Added debug statements**: Temporary debug output to troubleshoot hanging issues
25
-
26
- ### `test/tui_editor_integration_test.rb`
27
- - **Created comprehensive integration test**: `test_links_widget_editing_workflow_part_1`
28
- - **Fixed I/O timing issues**: Added timeout to `read_available_output` method (0.1s → 2.0s)
29
- - **Added conversation-style logging**: `USER:` and `CODE:` prefixes with `@@verbose_output` toggle
30
- - **Created "expecting" approach**: Alternative test method using `expect_output` and `send_command` helpers
31
- - **Fixed command sequence**: Updated to complete editor setup before sending "quit"
32
-
33
- ## Major Issues Encountered and Resolved
34
-
35
- ### 1. Hanging During Process Startup
36
- **Problem**: TUI hanging before producing any output
37
- **Root Cause**: `read_available_output` using blocking I/O with no timeout
38
- **Solution**: Added timeout to `IO.select` calls
39
-
40
- ### 2. `NoMethodError: undefined method 'edit_file'`
41
- **Problem**: TUI calling `edit_file` directly instead of `@api.edit_file`
42
- **Root Cause**: Method calls not updated after API refactoring
43
- **Solution**: Updated all `edit_file` calls to use `@api.edit_file`
44
-
45
- ### 3. `RepoDirAlreadyExists` Error
46
- **Problem**: Path mismatch between TUI creating `"test/scriptorium-TEST"` and test cleanup looking for `"scriptorium-TEST"`
47
- **Solution**: Standardized on `"scriptorium-TEST"` path
48
-
49
- ### 4. Out-of-Order I/O
50
- **Problem**: Commands sent before TUI ready, causing non-blocking I/O issues
51
- **Root Cause**: Insufficient waiting between commands
52
- **Solution**: Increased timeout in `read_available_output`
53
-
54
- ### 5. Editor Setup Hanging
55
- **Problem**: `which` command calls hanging in test environment
56
- **Root Cause**: System calls not working properly in `Open3.popen3` context
57
- **Solution**: Mocked `which` method for test mode
58
-
59
- ## Current Status
60
- - **Original test approach**: Working but with timing issues (completes in ~1.2s)
61
- - **"Expecting" approach**: Has fundamental issues with process startup
62
- - **Main issue**: Test sending "quit" before TUI completes editor setup
63
- - **System performance**: High memory usage affecting test timing and reliability
64
-
65
- ## Test Command Sequence
66
- ```ruby
67
- commands = [
68
- "y", # Create new repository
69
- "y", # Want assistance with first view
70
- "testview", # View name
71
- "Test View", # View title
72
- "Test Subtitle", # Subtitle
73
- "y", # Edit layout
74
- "a", "header", "main", "right", ".", "w", "q", # ed commands
75
- "n", "n", "n", # Skip container configuration
76
- "1", # Choose nano editor
77
- "quit" # Exit TUI
78
- ]
79
- ```
80
-
81
- ## Key Insights
82
- 1. **I/O timing is critical**: Non-blocking I/O causes out-of-order command/response
83
- 2. **System performance matters**: High memory usage affects test reliability
84
- 3. **Mocking system calls essential**: `which` commands hang in test environment
85
- 4. **Command sequence must match TUI flow**: Need to complete setup before entering mainloop
86
-
87
- ## Next Steps
88
- 1. Fix command sequence to properly complete editor setup
89
- 2. Address system performance issues
90
- 3. Refine timing in test infrastructure
91
- 4. Complete the edit_file workflow testing with actual file changes
92
-
93
- ## Technical Debt
94
- - Debug statements need cleanup
95
- - "Expecting" approach needs fundamental rework
96
- - Test infrastructure could benefit from more robust I/O handling
97
- - System performance monitoring needed for reliable testing