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.
- checksums.yaml +4 -4
- data/assets/icons/social/reddit.png +0 -0
- data/assets/icons/social/x-logo.png +0 -0
- data/assets/imagenotfound.jpg +0 -0
- data/bin/sblog +84 -5
- data/bin/scriptorium +1 -0
- data/doc/anti-amnesia/20250727-054000-scriptorium-overview.md +0 -1
- data/doc/anti-amnesia/20250727-123000-anti-amnesia-conventions.md +0 -29
- data/doc/anti-amnesia/20250727-172600-cursor-rbenv-ruby-version-mystery.md +0 -19
- data/doc/anti-amnesia/20250727-172900-ai-cognitive-assessment-capabilities.md +1 -1
- data/doc/anti-amnesia/20250728-124243-aaa-syntax-clarification.md +1 -1
- data/doc/anti-amnesia/20250729-210000-reddit-autopost-integration-complete.md +1 -1
- data/doc/anti-amnesia/20250804-190500-cognitive-loop-bug.md +0 -10
- data/doc/anti-amnesia/20250804-190700-anti-amnesia-timestamping-fix.md +1 -4
- data/doc/anti-amnesia/20250901-211714-codemirror-integration-and-web-tests.md +172 -0
- data/doc/anti-amnesia/20250902-002402-backup-restore-system.md +126 -0
- data/doc/anti-amnesia/20250907-203339-backup-metadata-implementation.md +66 -0
- data/doc/imported/0001-elixir-conf-2014/metadata.txt +7 -0
- data/doc/imported/0001-elixir-conf-2014/post.html +37 -0
- data/doc/imported/0001-elixir-conf-2014/source.lt3 +22 -0
- data/doc/imported/0002-programmers-and-word-processing/metadata.txt +7 -0
- data/doc/imported/0002-programmers-and-word-processing/post.html +192 -0
- data/doc/imported/0002-programmers-and-word-processing/source.lt3 +146 -0
- data/doc/imported/0003-how-to-turn-your-brain-sideways/metadata.txt +7 -0
- data/doc/imported/0003-how-to-turn-your-brain-sideways/post.html +60 -0
- data/doc/imported/0003-how-to-turn-your-brain-sideways/source.lt3 +40 -0
- data/doc/imported/0004-upcoming-lone-star-ruby-conference/metadata.txt +7 -0
- data/doc/imported/0004-upcoming-lone-star-ruby-conference/post.html +42 -0
- data/doc/imported/0004-upcoming-lone-star-ruby-conference/source.lt3 +24 -0
- data/doc/imported/0005-elixir-conf-2015-announced/metadata.txt +7 -0
- data/doc/imported/0005-elixir-conf-2015-announced/post.html +30 -0
- data/doc/imported/0005-elixir-conf-2015-announced/source.lt3 +16 -0
- data/doc/imported/0006-ruby-for-dinosaurs/metadata.txt +7 -0
- data/doc/imported/0006-ruby-for-dinosaurs/post.html +43 -0
- data/doc/imported/0006-ruby-for-dinosaurs/source.lt3 +27 -0
- data/doc/imported/0007-phoenix-isnt-rails/metadata.txt +7 -0
- data/doc/imported/0007-phoenix-isnt-rails/post.html +116 -0
- data/doc/imported/0007-phoenix-isnt-rails/source.lt3 +87 -0
- data/doc/imported/0008-concerning-the-term-monkeypatching/metadata.txt +7 -0
- data/doc/imported/0008-concerning-the-term-monkeypatching/post.html +129 -0
- data/doc/imported/0008-concerning-the-term-monkeypatching/source.lt3 +92 -0
- data/doc/imported/0009-announcement-coming-soon/metadata.txt +7 -0
- data/doc/imported/0009-announcement-coming-soon/post.html +33 -0
- data/doc/imported/0009-announcement-coming-soon/source.lt3 +19 -0
- data/doc/imported/0010-immutable-data-ditching-the-wax-tablet/metadata.txt +7 -0
- data/doc/imported/0010-immutable-data-ditching-the-wax-tablet/post.html +175 -0
- data/doc/imported/0010-immutable-data-ditching-the-wax-tablet/source.lt3 +139 -0
- data/doc/imported/0011-computer-science-as-a-lost-art/metadata.txt +7 -0
- data/doc/imported/0011-computer-science-as-a-lost-art/post.html +139 -0
- data/doc/imported/0011-computer-science-as-a-lost-art/source.lt3 +104 -0
- data/doc/imported/0012-ruby-day-in-turin-italy/metadata.txt +7 -0
- data/doc/imported/0012-ruby-day-in-turin-italy/post.html +42 -0
- data/doc/imported/0012-ruby-day-in-turin-italy/source.lt3 +24 -0
- data/doc/imported/0013-rubyday-was-a-success/metadata.txt +7 -0
- data/doc/imported/0013-rubyday-was-a-success/post.html +44 -0
- data/doc/imported/0013-rubyday-was-a-success/source.lt3 +27 -0
- data/doc/imported/0014-working-on-the-blogging-software/metadata.txt +7 -0
- data/doc/imported/0014-working-on-the-blogging-software/post.html +63 -0
- data/doc/imported/0014-working-on-the-blogging-software/source.lt3 +41 -0
- data/doc/imported/0015-ok-its-not-really-a-lost-art/metadata.txt +7 -0
- data/doc/imported/0015-ok-its-not-really-a-lost-art/post.html +172 -0
- data/doc/imported/0015-ok-its-not-really-a-lost-art/source.lt3 +134 -0
- data/doc/imported/0016-an-in-operator-for-ruby/metadata.txt +7 -0
- data/doc/imported/0016-an-in-operator-for-ruby/post.html +155 -0
- data/doc/imported/0016-an-in-operator-for-ruby/source.lt3 +106 -0
- data/doc/imported/0017-the-forgotten-mathematician/metadata.txt +7 -0
- data/doc/imported/0017-the-forgotten-mathematician/post.html +161 -0
- data/doc/imported/0017-the-forgotten-mathematician/source.lt3 +119 -0
- data/doc/imported/0018-ruby-puns/metadata.txt +7 -0
- data/doc/imported/0018-ruby-puns/post.html +46 -0
- data/doc/imported/0018-ruby-puns/source.lt3 +28 -0
- data/doc/imported/0019-custom-exceptions-via-metaprogramming/metadata.txt +7 -0
- data/doc/imported/0019-custom-exceptions-via-metaprogramming/post.html +138 -0
- data/doc/imported/0019-custom-exceptions-via-metaprogramming/source.lt3 +101 -0
- data/doc/imported/0020-fffff/metadata.txt +7 -0
- data/doc/imported/0020-fffff/post.html +24 -0
- data/doc/imported/0020-fffff/source.lt3 +12 -0
- data/doc/imported/0021-trying-ror-yet-again/metadata.txt +7 -0
- data/doc/imported/0021-trying-ror-yet-again/post.html +26 -0
- data/doc/imported/0021-trying-ror-yet-again/source.lt3 +12 -0
- data/doc/imported/0023-doctor-sleep/metadata.txt +7 -0
- data/doc/imported/0023-doctor-sleep/post.html +63 -0
- data/doc/imported/0023-doctor-sleep/source.lt3 +44 -0
- data/doc/imported/0024-just-a-test/metadata.txt +7 -0
- data/doc/imported/0024-just-a-test/post.html +24 -0
- data/doc/imported/0024-just-a-test/source.lt3 +12 -0
- data/doc/imported/import_summary.txt +98 -0
- data/doc/livetext-informal-spec.txt +65 -0
- data/doc/myuserdoc/ch-0.lt3 +31 -0
- data/doc/myuserdoc/ch-1.lt3 +37 -0
- data/doc/myuserdoc/ch-10.lt3 +22 -0
- data/doc/myuserdoc/ch-2.lt3 +37 -0
- data/doc/myuserdoc/ch-3.lt3 +19 -0
- data/doc/myuserdoc/ch-4.lt3 +43 -0
- data/doc/myuserdoc/ch-5.lt3 +22 -0
- data/doc/myuserdoc/ch-6.lt3 +19 -0
- data/doc/myuserdoc/ch-7.lt3 +16 -0
- data/doc/myuserdoc/ch-8.lt3 +13 -0
- data/doc/myuserdoc/ch-9.lt3 +19 -0
- data/doc/myuserdoc/tweak.rb +18 -0
- data/doc/{userdoc-toc.txt → myuserdoc/userdoc-toc.txt} +27 -27
- data/doc/old-posts/0001-elixir-conf-2014.lt3 +24 -0
- data/doc/old-posts/0002-programmers-and-word-processing.lt3 +150 -0
- data/doc/old-posts/0003-how-to-turn-your-brain-sideways.lt3 +43 -0
- data/doc/old-posts/0004-upcoming-lone-star-ruby-conference.lt3 +26 -0
- data/doc/old-posts/0005-elixir-conf-2015-announced.lt3 +17 -0
- data/doc/old-posts/0006-ruby-for-dinosaurs.lt3 +30 -0
- data/doc/old-posts/0007-phoenix-isnt-rails.lt3 +90 -0
- data/doc/old-posts/0008-concerning-the-term-monkeypatching.lt3 +105 -0
- data/doc/old-posts/0009-announcement-coming-soon.lt3 +20 -0
- data/doc/old-posts/0010-immutable-data-ditching-the-wax-tablet.lt3 +142 -0
- data/doc/old-posts/0011-computer-science-as-a-lost-art.lt3 +117 -0
- data/doc/old-posts/0012-ruby-day-in-turin-italy.lt3 +26 -0
- data/doc/old-posts/0013-rubyday-was-a-success.lt3 +28 -0
- data/doc/old-posts/0014-working-on-the-blogging-software.lt3 +42 -0
- data/doc/old-posts/0015-ok-its-not-really-a-lost-art.lt3 +137 -0
- data/doc/old-posts/0016-an-in-operator-for-ruby.lt3 +142 -0
- data/doc/old-posts/0017-the-forgotten-mathematician.lt3 +129 -0
- data/doc/old-posts/0018-ruby-puns.lt3 +31 -0
- data/doc/old-posts/0019-custom-exceptions-via-metaprogramming.lt3 +116 -0
- data/doc/old-posts/0021-trying-ror-yet-again.lt3 +35 -0
- data/doc/old-posts/0023-doctor-sleep.lt3 +43 -0
- data/doc/old-posts/0024-just-a-test.lt3 +12 -0
- data/doc/old-posts/0025-trying-another-post.lt3 +12 -0
- data/doc/old-repo +1 -0
- data/doc/reddit_integration.md +2 -2
- data/doc/user.lt3 +0 -3
- data/lib/scriptorium/api.rb +1811 -78
- data/lib/scriptorium/banner_svg.rb +55 -68
- data/lib/scriptorium/contract.rb +3 -2
- data/lib/scriptorium/exceptions.rb +133 -102
- data/lib/scriptorium/helpers.rb +282 -82
- data/lib/scriptorium/post.rb +81 -17
- data/lib/scriptorium/reddit.rb +1 -1
- data/lib/scriptorium/repo.rb +478 -164
- data/lib/scriptorium/standard_files.rb +30 -396
- data/lib/scriptorium/support/common_js/clipboard.js +35 -0
- data/lib/scriptorium/support/common_js/content-loader.js +187 -0
- data/lib/scriptorium/support/common_js/navigation.js +52 -0
- data/lib/scriptorium/support/common_js/syntax-highlighting.js +27 -0
- data/lib/scriptorium/support/config/reddit_template.txt +17 -0
- data/{test/scriptorium-TEST-1754622690-146/views/sample → lib/scriptorium/support}/config/social.txt +1 -0
- data/lib/scriptorium/support/highlight/css.txt +2 -0
- data/lib/scriptorium/support/highlight/custom.css +119 -0
- data/lib/scriptorium/support/highlight/js.txt +1 -0
- data/lib/scriptorium/support/post_index/config.txt +15 -0
- data/lib/scriptorium/support/post_index/style.css +55 -0
- data/lib/scriptorium/support/templates/index_entry.lt3 +16 -0
- data/{test/scriptorium-TEST-1754622690-146/themes/standard/initial/post.lt3 → lib/scriptorium/support/templates/initial_post.lt3} +5 -5
- data/lib/scriptorium/support/templates/post.lt3 +104 -0
- data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/header.txt → lib/scriptorium/support/theme/header.lt3} +1 -1
- data/lib/scriptorium/theme.rb +83 -70
- data/lib/scriptorium/version.rb +2 -2
- data/lib/scriptorium/view.rb +194 -149
- data/lib/scriptorium.rb +24 -1
- data/lib/skeleton.rb +4 -1
- data/scriptorium.gemspec +2 -1
- data/test/WEB_INTEGRATION_README.md +196 -0
- data/test/all +40 -0
- data/test/banner_svg/unit.rb +267 -35
- data/test/config/deployment.txt +5 -0
- data/test/integration/integration_test.rb +7 -7
- data/test/integration/preview_flow_test.rb +94 -0
- data/test/livetext_plugin_test.rb +453 -182
- data/test/manual/banner-tests/test01.html +82 -18
- data/test/manual/banner-tests/test02.html +82 -18
- data/test/manual/banner-tests/test03.html +82 -18
- data/test/manual/banner-tests/test04.html +89 -25
- data/test/manual/banner-tests/test05.html +89 -25
- data/test/manual/banner-tests/test06.html +89 -25
- data/test/manual/banner-tests/test07.html +89 -25
- data/test/manual/banner-tests/test08.html +82 -18
- data/test/manual/banner-tests/test09.html +82 -18
- data/test/manual/banner-tests/test10.html +82 -18
- data/test/manual/banner-tests/test11.html +82 -18
- data/test/manual/banner-tests/test12.html +82 -18
- data/test/manual/banner-tests/test13.html +82 -18
- data/test/manual/banner-tests/test14.html +82 -18
- data/test/manual/banner-tests/test15.html +82 -18
- data/test/manual/banner-tests/test16.html +82 -18
- data/test/manual/banner-tests/test17.html +82 -18
- data/test/manual/banner-tests/test18.html +90 -26
- data/test/manual/banner-tests/test19.html +90 -26
- data/test/manual/banner-tests/test20.html +90 -26
- data/test/manual/banner-tests/test21.html +90 -26
- data/test/manual/banner-tests/test22.html +90 -26
- data/test/manual/banner-tests/test23.html +90 -26
- data/test/manual/banner-tests/test24.html +90 -26
- data/test/manual/banner-tests/test25.html +89 -25
- data/test/manual/banner_environment.rb +15 -2
- data/test/manual/codemirror_demo.html +773 -0
- data/test/manual/create_posts_for_web.rb +114 -0
- data/test/manual/preview_manual_test.rb +129 -0
- data/test/manual/test_banner_features.rb +14 -14
- data/test/manual/test_banner_integration.rb +115 -0
- data/test/manual/test_banner_radial.rb +87 -0
- data/test/manual/test_syntax_highlighting.rb +60 -40
- data/test/support/preview_utils.rb +88 -0
- data/test/test_gem_assets.rb +48 -0
- data/test/test_helpers.rb +10 -0
- data/test/tui_editor_integration_test.rb +15 -15
- data/test/tui_integration_test.rb +687 -441
- data/test/unit/api.rb +757 -37
- data/test/unit/asset_management.rb +195 -221
- data/test/unit/backup_test.rb +451 -0
- data/test/unit/contract_test.rb +1 -23
- data/test/unit/core.rb +415 -61
- data/test/unit/deploy_config_test.rb +248 -0
- data/test/unit/deploy_test.rb +312 -21
- data/test/unit/edit_post_test.rb +168 -0
- data/test/unit/gem_asset_management.rb +36 -42
- data/test/unit/livetext_basic.rb +23 -35
- data/test/unit/livetext_compatibility.rb +7 -14
- data/test/unit/parse_cmd_test.rb +260 -0
- data/test/unit/{symlink_test.rb → permalink_copy_test.rb} +47 -49
- data/test/unit/post.rb +91 -26
- data/test/unit/post_index_config_test.rb +258 -0
- data/test/unit/post_state_helpers_test.rb +137 -0
- data/test/unit/read_commented_file_test.rb +8 -6
- data/test/unit/repo.rb +75 -54
- data/test/unit/social_test.rb +41 -44
- data/test/unit/syntax_highlighting.rb +70 -0
- data/test/unit/theme_management_test.rb +91 -0
- data/test/unit/view.rb +79 -12
- data/test/unit/widgets.rb +8 -8
- data/test/web_integration_test.rb +231 -0
- data/test/web_test_helper.rb +218 -0
- data/test/web_workflow_test.rb +527 -0
- data/ui/tui/bin/scriptorium +885 -415
- data/ui/web/app/app.rb +1398 -176
- data/ui/web/app/assets/livetext_mode.js +244 -0
- data/ui/web/app/error_helpers.rb +16 -16
- data/ui/web/app/views/advanced_config.erb +8 -2
- data/ui/web/app/views/asset_management.erb +56 -0
- data/ui/web/app/views/backup_management.erb +238 -0
- data/ui/web/app/views/config_widget.erb +232 -0
- data/ui/web/app/views/dashboard.erb +64 -72
- data/ui/web/app/views/deploy_config.erb +3 -0
- data/ui/web/app/views/edit_pages.erb +170 -2
- data/ui/web/app/views/edit_post.erb +130 -9
- data/ui/web/app/views/edit_theme.erb +73 -0
- data/ui/web/app/views/edit_theme_file.erb +74 -0
- data/ui/web/app/views/theme_management.erb +130 -0
- data/ui/web/app/views/view_dashboard.erb +666 -25
- data/ui/web/app/views/widgets.erb +249 -0
- data/ui/web/bin/scriptorium-web +35 -24
- data/ui/web/tmp/timing.log +17 -0
- data/ui/web/tmp/web_server.log +0 -5
- metadata +190 -116
- data/assets/back-icon.png +0 -0
- data/assets/icons/facebook.svg +0 -1
- data/assets/icons/github.svg +0 -1
- data/assets/icons/instagram.svg +0 -1
- data/assets/icons/reddit.svg +0 -1
- data/assets/icons/x.svg +0 -1
- data/assets/icons/youtube.svg +0 -1
- data/bin/scriptorium +0 -1511
- data/doc/anti-amnesia/20250727-060000-api-design-tui-planning.md +0 -34
- data/doc/anti-amnesia/20250727-061000-runeblog-tui-analysis.md +0 -50
- data/doc/anti-amnesia/20250727-154000-livetext-plugin-file-stats.md +0 -73
- data/doc/anti-amnesia/20250727-172600-unified-minitest-framework.md +0 -70
- data/doc/anti-amnesia/20250727-173000-widget-testing-achievement.md +0 -110
- data/doc/anti-amnesia/20250727-180000-post-id-num-refactoring.md +0 -73
- data/doc/anti-amnesia/20250728-124421-conversation-summary-concise.md +0 -124
- data/doc/anti-amnesia/20250729-190000-scriptorium-tui-testing-complete.md +0 -46
- data/doc/anti-amnesia/20250729-200000-scriptorium-tui-testing-edit-file-workflow.md +0 -97
- data/doc/anti-amnesia/20250729-211500-dependency-management-system.md +0 -211
- data/doc/anti-amnesia/20250729-213000-python-virtual-environment-setup.md +0 -141
- data/doc/anti-amnesia/20250729-214500-theme-management-commands.md +0 -211
- data/doc/anti-amnesia/20250729-215000-version-update-to-0.6.0.md +0 -134
- data/doc/anti-amnesia/20250729-220000-user-guide-complete.md +0 -41
- data/doc/anti-amnesia/20250804-213700-publishing-test-fix.md +0 -49
- data/doc/anti-amnesia/20250804-214400-additional-test-fixes.md +0 -46
- data/doc/anti-amnesia/20250804-220000-asset-function-logic-clarification.md +0 -41
- data/doc/anti-amnesia/20250806-202032-asset-function-logic-clarification.md +0 -41
- data/doc/anti-amnesia/20250813-082428-syntax-highlighting-and-navigation-improvements.md +0 -256
- data/lib/scriptorium/syntax_highlighter.rb +0 -234
- data/test/manual/deploy_symlink_demo.rb +0 -142
- data/test/manual/symlink_demo.rb +0 -117
- data/test/manual/test2.rb +0 -12
- data/test/manual/test_banner_from_file.rb +0 -150
- data/test/manual/test_banner_in_header.rb +0 -35
- data/test/manual/test_code_highlighting.rb +0 -68
- data/test/manual/test_complex_header.rb +0 -74
- data/test/manual/test_empty_header.rb +0 -32
- data/test/manual/test_radial_custom.rb +0 -58
- data/test/manual/test_radial_large_radius.rb +0 -52
- data/test/manual/test_svg_debug.rb +0 -47
- data/test/pages-demo/config/currentview.txt +0 -1
- data/test/pages-demo/views/demo/config/common.js +0 -57
- data/test/pages-demo/views/demo/config/footer.txt +0 -1
- data/test/pages-demo/views/demo/config/global-head.txt +0 -8
- data/test/pages-demo/views/demo/config/header.txt +0 -1
- data/test/pages-demo/views/demo/config/layout.txt +0 -1
- data/test/pages-demo/views/demo/config/left.txt +0 -1
- data/test/pages-demo/views/demo/config/main.txt +0 -1
- data/test/pages-demo/views/demo/config/right.txt +0 -1
- data/test/pages-demo/views/demo/config.txt +0 -3
- data/test/pages-demo/views/demo/output/panes/footer.html +0 -1
- data/test/pages-demo/views/demo/output/panes/header.html +0 -1
- data/test/pages-demo/views/demo/output/panes/left.html +0 -1
- data/test/pages-demo/views/demo/output/panes/main.html +0 -1
- data/test/pages-demo/views/demo/output/panes/right.html +0 -1
- data/test/scriptorium-TEST-1754622690-146/config/bootstrap_css.txt +0 -5
- data/test/scriptorium-TEST-1754622690-146/config/bootstrap_js.txt +0 -4
- data/test/scriptorium-TEST-1754622690-146/config/common.js +0 -57
- data/test/scriptorium-TEST-1754622690-146/config/currentview.txt +0 -1
- data/test/scriptorium-TEST-1754622690-146/config/global-head.txt +0 -9
- data/test/scriptorium-TEST-1754622690-146/config/last_post_num.txt +0 -1
- data/test/scriptorium-TEST-1754622690-146/config/os_helpers.rb +0 -4
- data/test/scriptorium-TEST-1754622690-146/config/widgets.txt +0 -3
- data/test/scriptorium-TEST-1754622690-146/posts/0001/meta.txt +0 -8
- data/test/scriptorium-TEST-1754622690-146/posts/0001/source.lt3 +0 -6
- data/test/scriptorium-TEST-1754622690-146/themes/standard/README.txt +0 -1
- data/test/scriptorium-TEST-1754622690-146/themes/standard/config.txt +0 -1
- data/test/scriptorium-TEST-1754622690-146/themes/standard/layout/gen/text.css +0 -1
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index.lt3 +0 -1
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/index_entry.lt3 +0 -14
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/post.lt3 +0 -13
- data/test/scriptorium-TEST-1754622690-146/themes/standard/templates/widget.lt3 +0 -1
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_css.txt +0 -5
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/bootstrap_js.txt +0 -4
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/common.js +0 -57
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/deploy.txt +0 -5
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/footer.txt +0 -2
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/global-head.txt +0 -9
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/header.txt +0 -4
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/layout.txt +0 -5
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/left.txt +0 -3
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/main.txt +0 -5
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/right.txt +0 -3
- data/test/scriptorium-TEST-1754622690-146/views/sample/config/status.txt +0 -7
- data/test/scriptorium-TEST-1754622690-146/views/sample/config.txt +0 -3
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/footer.html +0 -3
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/header.html +0 -3
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/left.html +0 -3
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/main.html +0 -3
- data/test/scriptorium-TEST-1754622690-146/views/sample/layout/right.html +0 -3
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/footer.html +0 -1
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/header.html +0 -1
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/left.html +0 -1
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/main.html +0 -1
- data/test/scriptorium-TEST-1754622690-146/views/sample/output/panes/right.html +0 -1
- data/ui/web/tmp/web_server.pid +0 -1
- /data/{test/pages-demo/views/demo/config/bootstrap_css.txt → lib/scriptorium/support/bootstrap/css.txt} +0 -0
- /data/{test/pages-demo/views/demo/config/bootstrap_js.txt → lib/scriptorium/support/bootstrap/js.txt} +0 -0
- /data/{test/scriptorium-TEST-1754622690-146/views/sample → lib/scriptorium/support}/config/reddit.txt +0 -0
- /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout → lib/scriptorium/support/templates}/layout.txt +0 -0
- /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/footer.txt → lib/scriptorium/support/theme/footer.lt3} +0 -0
- /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/left.txt → lib/scriptorium/support/theme/left.lt3} +0 -0
- /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/main.txt → lib/scriptorium/support/theme/main.lt3} +0 -0
- /data/{test/scriptorium-TEST-1754622690-146/themes/standard/layout/config/right.txt → lib/scriptorium/support/theme/right.lt3} +0 -0
- /data/test/manual/banner-tests/{config.txt → svg.txt} +0 -0
- /data/test/manual/{test6.rb → test_advanced_widgets.rb} +0 -0
- /data/test/manual/{test1.rb → test_basic_posts.rb} +0 -0
- /data/test/manual/{test4.rb → test_layout_widgets.rb} +0 -0
- /data/test/manual/{test5.rb → test_pagination.rb} +0 -0
- /data/test/manual/{test3.rb → test_random_posts.rb} +0 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
.h1 Ruby for Dinosaurs...
|
2
|
+
|
3
|
+
.set post.num = 0006
|
4
|
+
.set post.slug = ruby-for-dinosaurs
|
5
|
+
.set post.date = 2015-07-23
|
6
|
+
.set post.title = Ruby for Dinosaurs...
|
7
|
+
.set post.tags =
|
8
|
+
.set post.views = computing
|
9
|
+
.set post.published = yes
|
10
|
+
.set post.deployed = no
|
11
|
+
|
12
|
+
I have a good friend I've known since college. He was much older than I was (though
|
13
|
+
now somehow we are much closer together in age). He was a mentor to me with regard
|
14
|
+
to computers and other things.
|
15
|
+
He was a brilliant programmer and actually wrote a C compiler in the days before the
|
16
|
+
IBM PC. He's now past 70 if I am not mistaken. Lately, he says technical things make
|
17
|
+
him tired.
|
18
|
+
|
19
|
+
But as a Ruby enthusiast, I felt obligated to pass on some of the insights I had in
|
20
|
+
the last 16 years. Will it bring him out of retirement and get him to write code
|
21
|
+
again? Maybe not. But I had been meaning for years to write this little intro, and so
|
22
|
+
I finally did.
|
23
|
+
|
24
|
+
Here's the PDF of "Ruby for the Old-Time C Programmer"
|
25
|
+
|
26
|
+
If you know someone who thinks in C and never learned OOP, you might share it with
|
27
|
+
that person as well. If you have comments, feel free to email me.
|
@@ -0,0 +1,116 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Phoenix isn't Rails</title>
|
6
|
+
<meta name="generator" content="Scriptorium Import">
|
7
|
+
<meta property="og:title" content="Phoenix isn't Rails">
|
8
|
+
<meta property="og:locale" content="en_US">
|
9
|
+
<meta property="og:type" content="article">
|
10
|
+
<meta property="article:published_time" content="2015-07-27">
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<article>
|
14
|
+
<header>
|
15
|
+
<h1>Phoenix isn't Rails</h1>
|
16
|
+
<time datetime="2015-07-27">July 27, 2015</time>
|
17
|
+
</header>
|
18
|
+
|
19
|
+
<div class="content">
|
20
|
+
<p>
|
21
|
+
I don't know Elixir very well at all. But I've started to learn Phoenix now. The
|
22
|
+
first thing to know: Phoenix is <i>not</i> Ruby on Rails (nor is it "Elixir on Rails").
|
23
|
+
I began my learning experience by dutifully crunching through the tutorial and
|
24
|
+
making my share (at least) of newbie mistakes. (Disclaimer: I'm not a web guy. I
|
25
|
+
don't natively "think" in those terms and perhaps never will.)
|
26
|
+
|
27
|
+
<p>
|
28
|
+
At some point in the hello-world example, I stopped and did a count of the files
|
29
|
+
under my tree. It will become clear in a moment why this was a little naive and
|
30
|
+
careless.
|
31
|
+
|
32
|
+
<p>
|
33
|
+
At any rate, I think <tt>find . | wc -l</tt>reported 11,648 files to me. I found this
|
34
|
+
a bit confusing and puzzling, and I didn't think it through.
|
35
|
+
|
36
|
+
<p>
|
37
|
+
I chatted with Chris McCord and another guy I don't think I've met. This is a summary:
|
38
|
+
|
39
|
+
<p>
|
40
|
+
<pre>
|
41
|
+
hal_9000: chrismccord: I have a question about the philosophy/design
|
42
|
+
of phoenix - if you have time/inclination and the answer is not too involved
|
43
|
+
|
44
|
+
chrismccord: hal_9000: shoot
|
45
|
+
|
46
|
+
hal_9000: first of all, i’m not a web guy - i’ve played with rails and several
|
47
|
+
other things - wrote a few small apps. One thing that appealed to me
|
48
|
+
about Sinatra was how “lightweight” it was compared to Rails — you can
|
49
|
+
write a primitive Sinatra app in a single file.
|
50
|
+
hal_9000: i “sort of” expected that Phoenix might be that way — but a find piped
|
51
|
+
to wc showed me that a hello-world app has more than 11,000 files in it.
|
52
|
+
why in general is that?
|
53
|
+
|
54
|
+
chrismccord: hal_9000: remove the node_modules folder and re-run ws
|
55
|
+
chrismccord: it's all nodejs for the asset building
|
56
|
+
chrismccord: hal_9000: we are lightweight. It's a misconception I have to keep correcting.
|
57
|
+
We are much closer to sinatra than rails
|
58
|
+
|
59
|
+
<p>
|
60
|
+
hal_9000: hmm, i don’t even know nodejs of course
|
61
|
+
hal_9000: chrismccord: thanks, i had a feeling i was missing something for sure
|
62
|
+
|
63
|
+
<p>
|
64
|
+
chrismccord: hal_9000: you could write an app in a single file, but no-one does that,
|
65
|
+
because we don't write production software in a single file
|
66
|
+
chrismccord: hal_9000: It is also worth mentioning there is also nothing global in
|
67
|
+
phoenix. We are not a monolith like rails
|
68
|
+
|
69
|
+
jeregrine: hal_9000: something to keep in mind here is that phoenix assumes you are
|
70
|
+
writing production software. Eventually you will need to touch every file, otherwise
|
71
|
+
it wouldn't generate the file
|
72
|
+
|
73
|
+
hal_9000: chrismccord: ok, thanks, i will look more closely. i’m impressed with what i see
|
74
|
+
|
75
|
+
jeregrine: hal_9000: if you are like me and have used sinatra for production software you
|
76
|
+
probably discovered you ended up writing a slightly smaller version of rails
|
77
|
+
|
78
|
+
<p>
|
79
|
+
hal_9000: jeregrine: that makes perfect sense
|
80
|
+
|
81
|
+
jeregrine: hal_9000: if you only need a single route/api call, and are certain it will never grow,
|
82
|
+
you could VERY easily get away with just plug and it's router
|
83
|
+
jeregrine: hal_9000: http://hexdocs.pm/plug/Plug.Router.html for reference.
|
84
|
+
|
85
|
+
hal_9000: chrismccord: i grasp it now, sorry for the noise
|
86
|
+
|
87
|
+
<p>
|
88
|
+
jeregrine: hal_9000: lemme know if you have any questions, this is something we need to be better at
|
89
|
+
communicating. We are not rails
|
90
|
+
|
91
|
+
<p>
|
92
|
+
chrismccord: hal_9000: no worries. Sorry if my response was rash too. I just have to fight a lot of
|
93
|
+
"phoenix is bloated" comments because people assume it is given my Rails background and
|
94
|
+
the comparisons with rails
|
95
|
+
|
96
|
+
<p>
|
97
|
+
hal_9000: chrismccord: no, your response was not rash at all
|
98
|
+
</pre>
|
99
|
+
|
100
|
+
<p>
|
101
|
+
So first of all: I didn't pay attention to what I was doing when I did my file count.
|
102
|
+
|
103
|
+
<p>
|
104
|
+
But the real takeaway here is: Phoenix isn't bloated, and more importantly, <i>Phoenix isn't Rails</i>.
|
105
|
+
The philosophy seems to be more "minimalistic" as I had hoped.
|
106
|
+
|
107
|
+
<p>
|
108
|
+
And of course, we all know that Elixir isn't Ruby. I won't belabor that point.
|
109
|
+
|
110
|
+
<p>
|
111
|
+
On the other hand, I do find (so far) that Plug is a lot like Rack. That's a good thing, because I
|
112
|
+
always thought Rack was sheer genius. More on that as I learn.
|
113
|
+
</div>
|
114
|
+
</article>
|
115
|
+
</body>
|
116
|
+
</html>
|
@@ -0,0 +1,87 @@
|
|
1
|
+
.h1 Phoenix isn't Rails
|
2
|
+
|
3
|
+
.set post.num = 0007
|
4
|
+
.set post.slug = phoenix-isnt-rails
|
5
|
+
.set post.date = 2015-07-27
|
6
|
+
.set post.title = Phoenix isn't Rails
|
7
|
+
.set post.tags =
|
8
|
+
.set post.views = computing
|
9
|
+
.set post.published = yes
|
10
|
+
.set post.deployed = no
|
11
|
+
|
12
|
+
I don't know Elixir very well at all. But I've started to learn Phoenix now. The
|
13
|
+
first thing to know: Phoenix is not Ruby on Rails (nor is it "Elixir on Rails").
|
14
|
+
I began my learning experience by dutifully crunching through the tutorial and
|
15
|
+
making my share (at least) of newbie mistakes. (Disclaimer: I'm not a web guy. I
|
16
|
+
don't natively "think" in those terms and perhaps never will.)
|
17
|
+
|
18
|
+
At some point in the hello-world example, I stopped and did a count of the files
|
19
|
+
under my tree. It will become clear in a moment why this was a little naive and
|
20
|
+
careless.
|
21
|
+
|
22
|
+
At any rate, I think find . | wc -lreported 11,648 files to me. I found this
|
23
|
+
a bit confusing and puzzling, and I didn't think it through.
|
24
|
+
|
25
|
+
I chatted with Chris McCord and another guy I don't think I've met. This is a summary:
|
26
|
+
|
27
|
+
hal_9000: chrismccord: I have a question about the philosophy/design
|
28
|
+
of phoenix - if you have time/inclination and the answer is not too involved
|
29
|
+
|
30
|
+
chrismccord: hal_9000: shoot
|
31
|
+
|
32
|
+
hal_9000: first of all, i’m not a web guy - i’ve played with rails and several
|
33
|
+
other things - wrote a few small apps. One thing that appealed to me
|
34
|
+
about Sinatra was how “lightweight” it was compared to Rails — you can
|
35
|
+
write a primitive Sinatra app in a single file.
|
36
|
+
hal_9000: i “sort of” expected that Phoenix might be that way — but a find piped
|
37
|
+
to wc showed me that a hello-world app has more than 11,000 files in it.
|
38
|
+
why in general is that?
|
39
|
+
|
40
|
+
chrismccord: hal_9000: remove the node_modules folder and re-run ws
|
41
|
+
chrismccord: it's all nodejs for the asset building
|
42
|
+
chrismccord: hal_9000: we are lightweight. It's a misconception I have to keep correcting.
|
43
|
+
We are much closer to sinatra than rails
|
44
|
+
|
45
|
+
hal_9000: hmm, i don’t even know nodejs of course
|
46
|
+
hal_9000: chrismccord: thanks, i had a feeling i was missing something for sure
|
47
|
+
|
48
|
+
chrismccord: hal_9000: you could write an app in a single file, but no-one does that,
|
49
|
+
because we don't write production software in a single file
|
50
|
+
chrismccord: hal_9000: It is also worth mentioning there is also nothing global in
|
51
|
+
phoenix. We are not a monolith like rails
|
52
|
+
|
53
|
+
jeregrine: hal_9000: something to keep in mind here is that phoenix assumes you are
|
54
|
+
writing production software. Eventually you will need to touch every file, otherwise
|
55
|
+
it wouldn't generate the file
|
56
|
+
|
57
|
+
hal_9000: chrismccord: ok, thanks, i will look more closely. i’m impressed with what i see
|
58
|
+
|
59
|
+
jeregrine: hal_9000: if you are like me and have used sinatra for production software you
|
60
|
+
probably discovered you ended up writing a slightly smaller version of rails
|
61
|
+
|
62
|
+
hal_9000: jeregrine: that makes perfect sense
|
63
|
+
|
64
|
+
jeregrine: hal_9000: if you only need a single route/api call, and are certain it will never grow,
|
65
|
+
you could VERY easily get away with just plug and it's router
|
66
|
+
jeregrine: hal_9000: http://hexdocs.pm/plug/Plug.Router.html for reference.
|
67
|
+
|
68
|
+
hal_9000: chrismccord: i grasp it now, sorry for the noise
|
69
|
+
|
70
|
+
jeregrine: hal_9000: lemme know if you have any questions, this is something we need to be better at
|
71
|
+
communicating. We are not rails
|
72
|
+
|
73
|
+
chrismccord: hal_9000: no worries. Sorry if my response was rash too. I just have to fight a lot of
|
74
|
+
"phoenix is bloated" comments because people assume it is given my Rails background and
|
75
|
+
the comparisons with rails
|
76
|
+
|
77
|
+
hal_9000: chrismccord: no, your response was not rash at all
|
78
|
+
|
79
|
+
So first of all: I didn't pay attention to what I was doing when I did my file count.
|
80
|
+
|
81
|
+
But the real takeaway here is: Phoenix isn't bloated, and more importantly, Phoenix isn't Rails.
|
82
|
+
The philosophy seems to be more "minimalistic" as I had hoped.
|
83
|
+
|
84
|
+
And of course, we all know that Elixir isn't Ruby. I won't belabor that point.
|
85
|
+
|
86
|
+
On the other hand, I do find (so far) that Plug is a lot like Rack. That's a good thing, because I
|
87
|
+
always thought Rack was sheer genius. More on that as I learn.
|
@@ -0,0 +1,129 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Concerning the term "monkeypatching"</title>
|
6
|
+
<meta name="generator" content="Scriptorium Import">
|
7
|
+
<meta property="og:title" content="Concerning the term "monkeypatching"">
|
8
|
+
<meta property="og:locale" content="en_US">
|
9
|
+
<meta property="og:type" content="article">
|
10
|
+
<meta property="article:published_time" content="2015-08-10">
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<article>
|
14
|
+
<header>
|
15
|
+
<h1>Concerning the term "monkeypatching"</h1>
|
16
|
+
<time datetime="2015-08-10">August 10, 2015</time>
|
17
|
+
</header>
|
18
|
+
|
19
|
+
<div class="content">
|
20
|
+
<p>
|
21
|
+
There have been many "dark days" in the Ruby community, some much darker than others.
|
22
|
+
Guy Decoux died, _why the lucky stiff_ left us (without dying), Jim Weirich died. (Yes, I count
|
23
|
+
actual deaths as the darkest moments of all.)
|
24
|
+
|
25
|
+
<p>
|
26
|
+
But I count another dark moment that many of you will not. When I had been using Ruby a
|
27
|
+
little more than six years, in December 2005, the term "monkeypatching" was introduced
|
28
|
+
into our circle.
|
29
|
+
|
30
|
+
<p>
|
31
|
+
It was a post by Drew Mills, quoting a blog from a Python person who apparently hated Ruby.
|
32
|
+
I don't blame Drew. I don't suppose I "blame" anyone. But I regret that this slang has entered
|
33
|
+
our culture.
|
34
|
+
|
35
|
+
<p>
|
36
|
+
The post Drew quoted was this:
|
37
|
+
|
38
|
+
<p>
|
39
|
+
<blockquote>
|
40
|
+
It's the second generation that's going to be less enthused, that's going to stare in bafflement at these classes that mysteriously spawn methods, and trying to figure out what's going when there's an exception in dynamically generated code. You can monkeypatch code in Python pretty easily, but we look down on it enough that we call it "monkeypatching". In Ruby they call it "opening a class" and think it's a cool feature. I will assert: we are right, they are wrong.
|
41
|
+
</blockquote>
|
42
|
+
Before I go on to my main point, I'll make an observation that is arguably much more interesting.
|
43
|
+
If you read again, it sounds like the Python person (Ian Bicking) was talking about dynamic method
|
44
|
+
dispatch (the use or abuse of method_missing) rather than actual open classes.
|
45
|
+
|
46
|
+
<p>
|
47
|
+
Someone later in that thread decried the "ignorance" of Bicking with regard to this -- that he didn't
|
48
|
+
even know enough Ruby to know the difference between dynamic dispatch and open classes. I
|
49
|
+
wonder if the original pythonism meant something different? Since I never completed my Python
|
50
|
+
studies, I can't comment.
|
51
|
+
|
52
|
+
<p>
|
53
|
+
At any rate: Back to my story.
|
54
|
+
|
55
|
+
<p>
|
56
|
+
I still recall the revulsion I felt, almost physical nausea, when I read this the first time. That's probably
|
57
|
+
a somewhat extreme response on my part.
|
58
|
+
|
59
|
+
<p>
|
60
|
+
I regarded open classes as a programming technique that is potentially very powerful but easy to misuse.
|
61
|
+
This sounds like a "good and yet bad" argument. But let me rephrase that sentence.
|
62
|
+
|
63
|
+
<p>
|
64
|
+
Open classes are a technique that is potentially very powerful <i>(and</i> therefore) easy to misuse. That is
|
65
|
+
the point. Any tool that is powerful enough is prone to misuse by people who are unskilled.
|
66
|
+
|
67
|
+
<p>
|
68
|
+
The term "monkeypatching" is obviously a pejorative term. Upon seeing it, my first thought was, "I am
|
69
|
+
not a monkey, and I am not 'patching' anything."
|
70
|
+
|
71
|
+
<p>
|
72
|
+
After all, that is the implication. The term implies that the developer is a monkey, and that the work he is
|
73
|
+
doing is sloppy or shoddy. It is an insult both to the quality of the developer's work and to the developer
|
74
|
+
himself.
|
75
|
+
|
76
|
+
<p>
|
77
|
+
So it bothered me because it was a pejorative and it was insulting to us as programmers. It was also
|
78
|
+
(arguably) an insult to Ruby itself and therefore by extension an insult to Matz.
|
79
|
+
|
80
|
+
<p>
|
81
|
+
I dislike being clannish, though perhaps sometimes I am. After all, Ruby is not (supposed to be) anyone's
|
82
|
+
religion or cultural heritage. It's only a programming language, and I think it's very much like Python. But it
|
83
|
+
also bothered me that this neologism originated <i>outside</i> our community, in particular with the Python
|
84
|
+
community.
|
85
|
+
|
86
|
+
<p>
|
87
|
+
Generalizations are always wrong. (Yes, that's a joke.) And stereotypes as such are at least useless if not
|
88
|
+
actually hurtful. And yet I always heard about the arrogance and rudeness of Python programmers, and I
|
89
|
+
occasionally saw real evidence of it. And though I dislike the word "nice" in general, I always found it interesting
|
90
|
+
that Ruby coders were labeled as "nice" (as in the abbreviation MINASWAN, "Matz is nice, and so we are nice").
|
91
|
+
|
92
|
+
<p>
|
93
|
+
So when this usage was introduced, I felt rather as though someone had opened my front door and dumped a
|
94
|
+
large piece of dog manure onto my carpet. What is worse, it has wormed its way into common usage in our
|
95
|
+
community, even in documentation. A lot of this happened in the early days of Rails, when fate dumped a huge
|
96
|
+
influx of newbies onto the Ruby community. Not to disparage the Rails people in general, but at the time this
|
97
|
+
felt much the same as it did back when AOL (America Online) made its debut and dumped millions of (insert
|
98
|
+
noun here) into the Internet and Usenet communities.
|
99
|
+
|
100
|
+
<p>
|
101
|
+
It's impossible to stop this usage now (like so many other usages in the English language having nothing to do
|
102
|
+
with computing). But I still protest, and I still stand against it.
|
103
|
+
|
104
|
+
<p>
|
105
|
+
The term "monkeypatching" appears only once in more than 800 pages of <i>The Ruby Way</i>. It occurs when I
|
106
|
+
say I don't condone this term, and it won't be used further in the book.
|
107
|
+
|
108
|
+
<p>
|
109
|
+
As an aside: The "refinements" which exist in recent versions of Ruby make open classes stricter and safer. I'll blog
|
110
|
+
about that later. But this isn't much of a technical post. It's just a reminiscence and a rant.
|
111
|
+
|
112
|
+
<p>
|
113
|
+
So basically I hate the term "monkeypatching." I am polite to people who say it to me (e.g., in asking a question), but
|
114
|
+
secretly I want to just ignore them.
|
115
|
+
|
116
|
+
<p>
|
117
|
+
The last time I saw Jim Weirich, in New Orleans, he and I talked about this. He agreed it was a pejorative term,
|
118
|
+
and it was a shame it had entered the common dialect, though there was really nothing to do about it. But being
|
119
|
+
much more level-headed and good-natured than I am, he wasn't bothered much by it.
|
120
|
+
|
121
|
+
<p>
|
122
|
+
I really miss Jim, by the way. He was a truly brilliant developer and an amiable and wonderful person in general.
|
123
|
+
If it would bring him back, I would gladly change the book's name to <i>The Art of Monkeypatching</i>.
|
124
|
+
|
125
|
+
<p>
|
126
|
+
</div>
|
127
|
+
</article>
|
128
|
+
</body>
|
129
|
+
</html>
|
@@ -0,0 +1,92 @@
|
|
1
|
+
.h1 Concerning the term "monkeypatching"
|
2
|
+
|
3
|
+
.set post.num = 0008
|
4
|
+
.set post.slug = concerning-the-term-monkeypatching
|
5
|
+
.set post.date = 2015-08-10
|
6
|
+
.set post.title = Concerning the term "monkeypatching"
|
7
|
+
.set post.tags =
|
8
|
+
.set post.views = computing
|
9
|
+
.set post.published = yes
|
10
|
+
.set post.deployed = no
|
11
|
+
|
12
|
+
There have been many "dark days" in the Ruby community, some much darker than others.
|
13
|
+
Guy Decoux died, _why the lucky stiff_ left us (without dying), Jim Weirich died. (Yes, I count
|
14
|
+
actual deaths as the darkest moments of all.)
|
15
|
+
|
16
|
+
But I count another dark moment that many of you will not. When I had been using Ruby a
|
17
|
+
little more than six years, in December 2005, the term "monkeypatching" was introduced
|
18
|
+
into our circle.
|
19
|
+
|
20
|
+
It was a post by Drew Mills, quoting a blog from a Python person who apparently hated Ruby.
|
21
|
+
I don't blame Drew. I don't suppose I "blame" anyone. But I regret that this slang has entered
|
22
|
+
our culture.
|
23
|
+
|
24
|
+
The post Drew quoted was this:
|
25
|
+
|
26
|
+
It's the second generation that's going to be less enthused, that's going to stare in bafflement at these classes that mysteriously spawn methods, and trying to figure out what's going when there's an exception in dynamically generated code. You can monkeypatch code in Python pretty easily, but we look down on it enough that we call it "monkeypatching". In Ruby they call it "opening a class" and think it's a cool feature. I will assert: we are right, they are wrong.
|
27
|
+
|
28
|
+
Before I go on to my main point, I'll make an observation that is arguably much more interesting.
|
29
|
+
If you read again, it sounds like the Python person (Ian Bicking) was talking about dynamic method
|
30
|
+
dispatch (the use or abuse of method_missing) rather than actual open classes.
|
31
|
+
|
32
|
+
Someone later in that thread decried the "ignorance" of Bicking with regard to this -- that he didn't
|
33
|
+
even know enough Ruby to know the difference between dynamic dispatch and open classes. I
|
34
|
+
wonder if the original pythonism meant something different? Since I never completed my Python
|
35
|
+
studies, I can't comment.
|
36
|
+
|
37
|
+
At any rate: Back to my story.
|
38
|
+
|
39
|
+
I still recall the revulsion I felt, almost physical nausea, when I read this the first time. That's probably
|
40
|
+
a somewhat extreme response on my part.
|
41
|
+
|
42
|
+
I regarded open classes as a programming technique that is potentially very powerful but easy to misuse.
|
43
|
+
This sounds like a "good and yet bad" argument. But let me rephrase that sentence.
|
44
|
+
|
45
|
+
Open classes are a technique that is potentially very powerful (and therefore) easy to misuse. That is
|
46
|
+
the point. Any tool that is powerful enough is prone to misuse by people who are unskilled.
|
47
|
+
|
48
|
+
The term "monkeypatching" is obviously a pejorative term. Upon seeing it, my first thought was, "I am
|
49
|
+
not a monkey, and I am not 'patching' anything."
|
50
|
+
|
51
|
+
After all, that is the implication. The term implies that the developer is a monkey, and that the work he is
|
52
|
+
doing is sloppy or shoddy. It is an insult both to the quality of the developer's work and to the developer
|
53
|
+
himself.
|
54
|
+
|
55
|
+
So it bothered me because it was a pejorative and it was insulting to us as programmers. It was also
|
56
|
+
(arguably) an insult to Ruby itself and therefore by extension an insult to Matz.
|
57
|
+
|
58
|
+
I dislike being clannish, though perhaps sometimes I am. After all, Ruby is not (supposed to be) anyone's
|
59
|
+
religion or cultural heritage. It's only a programming language, and I think it's very much like Python. But it
|
60
|
+
also bothered me that this neologism originated outside our community, in particular with the Python
|
61
|
+
community.
|
62
|
+
|
63
|
+
Generalizations are always wrong. (Yes, that's a joke.) And stereotypes as such are at least useless if not
|
64
|
+
actually hurtful. And yet I always heard about the arrogance and rudeness of Python programmers, and I
|
65
|
+
occasionally saw real evidence of it. And though I dislike the word "nice" in general, I always found it interesting
|
66
|
+
that Ruby coders were labeled as "nice" (as in the abbreviation MINASWAN, "Matz is nice, and so we are nice").
|
67
|
+
|
68
|
+
So when this usage was introduced, I felt rather as though someone had opened my front door and dumped a
|
69
|
+
large piece of dog manure onto my carpet. What is worse, it has wormed its way into common usage in our
|
70
|
+
community, even in documentation. A lot of this happened in the early days of Rails, when fate dumped a huge
|
71
|
+
influx of newbies onto the Ruby community. Not to disparage the Rails people in general, but at the time this
|
72
|
+
felt much the same as it did back when AOL (America Online) made its debut and dumped millions of (insert
|
73
|
+
noun here) into the Internet and Usenet communities.
|
74
|
+
|
75
|
+
It's impossible to stop this usage now (like so many other usages in the English language having nothing to do
|
76
|
+
with computing). But I still protest, and I still stand against it.
|
77
|
+
|
78
|
+
The term "monkeypatching" appears only once in more than 800 pages of The Ruby Way. It occurs when I
|
79
|
+
say I don't condone this term, and it won't be used further in the book.
|
80
|
+
|
81
|
+
As an aside: The "refinements" which exist in recent versions of Ruby make open classes stricter and safer. I'll blog
|
82
|
+
about that later. But this isn't much of a technical post. It's just a reminiscence and a rant.
|
83
|
+
|
84
|
+
So basically I hate the term "monkeypatching." I am polite to people who say it to me (e.g., in asking a question), but
|
85
|
+
secretly I want to just ignore them.
|
86
|
+
|
87
|
+
The last time I saw Jim Weirich, in New Orleans, he and I talked about this. He agreed it was a pejorative term,
|
88
|
+
and it was a shame it had entered the common dialect, though there was really nothing to do about it. But being
|
89
|
+
much more level-headed and good-natured than I am, he wasn't bothered much by it.
|
90
|
+
|
91
|
+
I really miss Jim, by the way. He was a truly brilliant developer and an amiable and wonderful person in general.
|
92
|
+
If it would bring him back, I would gladly change the book's name to The Art of Monkeypatching.
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Announcement coming soon...</title>
|
6
|
+
<meta name="generator" content="Scriptorium Import">
|
7
|
+
<meta property="og:title" content="Announcement coming soon...">
|
8
|
+
<meta property="og:locale" content="en_US">
|
9
|
+
<meta property="og:type" content="article">
|
10
|
+
<meta property="article:published_time" content="2015-08-11">
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<article>
|
14
|
+
<header>
|
15
|
+
<h1>Announcement coming soon...</h1>
|
16
|
+
<time datetime="2015-08-11">August 11, 2015</time>
|
17
|
+
</header>
|
18
|
+
|
19
|
+
<div class="content">
|
20
|
+
<p>
|
21
|
+
Maybe this will stir your curiosity a little. I hope it does.
|
22
|
+
I've started working on a project with someone else, and I
|
23
|
+
think it will be really worthwhile.
|
24
|
+
This will be launched within 48 hours and announced at the
|
25
|
+
Lone Star Ruby Conference in Austin, Texas (October 15).
|
26
|
+
Maybe it will be leaked a little before then, too.
|
27
|
+
|
28
|
+
<p>
|
29
|
+
Sit tight 48 hours or so...
|
30
|
+
</div>
|
31
|
+
</article>
|
32
|
+
</body>
|
33
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
.h1 Announcement coming soon...
|
2
|
+
|
3
|
+
.set post.num = 0009
|
4
|
+
.set post.slug = announcement-coming-soon
|
5
|
+
.set post.date = 2015-08-11
|
6
|
+
.set post.title = Announcement coming soon...
|
7
|
+
.set post.tags =
|
8
|
+
.set post.views = computing
|
9
|
+
.set post.published = yes
|
10
|
+
.set post.deployed = no
|
11
|
+
|
12
|
+
Maybe this will stir your curiosity a little. I hope it does.
|
13
|
+
I've started working on a project with someone else, and I
|
14
|
+
think it will be really worthwhile.
|
15
|
+
This will be launched within 48 hours and announced at the
|
16
|
+
Lone Star Ruby Conference in Austin, Texas (October 15).
|
17
|
+
Maybe it will be leaked a little before then, too.
|
18
|
+
|
19
|
+
Sit tight 48 hours or so...
|