IOWA 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CONTRIBUTORS +14 -0
- data/README.md +23 -0
- data/RELEASE_NOTES +77 -0
- data/ToDo +21 -0
- data/components/CRUDList/CRUDList.html +13 -0
- data/components/CRUDList/CRUDList.iwa +136 -0
- data/components/Content/Content.html +0 -0
- data/components/Content/Content.iwa +143 -0
- data/components/Content/example/README +9 -0
- data/components/Content/example/cgi/iowa.cgi +10 -0
- data/components/Content/example/demo.rb +30 -0
- data/components/Content/example/doc/index.html +7 -0
- data/components/Content/example/iowa/Content.html +1 -0
- data/components/Content/example/iowa/Content.iwa +1 -0
- data/components/Content/example/iowa/Main.html +6 -0
- data/components/Content/example/iowa/Main.iwa +3 -0
- data/components/Content/example/iowa/_content/body +7 -0
- data/components/Content/example/iowa/_content/body2 +3 -0
- data/components/Content/example/iowa/_content/title +2 -0
- data/components/Content/example/iowa/app.cnf +8 -0
- data/components/Content/example/iowa/app.rb +8 -0
- data/components/Content/example/webrick.rb +38 -0
- data/components/Include/Include.html +1 -0
- data/components/Include/Include.iwa +30 -0
- data/components/Include/readme +5 -0
- data/components/JumpTo/JumpTo.html +8 -0
- data/components/JumpTo/JumpTo.iwa +8 -0
- data/components/JumpTo/readme +6 -0
- data/doc/Architecture.txt +6 -0
- data/doc/History.txt +33 -0
- data/doc/StandardDispatcher.txt +19 -0
- data/examples/blog/README +1 -0
- data/examples/hello_world/README +17 -0
- data/examples/hello_world/htdocs/hello_world_html.html +24 -0
- data/examples/hello_world/htdocs/hello_world_ruby.html +41 -0
- data/examples/hello_world/iowa/HelloWorld.html +14 -0
- data/examples/hello_world/iowa/HelloWorld.iwa +31 -0
- data/examples/hello_world/iowa/Index.html +16 -0
- data/examples/hello_world/iowa/Index.iwa +5 -0
- data/examples/hello_world/iowa/iowa_hello_world.cnf +19 -0
- data/examples/hello_world/iowa/iowa_hello_world.rb +5 -0
- data/examples/hello_world/iowa/mapfile.cnf +6 -0
- data/examples/hw1/iowa/Main.html +1 -0
- data/examples/hw1/iowa/README +9 -0
- data/examples/hw1/iowa/hw.rb +4 -0
- data/examples/hw2/iowa/Main.html +10 -0
- data/examples/hw2/iowa/Main.iwa +7 -0
- data/examples/hw2/iowa/README +16 -0
- data/examples/hw2/iowa/hw.rb +4 -0
- data/examples/hw3/iowa/Main.html +11 -0
- data/examples/hw3/iowa/Main.iwa +7 -0
- data/examples/hw3/iowa/README +22 -0
- data/examples/hw3/iowa/hw.rb +4 -0
- data/examples/hw4/iowa/Greetings.html +10 -0
- data/examples/hw4/iowa/Greetings.iwa +9 -0
- data/examples/hw4/iowa/Main.html +12 -0
- data/examples/hw4/iowa/Main.iwa +10 -0
- data/examples/hw4/iowa/README +28 -0
- data/examples/hw4/iowa/hw.rb +4 -0
- data/examples/hw5/iowa/Footer.html +2 -0
- data/examples/hw5/iowa/Greetings.html +4 -0
- data/examples/hw5/iowa/Greetings.iwa +12 -0
- data/examples/hw5/iowa/Header.html +6 -0
- data/examples/hw5/iowa/Main.html +12 -0
- data/examples/hw5/iowa/Main.iwa +13 -0
- data/examples/hw5/iowa/README +16 -0
- data/examples/hw5/iowa/hw.rb +4 -0
- data/examples/template_server/iowa/Content.iwa +121 -0
- data/examples/template_server/iowa/Content.view +0 -0
- data/examples/template_server/iowa/DBContentDispatcher.rb +112 -0
- data/examples/template_server/iowa/DBContentPage.html +3 -0
- data/examples/template_server/iowa/DBContentPage.iwa +85 -0
- data/examples/template_server/iowa/app.cnf +13 -0
- data/examples/template_server/iowa/app.rb +5 -0
- data/ext/Classifier/classifier.c +256 -0
- data/ext/Classifier/ext_help.h +14 -0
- data/ext/Classifier/extconf.rb +5 -0
- data/ext/Classifier/tst.h +40 -0
- data/ext/Classifier/tst_cleanup.c +24 -0
- data/ext/Classifier/tst_delete.c +146 -0
- data/ext/Classifier/tst_grow_node_free_list.c +38 -0
- data/ext/Classifier/tst_init.c +41 -0
- data/ext/Classifier/tst_insert.c +192 -0
- data/ext/Classifier/tst_search.c +68 -0
- data/ext/http11/README +11 -0
- data/ext/http11/ext_help.h +15 -0
- data/ext/http11/extconf.rb +5 -0
- data/ext/http11/http11.c +534 -0
- data/ext/http11/http11.c.dif +422 -0
- data/ext/http11/http11_parser.c +1243 -0
- data/ext/http11/http11_parser.c.dif +193 -0
- data/ext/http11/http11_parser.h +49 -0
- data/ext/http11/http11_parser.h.dif +20 -0
- data/ext/http11/http11_parser.rl +192 -0
- data/ext/httpmachine/Makefile +149 -0
- data/ext/httpmachine/extconf.rb +33 -0
- data/ext/httpmachine/http.cpp +430 -0
- data/ext/httpmachine/http.h +156 -0
- data/ext/httpmachine/rubyhttp.cpp +165 -0
- data/external/mime-types/LICENCE +18 -0
- data/external/mime-types/README +46 -0
- data/external/mime-types/doc/classes/MIME.html +120 -0
- data/external/mime-types/doc/classes/MIME/InvalidContentType.html +119 -0
- data/external/mime-types/doc/classes/MIME/Type.html +866 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000010.html +22 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000011.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000012.html +19 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000013.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000014.html +26 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000015.html +33 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000016.html +27 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000017.html +35 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000018.html +34 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000019.html +24 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000020.html +38 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000021.html +22 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000022.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000023.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000024.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000025.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000026.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000027.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000028.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000029.html +18 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000030.html +19 -0
- data/external/mime-types/doc/classes/MIME/Type.src/M000031.html +26 -0
- data/external/mime-types/doc/classes/MIME/Types.html +459 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000001.html +19 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000002.html +32 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000003.html +21 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000004.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000005.html +26 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000006.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000007.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000008.html +18 -0
- data/external/mime-types/doc/classes/MIME/Types.src/M000009.html +18 -0
- data/external/mime-types/doc/created.rid +1 -0
- data/external/mime-types/doc/files/ChangeLog.html +320 -0
- data/external/mime-types/doc/files/README.html +145 -0
- data/external/mime-types/doc/files/lib/mime/types_rb.html +101 -0
- data/external/mime-types/doc/fr_class_index.html +30 -0
- data/external/mime-types/doc/fr_file_index.html +29 -0
- data/external/mime-types/doc/fr_method_index.html +57 -0
- data/external/mime-types/doc/index.html +24 -0
- data/external/mime-types/doc/rdoc-style.css +208 -0
- data/external/mime-types/lib/mime/types.rb +1558 -0
- data/external/package.rb +672 -0
- data/external/test_support.rb +95 -0
- data/external/tmail/README +7 -0
- data/external/tmail/tmail.rb +4 -0
- data/external/tmail/tmail/address.rb +222 -0
- data/external/tmail/tmail/base64.rb +52 -0
- data/external/tmail/tmail/compat.rb +39 -0
- data/external/tmail/tmail/config.rb +50 -0
- data/external/tmail/tmail/encode.rb +447 -0
- data/external/tmail/tmail/header.rb +895 -0
- data/external/tmail/tmail/info.rb +14 -0
- data/external/tmail/tmail/loader.rb +1 -0
- data/external/tmail/tmail/mail.rb +869 -0
- data/external/tmail/tmail/mailbox.rb +386 -0
- data/external/tmail/tmail/mbox.rb +1 -0
- data/external/tmail/tmail/net.rb +260 -0
- data/external/tmail/tmail/obsolete.rb +123 -0
- data/external/tmail/tmail/parser.rb +1475 -0
- data/external/tmail/tmail/parser.y +372 -0
- data/external/tmail/tmail/port.rb +356 -0
- data/external/tmail/tmail/scanner.rb +17 -0
- data/external/tmail/tmail/scanner_r.rb +243 -0
- data/external/tmail/tmail/stringio.rb +256 -0
- data/external/tmail/tmail/textutils.rb +197 -0
- data/external/tmail/tmail/tmail.rb +1 -0
- data/external/tmail/tmail/utils.rb +23 -0
- data/external/win32-process/README +133 -0
- data/external/win32-process/lib/win32/process.rb +561 -0
- data/external/windows-pr/README +145 -0
- data/external/windows-pr/doc/conversion_guide.txt +25 -0
- data/external/windows-pr/lib/windows/clipboard.rb +72 -0
- data/external/windows-pr/lib/windows/console.rb +323 -0
- data/external/windows-pr/lib/windows/device_io.rb +88 -0
- data/external/windows-pr/lib/windows/directory.rb +80 -0
- data/external/windows-pr/lib/windows/error.rb +313 -0
- data/external/windows-pr/lib/windows/eventlog.rb +120 -0
- data/external/windows-pr/lib/windows/file.rb +349 -0
- data/external/windows-pr/lib/windows/filesystem.rb +16 -0
- data/external/windows-pr/lib/windows/handle.rb +31 -0
- data/external/windows-pr/lib/windows/library.rb +76 -0
- data/external/windows-pr/lib/windows/limits.rb +13 -0
- data/external/windows-pr/lib/windows/memory.rb +117 -0
- data/external/windows-pr/lib/windows/msvcrt/buffer.rb +48 -0
- data/external/windows-pr/lib/windows/msvcrt/file.rb +18 -0
- data/external/windows-pr/lib/windows/msvcrt/string.rb +46 -0
- data/external/windows-pr/lib/windows/national.rb +557 -0
- data/external/windows-pr/lib/windows/path.rb +296 -0
- data/external/windows-pr/lib/windows/pipe.rb +77 -0
- data/external/windows-pr/lib/windows/process.rb +171 -0
- data/external/windows-pr/lib/windows/registry.rb +238 -0
- data/external/windows-pr/lib/windows/security.rb +89 -0
- data/external/windows-pr/lib/windows/service.rb +183 -0
- data/external/windows-pr/lib/windows/shell.rb +88 -0
- data/external/windows-pr/lib/windows/sound.rb +52 -0
- data/external/windows-pr/lib/windows/synchronize.rb +161 -0
- data/external/windows-pr/lib/windows/system_info.rb +70 -0
- data/external/windows-pr/lib/windows/unicode.rb +138 -0
- data/external/windows-pr/lib/windows/window.rb +22 -0
- data/iowa.gemspec +45 -0
- data/microprojects/DiskCache/LICENSE +28 -0
- data/microprojects/DiskCache/README +17 -0
- data/microprojects/DiskCache/external/package.rb +608 -0
- data/microprojects/DiskCache/external/test_support.rb +8 -0
- data/microprojects/DiskCache/setup.rb +22 -0
- data/microprojects/DiskCache/src/iowa/Association.rb +67 -0
- data/microprojects/DiskCache/src/iowa/Constants.rb +159 -0
- data/microprojects/DiskCache/src/iowa/DiskStore.rb +377 -0
- data/microprojects/DiskCache/src/iowa/Hash.rb +63 -0
- data/microprojects/DiskCache/src/iowa/Lockfile.rb +575 -0
- data/microprojects/DiskCache/src/iowa/Mutex.rb +142 -0
- data/microprojects/DiskCache/src/iowa/caches/DiskCache.rb +605 -0
- data/microprojects/DiskCache/src/iowa/caches/LRUCache.rb +287 -0
- data/microprojects/DiskCache/test/TC_DiskCache.rb +218 -0
- data/microprojects/LRUCache/LICENSE +28 -0
- data/microprojects/LRUCache/README +13 -0
- data/microprojects/LRUCache/external/package.rb +608 -0
- data/microprojects/LRUCache/external/test_support.rb +8 -0
- data/microprojects/LRUCache/setup.rb +22 -0
- data/microprojects/LRUCache/src/iowa/Association.rb +57 -0
- data/microprojects/LRUCache/src/iowa/Constants.rb +159 -0
- data/microprojects/LRUCache/src/iowa/Hash.rb +63 -0
- data/microprojects/LRUCache/src/iowa/Mutex.rb +129 -0
- data/microprojects/LRUCache/src/iowa/caches/LRUCache.rb +287 -0
- data/microprojects/LRUCache/test/TC_LRUCache.rb +65 -0
- data/microprojects/LinkedList/LICENSE +28 -0
- data/microprojects/LinkedList/README +13 -0
- data/microprojects/LinkedList/external/package.rb +608 -0
- data/microprojects/LinkedList/external/test_support.rb +8 -0
- data/microprojects/LinkedList/setup.rb +22 -0
- data/microprojects/LinkedList/src/iowa/LinkedList.rb +165 -0
- data/microprojects/LinkedList/test/TC_LinkedList.rb +42 -0
- data/microprojects/README +8 -0
- data/setup.rb +116 -0
- data/share/iowa/app_skeleton/Main.html +8 -0
- data/share/iowa/app_skeleton/Main.iwa +15 -0
- data/share/iowa/app_skeleton/app.cnf +48 -0
- data/share/iowa/app_skeleton/app.rb +58 -0
- data/share/iowa/app_skeleton/models/model.rb +49 -0
- data/src/ihc.rb +223 -0
- data/src/iowa.cgi +29 -0
- data/src/iowa.rb +637 -0
- data/src/iowa/AbstractCache.rb +96 -0
- data/src/iowa/AcceptLanguage.rb +76 -0
- data/src/iowa/Application.rb +928 -0
- data/src/iowa/ApplicationStats.rb +72 -0
- data/src/iowa/Association.rb +67 -0
- data/src/iowa/BindingsParser.rb +62 -0
- data/src/iowa/Breakpoint.rb +273 -0
- data/src/iowa/CSS.rb +564 -0
- data/src/iowa/Client.rb +192 -0
- data/src/iowa/Component.rb +405 -0
- data/src/iowa/ComponentProxy.rb +26 -0
- data/src/iowa/Config.rb +21 -0
- data/src/iowa/Constants.rb +226 -0
- data/src/iowa/Context.rb +218 -0
- data/src/iowa/ContextLogger.rb +16 -0
- data/src/iowa/DbPool.rb +222 -0
- data/src/iowa/DetachedComponent.rb +18 -0
- data/src/iowa/Dispatcher.rb +27 -0
- data/src/iowa/DynamicElements.rb +471 -0
- data/src/iowa/Element.rb +100 -0
- data/src/iowa/Email.rb +287 -0
- data/src/iowa/Extensions/AllExtensions.rb +4 -0
- data/src/iowa/Extensions/Class.rb +94 -0
- data/src/iowa/Extensions/Date.rb +88 -0
- data/src/iowa/Extensions/DateTime.rb +88 -0
- data/src/iowa/Extensions/Hash.rb +22 -0
- data/src/iowa/Extensions/Kernel.rb +6 -0
- data/src/iowa/Extensions/Numeric.rb +47 -0
- data/src/iowa/Extensions/Object.rb +11 -0
- data/src/iowa/Extensions/String.rb +60 -0
- data/src/iowa/Extensions/Time.rb +89 -0
- data/src/iowa/Extensions/TimeExtensions.rb +6 -0
- data/src/iowa/Form.rb +368 -0
- data/src/iowa/Hash.rb +85 -0
- data/src/iowa/ISAAC.rb +175 -0
- data/src/iowa/ImageSize.rb +279 -0
- data/src/iowa/IowaComponentMixins.rb +7 -0
- data/src/iowa/JSON-lexer.rb +296 -0
- data/src/iowa/JSON-objects.rb +201 -0
- data/src/iowa/KeyValueCoding.rb +91 -0
- data/src/iowa/LinkedList.rb +175 -0
- data/src/iowa/Loader.rb +22 -0
- data/src/iowa/Lockfile.rb +575 -0
- data/src/iowa/Logger.rb +74 -0
- data/src/iowa/Monkey.rb +20 -0
- data/src/iowa/Mutex.rb +142 -0
- data/src/iowa/Policy.rb +70 -0
- data/src/iowa/Pool.rb +243 -0
- data/src/iowa/PrettyException.rb +1091 -0
- data/src/iowa/Request.rb +244 -0
- data/src/iowa/Response.rb +133 -0
- data/src/iowa/Session.rb +354 -0
- data/src/iowa/SessionStats.rb +78 -0
- data/src/iowa/String.rb +65 -0
- data/src/iowa/Tag.rb +101 -0
- data/src/iowa/TemplateParser.rb +236 -0
- data/src/iowa/Util.rb +314 -0
- data/src/iowa/Webcache.rb +122 -0
- data/src/iowa/caches/BiLevelCache.rb +65 -0
- data/src/iowa/caches/ClassLimitedCache.rb +67 -0
- data/src/iowa/caches/DiskCache.rb +609 -0
- data/src/iowa/caches/DiskStore.rb +380 -0
- data/src/iowa/caches/LRUCache-alternative.rb +155 -0
- data/src/iowa/caches/LRUCache.rb +290 -0
- data/src/iowa/caches/SimpleLRUCache.rb +112 -0
- data/src/iowa/dispatchers/StandardDispatcher.rb +396 -0
- data/src/iowa/dispatchers/StandardDispatcherWithClassifier.rb +93 -0
- data/src/iowa/js/iowa_jsonrpc.js +381 -0
- data/src/iowa/js/jsonrpc.js +187 -0
- data/src/iowa/js/jsonrpc_async.js +261 -0
- data/src/iowa/loaders/DiskLoader.rb +50 -0
- data/src/iowa/loggers/Analogger.rb +54 -0
- data/src/iowa/loggers/AsyncLogger.rb +54 -0
- data/src/iowa/loggers/BitBucket.rb +38 -0
- data/src/iowa/loggers/Log4R.rb +13 -0
- data/src/iowa/loggers/Log4rLogger.rb +48 -0
- data/src/iowa/loggers/Logger.rb +29 -0
- data/src/iowa/loggers/RubyLogger.rb +9 -0
- data/src/iowa/pools/DBConnectionPool.rb +53 -0
- data/src/iowa/request/Apache.rb +90 -0
- data/src/iowa/request/EMHybrid.rb +59 -0
- data/src/iowa/request/ENV.rb +80 -0
- data/src/iowa/request/FCGI.rb +68 -0
- data/src/iowa/request/HTTPMachine.rb +75 -0
- data/src/iowa/request/Mongrel.rb +68 -0
- data/src/iowa/request/WEBrick.rb +48 -0
- data/src/iowa/version.rb +3 -0
- data/src/iowa/webrick/HTTPServer.rb +43 -0
- data/src/iowa/webrick/WEBrickServlet.rb +28 -0
- data/src/iowa_fcgi_handler.rb +101 -0
- data/src/iowa_httpmachine.rb +141 -0
- data/src/iowa_hybrid.rb +193 -0
- data/src/iowa_hybrid_cluster.rb +231 -0
- data/src/iowa_mongrel.rb +136 -0
- data/src/iowa_webrick.rb +194 -0
- data/src/iowa_webrick_legacy.rb +104 -0
- data/src/mod_iowa.rb +104 -0
- data/tcss.rb +61 -0
- data/test/README.windows +12 -0
- data/test/TC_AcceptLanguage.rb +61 -0
- data/test/TC_AppConfig.rb +43 -0
- data/test/TC_AppConfig/cgi/iowa.cgi +7 -0
- data/test/TC_AppConfig/doc/index.html +1 -0
- data/test/TC_AppConfig/iowa/Main.html +4 -0
- data/test/TC_AppConfig/iowa/Main.iwa +17 -0
- data/test/TC_AppConfig/iowa/README +1 -0
- data/test/TC_AppConfig/iowa/app.cnf +19 -0
- data/test/TC_AppConfig/iowa/app.rb +8 -0
- data/test/TC_AppConfig/webrick.rb +38 -0
- data/test/TC_Association.rb +29 -0
- data/test/TC_BiLevelCache.rb +71 -0
- data/test/TC_CGI_Adaptor.rb +55 -0
- data/test/TC_CGI_Adaptor/cgi/iowa.cgi +7 -0
- data/test/TC_CGI_Adaptor/doc/index.html +1 -0
- data/test/TC_CGI_Adaptor/iowa/Main.html +8 -0
- data/test/TC_CGI_Adaptor/iowa/Main.iwa +14 -0
- data/test/TC_CGI_Adaptor/iowa/README +1 -0
- data/test/TC_CGI_Adaptor/iowa/app.cnf +8 -0
- data/test/TC_CGI_Adaptor/iowa/app.rb +8 -0
- data/test/TC_CGI_Adaptor/webrick.rb +38 -0
- data/test/TC_CSS.rb +660 -0
- data/test/TC_ClassLimitedCache.rb +89 -0
- data/test/TC_Classifier.rb +80 -0
- data/test/TC_DbPool.rb +127 -0
- data/test/TC_DiskCache.rb +218 -0
- data/test/TC_Hybrid.rb +58 -0
- data/test/TC_Hybrid/doc/thing.txt +1 -0
- data/test/TC_Hybrid/iowa/Main.html +3 -0
- data/test/TC_Hybrid/iowa/Main.iwa +7 -0
- data/test/TC_Hybrid/iowa/NewPage.html +1 -0
- data/test/TC_Hybrid/iowa/NewPage.iwa +5 -0
- data/test/TC_Hybrid/iowa/app.cnf +10 -0
- data/test/TC_Hybrid/iowa/app.rb +5 -0
- data/test/TC_IOWAFunctions/doc/Ajax1.html +1 -0
- data/test/TC_IOWAFunctions/doc/Ajax1.iwa +1 -0
- data/test/TC_IOWAFunctions/doc/index.html +1 -0
- data/test/TC_IOWAFunctions/doc/js/dojo.js +9686 -0
- data/test/TC_IOWAFunctions/iowa/Ajax1.html +40 -0
- data/test/TC_IOWAFunctions/iowa/Ajax1.iwa +23 -0
- data/test/TC_IOWAFunctions/iowa/AjaxWidget.iwa +19 -0
- data/test/TC_IOWAFunctions/iowa/AjaxWidget.view +22 -0
- data/test/TC_IOWAFunctions/iowa/DanielTest.html +9 -0
- data/test/TC_IOWAFunctions/iowa/DanielTest.iwa +10 -0
- data/test/TC_IOWAFunctions/iowa/IntervalWidget.html +1 -0
- data/test/TC_IOWAFunctions/iowa/IntervalWidget.iwa +14 -0
- data/test/TC_IOWAFunctions/iowa/Main.html +1 -0
- data/test/TC_IOWAFunctions/iowa/NestedRepeat1.html +12 -0
- data/test/TC_IOWAFunctions/iowa/NestedRepeat1.iwa +24 -0
- data/test/TC_IOWAFunctions/iowa/RPCResponse.iwa +7 -0
- data/test/TC_IOWAFunctions/iowa/RPCResponse.view +1 -0
- data/test/TC_IOWAFunctions/iowa/Repeat1.iwa +31 -0
- data/test/TC_IOWAFunctions/iowa/Repeat1.view +9 -0
- data/test/TC_IOWAFunctions/iowa/Repeat2.iwa +32 -0
- data/test/TC_IOWAFunctions/iowa/Repeat2.view +11 -0
- data/test/TC_IOWAFunctions/iowa/Repeat3.iwa +44 -0
- data/test/TC_IOWAFunctions/iowa/Repeat3.view +18 -0
- data/test/TC_IOWAFunctions/iowa/TesCon.html +1 -0
- data/test/TC_IOWAFunctions/iowa/TesCon.iwa +5 -0
- data/test/TC_IOWAFunctions/iowa/app.cnf +19 -0
- data/test/TC_IOWAFunctions/iowa/app.rb +9 -0
- data/test/TC_IOWAFunctions/iowa/mapfile.cnf +8 -0
- data/test/TC_ISAAC.rb +52 -0
- data/test/TC_ImageSize.rb +84 -0
- data/test/TC_ImageSize/img.bmp +0 -0
- data/test/TC_ImageSize/img.gif +0 -0
- data/test/TC_ImageSize/img.jpg +0 -0
- data/test/TC_ImageSize/img.pcx +0 -0
- data/test/TC_ImageSize/img.pgm +7144 -0
- data/test/TC_ImageSize/img.png +0 -0
- data/test/TC_ImageSize/img.ppm +0 -0
- data/test/TC_ImageSize/img.psd +0 -0
- data/test/TC_ImageSize/img.tiff +0 -0
- data/test/TC_ImageSize/img.xbm +22 -0
- data/test/TC_KeyValueCoding.rb +35 -0
- data/test/TC_LRUCache.rb +296 -0
- data/test/TC_LinkedList.rb +46 -0
- data/test/TC_Lockfile.rb +106 -0
- data/test/TC_Minimal.rb +45 -0
- data/test/TC_Minimal/app.cnf +8 -0
- data/test/TC_Minimal/cgi-bin/iowa.cgi +11 -0
- data/test/TC_Minimal/doc/index.html +1 -0
- data/test/TC_Minimal/iowa/Main.html +1 -0
- data/test/TC_Minimal/iowa/README +1 -0
- data/test/TC_Minimal/iowa/app.rb +3 -0
- data/test/TC_Minimal/webrick.rb +38 -0
- data/test/TC_Mongrel.rb +58 -0
- data/test/TC_Mongrel/doc/thing.txt +1 -0
- data/test/TC_Mongrel/iowa/Main.html +3 -0
- data/test/TC_Mongrel/iowa/Main.iwa +7 -0
- data/test/TC_Mongrel/iowa/NewPage.html +1 -0
- data/test/TC_Mongrel/iowa/NewPage.iwa +5 -0
- data/test/TC_Mongrel/iowa/app.cnf +10 -0
- data/test/TC_Mongrel/iowa/app.rb +5 -0
- data/test/TC_NoSubclass.rb +56 -0
- data/test/TC_NoSubclass/cgi/iowa.cgi +7 -0
- data/test/TC_NoSubclass/doc/index.html +1 -0
- data/test/TC_NoSubclass/iowa/Main.html +8 -0
- data/test/TC_NoSubclass/iowa/Main.iwa +14 -0
- data/test/TC_NoSubclass/iowa/README +1 -0
- data/test/TC_NoSubclass/iowa/app.cnf +8 -0
- data/test/TC_NoSubclass/iowa/app.rb +5 -0
- data/test/TC_NoSubclass/webrick.rb +38 -0
- data/test/TC_Pool.rb +139 -0
- data/test/TC_RenderedCache/doc/thing.txt +1 -0
- data/test/TC_RenderedCache/iowa/BigPage.html +1 -0
- data/test/TC_RenderedCache/iowa/BigPage.iwa +12 -0
- data/test/TC_RenderedCache/iowa/Main.html +3 -0
- data/test/TC_RenderedCache/iowa/Main.iwa +7 -0
- data/test/TC_RenderedCache/iowa/NewPage.html +1 -0
- data/test/TC_RenderedCache/iowa/NewPage.iwa +11 -0
- data/test/TC_RenderedCache/iowa/app.cnf +13 -0
- data/test/TC_RenderedCache/iowa/app.rb +5 -0
- data/test/TC_RenderedCache/iowa/mapfile.map +4 -0
- data/test/TC_ResourceURL.rb +73 -0
- data/test/TC_ResourceURL/iowa/Main.html +2 -0
- data/test/TC_ResourceURL/iowa/Main.iwa +10 -0
- data/test/TC_ResourceURL/iowa/app.cnf +10 -0
- data/test/TC_ResourceURL/iowa/app.rb +5 -0
- data/test/TC_SimpleDetached.rb +41 -0
- data/test/TC_StandardDispatcher.rb +362 -0
- data/test/TC_StandardDispatcherWithClassifier.rb +358 -0
- data/test/TC_String.rb +24 -0
- data/test/TC_Tag.rb +41 -0
- data/test/TC_Webrick.rb +56 -0
- data/test/TC_Webrick/doc/thing.txt +1 -0
- data/test/TC_Webrick/iowa/Main.html +3 -0
- data/test/TC_Webrick/iowa/Main.iwa +7 -0
- data/test/TC_Webrick/iowa/NewPage.html +1 -0
- data/test/TC_Webrick/iowa/NewPage.iwa +5 -0
- data/test/TC_Webrick/iowa/app.cnf +10 -0
- data/test/TC_Webrick/iowa/app.rb +5 -0
- data/test/tc_template.rb +15 -0
- data/test/tests.conf +19 -0
- data/utils/CVS/Entries +3 -0
- data/utils/CVS/Repository +1 -0
- data/utils/CVS/Root +1 -0
- data/utils/QuickCert-1.0.2.tar.gz +0 -0
- data/utils/QuickCert-1.0.2/InstalledFiles +7 -0
- data/utils/QuickCert-1.0.2/MANIFEST +10 -0
- data/utils/QuickCert-1.0.2/Makefile +15 -0
- data/utils/QuickCert-1.0.2/README +56 -0
- data/utils/QuickCert-1.0.2/bin/QuickCert +355 -0
- data/utils/QuickCert-1.0.2/config.save +12 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/README +60 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_c.rb +26 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_s.rb +35 -0
- data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/qc_config +21 -0
- data/utils/QuickCert-1.0.2/lib/QuickCert/defaults.rb +28 -0
- data/utils/QuickCert-1.0.2/setup.rb +1312 -0
- data/utils/iowa_apps +422 -0
- data/utils/smtp_sink.rb +9 -0
- data/utils/startup_template.cnf +27 -0
- data/utils/startup_template.rb +73 -0
- metadata +551 -0
data/utils/iowa_apps
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
#!/usr/local/bin/ruby
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# This script is intended to live in /etc/rc.d/init.d. It provides basic
|
|
5
|
+
# functionality to start, stop, and query the status of your Iowa
|
|
6
|
+
# applications. It was written because I needed to automate the startup
|
|
7
|
+
# and shutdown of my Iowa apps so that I could be sure that they would be
|
|
8
|
+
# shut down cleanly and restarted if a machine were rebooted. Also, on
|
|
9
|
+
# very small servers I like to be able to shut my Iowa apps down and
|
|
10
|
+
# restart them, automatically, via cron at some regular interval, just to
|
|
11
|
+
# be paranoid.
|
|
12
|
+
#
|
|
13
|
+
# This init script depends on a simple configuration file to tell it
|
|
14
|
+
# what apps it needs to deal with. The format of the configuration file
|
|
15
|
+
# is to list the paths to the files to run, one per line.
|
|
16
|
+
# i.e.
|
|
17
|
+
# /usr/local/htdocs/foobar.com/doc/twizzler/twizzler.rb
|
|
18
|
+
# /usr/local/htdocs/dekpr.net/doc/race/go.rb
|
|
19
|
+
#
|
|
20
|
+
# If the above were to appear in the configuration file, it would define
|
|
21
|
+
# two Iowa apps.
|
|
22
|
+
#
|
|
23
|
+
# Supported commands in this script are start, stop, restart, and status.
|
|
24
|
+
#
|
|
25
|
+
# The script was written on a RedHat Linux system, and has only been
|
|
26
|
+
# tested on such a system. It should not be difficult to get it to run
|
|
27
|
+
# on most Unix variants, however.
|
|
28
|
+
#
|
|
29
|
+
# ToDo:
|
|
30
|
+
#
|
|
31
|
+
# * Make sure this script works under Windows?
|
|
32
|
+
#
|
|
33
|
+
|
|
34
|
+
require "rbconfig.rb"
|
|
35
|
+
include Config
|
|
36
|
+
|
|
37
|
+
# If the Sys::ProcTable module is available, we try to use that.
|
|
38
|
+
# You can get Sys::ProcTable here:
|
|
39
|
+
# http://raa.ruby-lang.org/list.rhtml?name=sys-proctable
|
|
40
|
+
|
|
41
|
+
begin
|
|
42
|
+
require 'sys/proctable'
|
|
43
|
+
include Sys
|
|
44
|
+
Has_Sys_ProcTable = true
|
|
45
|
+
rescue LoadError
|
|
46
|
+
Has_Sys_ProcTable = false
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Location in which to find the configuration file.
|
|
50
|
+
|
|
51
|
+
Conf = '/etc/iowa_apps.conf'
|
|
52
|
+
|
|
53
|
+
# The script maintains a PID database of what it has started and what it
|
|
54
|
+
# expects to be running. This is the name of the file used to store that
|
|
55
|
+
# database.
|
|
56
|
+
|
|
57
|
+
PIDdb = '/var/run/iowa/PIDdb'
|
|
58
|
+
|
|
59
|
+
# The directory where the Unix domain Iowa sockets can be found.
|
|
60
|
+
|
|
61
|
+
Socket_dir = '/tmp'
|
|
62
|
+
|
|
63
|
+
# Where the Ruby executable can be found.
|
|
64
|
+
|
|
65
|
+
Ruby_bin = "#{CONFIG["bindir"]}/ruby"
|
|
66
|
+
|
|
67
|
+
# The 'ps' command to use to check for running apps. Make sure that this
|
|
68
|
+
# is correct for your platform if you are not using Sys::ProcTable.
|
|
69
|
+
|
|
70
|
+
PS_command = 'ps auxw --width 500' #Linux & similar using procps
|
|
71
|
+
#PS_command = 'ps -eaf --width 500' #Solaris (& similar?)
|
|
72
|
+
|
|
73
|
+
@socket_list = {}
|
|
74
|
+
@pid_db = {}
|
|
75
|
+
|
|
76
|
+
# Check the process table to see if the various apps are running.
|
|
77
|
+
# If you don't have Sys::ProcTable, 'ps' will be executed and parsed.
|
|
78
|
+
# Make sure you've properly defined the correct 'ps' command for your
|
|
79
|
+
# platform up above.
|
|
80
|
+
|
|
81
|
+
def check_apps
|
|
82
|
+
flag = false
|
|
83
|
+
ps_out = []
|
|
84
|
+
if !Has_Sys_ProcTable
|
|
85
|
+
IO.popen(PS_command).each do |line|
|
|
86
|
+
ps_out.push line
|
|
87
|
+
end
|
|
88
|
+
else
|
|
89
|
+
ProcTable.ps do |ps|
|
|
90
|
+
ps_out.push ps
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
begin
|
|
95
|
+
File.open(Conf,'r').each do |filename|
|
|
96
|
+
filename.chomp!
|
|
97
|
+
|
|
98
|
+
# Skip this app if we were provided with a filepath argument, and this
|
|
99
|
+
# app doesn't match it.
|
|
100
|
+
|
|
101
|
+
next if (ARGV[1].to_s != '' and ARGV[1].to_s != filename)
|
|
102
|
+
if Has_Sys_ProcTable
|
|
103
|
+
ps_out.each do |ps|
|
|
104
|
+
flag = true if (ps.cmdline =~ /ruby\s+#{filename}/)
|
|
105
|
+
end
|
|
106
|
+
else
|
|
107
|
+
ps_out.each do |line|
|
|
108
|
+
flag = true if (line =~ /ruby\s+#{filename}/)
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
rescue Exception
|
|
113
|
+
raise $!
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if (flag)
|
|
117
|
+
raise "Iowa application(s) are already running; can not start application(s)."
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Delete any old socket file. The code tests to see if an old socket file
|
|
122
|
+
# is present, and deletes it if it is.
|
|
123
|
+
|
|
124
|
+
def remove_sockets
|
|
125
|
+
@socket_list.each_value do |socket_name|
|
|
126
|
+
begin
|
|
127
|
+
socket_file = "#{Socket_dir}/#{socket_name}"
|
|
128
|
+
File.delete(socket_file) if FileTest.exist?(socket_file)
|
|
129
|
+
rescue Exception
|
|
130
|
+
puts "Error deleting socket file #{socket_file}:\n#{$!}"
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Start the applications. We make sure they aren't already running,
|
|
136
|
+
# clear any old socket files, and then start each of them, capturing
|
|
137
|
+
# their PIDs as we do so.
|
|
138
|
+
|
|
139
|
+
def start_apps
|
|
140
|
+
check_apps
|
|
141
|
+
remove_sockets
|
|
142
|
+
_start_apps(ARGV[1])
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def _start_apps(appname)
|
|
146
|
+
File.open(Conf,'r').each do |filename|
|
|
147
|
+
process_pid = 0
|
|
148
|
+
filename.chomp!
|
|
149
|
+
next if (appname.to_s != '' and appname.to_s != filename)
|
|
150
|
+
|
|
151
|
+
# Extract the directory that the file is in from the file path.
|
|
152
|
+
# I realize that this won't work, as written, on a Windows box. At
|
|
153
|
+
# the very least one needs to use File::SEPARATOR instead of '/'.
|
|
154
|
+
# I haven't done that, though, because I don't do these things on
|
|
155
|
+
# Windows and really have no idea if Iowa will even work under
|
|
156
|
+
# Windows. It mostly seems like it should, and this script mostly
|
|
157
|
+
# seems like it should, too. If (when?) I confirm this, I'll change
|
|
158
|
+
# this script to work under Windows, as well.
|
|
159
|
+
|
|
160
|
+
filename =~ /^(.*?)\/[^\/]+$/
|
|
161
|
+
executable_directory = $1
|
|
162
|
+
|
|
163
|
+
# An assumption is being made here that, regardless of whether the
|
|
164
|
+
# Iowa app is being started with Iowa.startDaemon or through some
|
|
165
|
+
# other technique, that the code will return a line to STDOUT
|
|
166
|
+
# that contains 'PID 12345' where 12345 is the PID of the daemon
|
|
167
|
+
# process. Once we get that, we can bail out of processing any
|
|
168
|
+
# more of the process output, since we don't care about anything
|
|
169
|
+
# else it might have to say.
|
|
170
|
+
|
|
171
|
+
Dir.chdir executable_directory
|
|
172
|
+
IO.popen("#{Ruby_bin} #{filename}").each do |line|
|
|
173
|
+
if (line =~ /PID\s+(\d+)/)
|
|
174
|
+
process_pid = $1.to_i
|
|
175
|
+
break
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Report back on our STDOUT that the app has been started.
|
|
180
|
+
|
|
181
|
+
puts "Started #{filename} with PID #{process_pid}"
|
|
182
|
+
|
|
183
|
+
# Save the pid info for the app.
|
|
184
|
+
|
|
185
|
+
@pid_db[filename] = process_pid
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Kill the Iowa apps.
|
|
190
|
+
|
|
191
|
+
def stop_apps
|
|
192
|
+
ps_out = []
|
|
193
|
+
if !Has_Sys_ProcTable
|
|
194
|
+
IO.popen(PS_command).each do |line|
|
|
195
|
+
ps_out.push line
|
|
196
|
+
end
|
|
197
|
+
else
|
|
198
|
+
ProcTable.ps do |ps|
|
|
199
|
+
ps_out.push ps
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
File.open(Conf,'r').each do |filename|
|
|
204
|
+
filename.chomp!
|
|
205
|
+
next if (ARGV[1].to_s != '' and ARGV[1].to_s != filename)
|
|
206
|
+
pid_to_kill = 0
|
|
207
|
+
|
|
208
|
+
# First we check to see if we have mention of the app in the PID
|
|
209
|
+
# database. Normally, we should. If we don't have mention of the
|
|
210
|
+
# app in the PID database, then the process table must be searched
|
|
211
|
+
# to attempt to find the app and it's PID so that we have something
|
|
212
|
+
# to kill.
|
|
213
|
+
|
|
214
|
+
if ((@pid_db[filename].to_i || 0) > 0)
|
|
215
|
+
pid_to_kill = @pid_db[filename].to_i
|
|
216
|
+
else
|
|
217
|
+
if Has_Sys_ProcTable
|
|
218
|
+
ps_out.each do |ps|
|
|
219
|
+
if (ps.cmdline =~ /ruby\s+#{filename}\s*$/)
|
|
220
|
+
pid_to_kill = ps.pid.to_i
|
|
221
|
+
break
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
else
|
|
225
|
+
ps_out.each do |line|
|
|
226
|
+
if (line =~ /ruby\s+#{filename}\s*$/)
|
|
227
|
+
line =~ /^\S+\s+(\d+)/
|
|
228
|
+
pid_to_kill = $1.to_i
|
|
229
|
+
break
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Make sure that a PID to kill was found. This is paranoia in case
|
|
236
|
+
# the app were killed manually or died unexpectedly at some point.
|
|
237
|
+
# it'd be a real bummer to kill someone's shell session just because
|
|
238
|
+
# they had the dumb luck to inherit a PID number that used to belong
|
|
239
|
+
# to an Iowa app.
|
|
240
|
+
|
|
241
|
+
k = false
|
|
242
|
+
if (pid_to_kill > 0)
|
|
243
|
+
begin
|
|
244
|
+
Process.kill('SIGTERM',pid_to_kill)
|
|
245
|
+
k = true
|
|
246
|
+
rescue Exception
|
|
247
|
+
puts "Error killing PID #{pid_to_kill} (#{filename})"
|
|
248
|
+
end
|
|
249
|
+
puts "Stopped PID #{pid_to_kill} (#{filename})" if k
|
|
250
|
+
else
|
|
251
|
+
puts "Warning: Can't find a PID for #{filename}"
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
@pid_db.delete filename if k
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Check the process table to see if the defined apps are running or not.
|
|
259
|
+
# If monitor_flag is true, then status_apps will issue a restart command
|
|
260
|
+
# for any non-running apps that it finds.
|
|
261
|
+
|
|
262
|
+
def status_apps(monitor_flag)
|
|
263
|
+
ps_out = []
|
|
264
|
+
if !Has_Sys_ProcTable
|
|
265
|
+
IO.popen(PS_command).each do |line|
|
|
266
|
+
ps_out.push line
|
|
267
|
+
end
|
|
268
|
+
else
|
|
269
|
+
ProcTable.ps do |ps|
|
|
270
|
+
ps_out.push ps
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
File.open(Conf,'r').each do |filename|
|
|
275
|
+
filename.chomp!
|
|
276
|
+
next if (ARGV[1].to_s != '' and ARGV[1].to_s != filename)
|
|
277
|
+
pid_should_be = @pid_db[filename] || -2
|
|
278
|
+
pid_match = catch (:done) do
|
|
279
|
+
if Has_Sys_ProcTable
|
|
280
|
+
ps_out.each do |ps|
|
|
281
|
+
if ((ps.pid.to_s == pid_should_be.to_s) and
|
|
282
|
+
(ps.cmdline =~ /ruby\s+#{filename}/))
|
|
283
|
+
throw :done, pid_should_be
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
-1
|
|
287
|
+
else
|
|
288
|
+
ps_out.each do |line|
|
|
289
|
+
if (line =~ /^\S+\s+#{pid_should_be}.*ruby\s+#{filename}/)
|
|
290
|
+
throw :done,pid_should_be
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
-1
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# Normally, all of the PIDs in the PID database should exist.
|
|
298
|
+
# If the process is found to be running at the expecte PID,
|
|
299
|
+
# it is reported as running.
|
|
300
|
+
# If it is not found running at the expecte PID, but an apparent match
|
|
301
|
+
# to the app can be found in the process table under another PID,
|
|
302
|
+
# it is reported as "apparently" running.
|
|
303
|
+
# And if no match can be found at all, it is reported as not running.
|
|
304
|
+
|
|
305
|
+
if (pid_should_be == pid_match)
|
|
306
|
+
puts "#{filename} RUNNING with PID #{pid_should_be}"
|
|
307
|
+
else
|
|
308
|
+
pid_match = catch (:done) do
|
|
309
|
+
if Has_Sys_ProcTable
|
|
310
|
+
ps_out.each do |ps|
|
|
311
|
+
if (ps.cmdline =~ /ruby\s+#{filename}/)
|
|
312
|
+
throw :done, ps.pid.to_i
|
|
313
|
+
end
|
|
314
|
+
end
|
|
315
|
+
-1
|
|
316
|
+
else
|
|
317
|
+
ps_out.each do |line|
|
|
318
|
+
if (line =~ /^\S+\s+(\d+).*ruby\s+#{filename}\s*$/)
|
|
319
|
+
m = $1.to_i
|
|
320
|
+
throw :done,m
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
-1
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
if (pid_match > -1)
|
|
328
|
+
puts "#{filename} apparently RUNNING with PID #{pid_match}"
|
|
329
|
+
else
|
|
330
|
+
if monitor_flag
|
|
331
|
+
puts "#{filename} NOT RUNNING; restarting..."
|
|
332
|
+
_start_apps filename
|
|
333
|
+
else
|
|
334
|
+
puts "#{filename} NOT RUNNING"
|
|
335
|
+
end
|
|
336
|
+
end
|
|
337
|
+
end
|
|
338
|
+
end
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
# Here's where the execution actually starts.
|
|
342
|
+
|
|
343
|
+
begin
|
|
344
|
+
File.open(Conf,'r') do |conf_file|
|
|
345
|
+
conf_file.each do |filename|
|
|
346
|
+
begin
|
|
347
|
+
filename.chomp!
|
|
348
|
+
|
|
349
|
+
##### BROKEN #####
|
|
350
|
+
###
|
|
351
|
+
### Socket now defined in a config file, and can be a port
|
|
352
|
+
### number instead of a filename.
|
|
353
|
+
#####
|
|
354
|
+
# Since the actual name of an Iowa app is unique on a given
|
|
355
|
+
# system because the socket name is based off of the app name,
|
|
356
|
+
# the code parses the file for the Iowa.run() invocation,
|
|
357
|
+
# and then extracts the app name from it.
|
|
358
|
+
# This works, but I'm not sure I like it as it depends on
|
|
359
|
+
# the app name always being declared statically within the
|
|
360
|
+
# code. This will probably change. Odds are that I will
|
|
361
|
+
# make the app name an additional data item stored in the
|
|
362
|
+
# configuration file.
|
|
363
|
+
|
|
364
|
+
File.open("#{filename}",'r').each do |line|
|
|
365
|
+
if (line =~ /Iowa.run\('([^']+)'\)/)
|
|
366
|
+
app_name = $1
|
|
367
|
+
socket_name = "iowa_#{app_name}"
|
|
368
|
+
@socket_list[app_name] = socket_name
|
|
369
|
+
end
|
|
370
|
+
end
|
|
371
|
+
rescue Exception
|
|
372
|
+
raise $!
|
|
373
|
+
end
|
|
374
|
+
end
|
|
375
|
+
end
|
|
376
|
+
rescue Exception
|
|
377
|
+
raise $!
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
# If the PID db file doesn't exist, we create it.
|
|
381
|
+
|
|
382
|
+
unless (FileTest.exists? PIDdb)
|
|
383
|
+
File.open(PIDdb,'w') do |pid_file|
|
|
384
|
+
pid_file.syswrite Marshal.dump(@pid_db)
|
|
385
|
+
end
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
# Make sure that the database file can be read.
|
|
389
|
+
|
|
390
|
+
unless (FileTest.readable? PIDdb)
|
|
391
|
+
raise "The PID database file, #{PIDdb} is not readable."
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
File.open(PIDdb,'r') do |pid_file|
|
|
395
|
+
data = pid_file.read
|
|
396
|
+
@pid_db = Marshal.load(data)
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
# Now figure out what we are being asked to do.
|
|
400
|
+
|
|
401
|
+
case ARGV[0]
|
|
402
|
+
when /restart/i
|
|
403
|
+
stop_apps
|
|
404
|
+
start_apps
|
|
405
|
+
when /start/i
|
|
406
|
+
start_apps
|
|
407
|
+
when /stop/i
|
|
408
|
+
stop_apps
|
|
409
|
+
when /status/i
|
|
410
|
+
status_apps false
|
|
411
|
+
when /monitor/i
|
|
412
|
+
status_apps true
|
|
413
|
+
else
|
|
414
|
+
puts "I don't understand what you want"
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
# And finally, write the pid db back out to a file.
|
|
418
|
+
|
|
419
|
+
File.open(PIDdb,'w') do |pid_file|
|
|
420
|
+
pid_file.syswrite Marshal.dump(@pid_db)
|
|
421
|
+
end
|
|
422
|
+
|
data/utils/smtp_sink.rb
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
socket:
|
|
2
|
+
hostname: localhost
|
|
3
|
+
port: 9876
|
|
4
|
+
logging:
|
|
5
|
+
basedir: /var/log/iowa/myapp
|
|
6
|
+
minlevel: 0
|
|
7
|
+
maxsize: 10000000
|
|
8
|
+
maxage: 86400
|
|
9
|
+
application:
|
|
10
|
+
daemonize: false
|
|
11
|
+
sessioncache:
|
|
12
|
+
class: LRUCache
|
|
13
|
+
maxsize: 200
|
|
14
|
+
ttl: 3600
|
|
15
|
+
dispatcher:
|
|
16
|
+
class: StandardDispatcher
|
|
17
|
+
mapfile: dispatcher.map
|
|
18
|
+
policy:
|
|
19
|
+
class: iowa/Policy
|
|
20
|
+
database:
|
|
21
|
+
vendor: Mysql
|
|
22
|
+
host: localhost
|
|
23
|
+
database: foo
|
|
24
|
+
user: bar
|
|
25
|
+
password: mylittlepony
|
|
26
|
+
connections: 2
|
|
27
|
+
monitor_interval: 300
|