IOWA 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -0,0 +1,28 @@
|
|
1
|
+
Iowa::LinkedList is copyrighted free software by Kirk Haines <khaines@enigo.com>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the GPL
|
3
|
+
version 2 (see the file GPL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a) place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c) give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d) make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
26
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
27
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
28
|
+
PURPOSE.
|
@@ -0,0 +1,608 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'optparse'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
class String
|
7
|
+
# This patch for win32 paths contributed by James Britt.
|
8
|
+
def w32
|
9
|
+
if self =~ /^\w:\/\w:/i
|
10
|
+
self.gsub(/^\w:\//i, '')
|
11
|
+
else
|
12
|
+
self
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
module Package
|
18
|
+
|
19
|
+
class SpecificationError < StandardError; end
|
20
|
+
class PackageSpecification_1_0; end
|
21
|
+
|
22
|
+
SEMANTICS = { "1.0" => PackageSpecification_1_0 }
|
23
|
+
|
24
|
+
KINDS = [
|
25
|
+
:bin, :lib, :ext, :data, :conf, :doc
|
26
|
+
]
|
27
|
+
|
28
|
+
mapping = { '.' => '\.', '$' => '\$', '#' => '\#', '*' => '.*' }
|
29
|
+
ignore_files = %w[core RCSLOG tags TAGS .make.state .nse_depinfo .hg
|
30
|
+
#* .#* cvslog.* ,* .del-* *.olb *~ *.old *.bak *.BAK *.orig *.rej _$* *$
|
31
|
+
*.org *.in .* ]
|
32
|
+
|
33
|
+
IGNORE_FILES = ignore_files.map do |x|
|
34
|
+
Regexp.new('\A' + x.gsub(/[\.\$\#\*]/){|c| mapping[c]} + '\z')
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.config(name)
|
38
|
+
# XXX use pathname
|
39
|
+
prefix = Regexp.quote(Config::CONFIG["prefix"])
|
40
|
+
exec_prefix = Regexp.quote(Config::CONFIG["exec_prefix"])
|
41
|
+
Config::CONFIG[name].gsub(/\A\/?(#{prefix}|#{exec_prefix})\/?/, '')
|
42
|
+
end
|
43
|
+
|
44
|
+
SITE_DIRS = {
|
45
|
+
:bin => config("bindir"),
|
46
|
+
:lib => config("sitelibdir"),
|
47
|
+
:ext => config("sitearchdir"),
|
48
|
+
:data => config("datadir"),
|
49
|
+
:conf => config("sysconfdir"),
|
50
|
+
:doc => File.join(config("datadir"), "doc"),
|
51
|
+
}
|
52
|
+
|
53
|
+
VENDOR_DIRS = {
|
54
|
+
:bin => config("bindir"),
|
55
|
+
:lib => config("rubylibdir"),
|
56
|
+
:ext => config("archdir"),
|
57
|
+
:data => config("datadir"),
|
58
|
+
:conf => config("sysconfdir"),
|
59
|
+
:doc => File.join(config("datadir"), "doc"),
|
60
|
+
}
|
61
|
+
|
62
|
+
MODES = {
|
63
|
+
:bin => 0755,
|
64
|
+
:lib => 0644,
|
65
|
+
:ext => 0755, # was: 0555,
|
66
|
+
:data => 0644,
|
67
|
+
:conf => 0644,
|
68
|
+
:doc => 0644,
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
SETUP_OPTIONS = {:parse_cmdline => true, :load_conf => true, :run_tasks => true}
|
73
|
+
|
74
|
+
def self.setup(version, options = {}, &instructions)
|
75
|
+
prefixes = dirs = nil
|
76
|
+
options = SETUP_OPTIONS.dup.update(options)
|
77
|
+
|
78
|
+
if options[:load_conf] && File.exist?("config.save")
|
79
|
+
config = YAML.load_file "config.save"
|
80
|
+
prefixes = config[:prefixes]
|
81
|
+
dirs = config[:dirs]
|
82
|
+
end
|
83
|
+
|
84
|
+
pkg = package_specification_with_semantics(version).new(prefixes, dirs)
|
85
|
+
pkg.parse_command_line if options[:parse_cmdline]
|
86
|
+
pkg.instance_eval(&instructions)
|
87
|
+
|
88
|
+
pkg.run_tasks if options[:run_tasks]
|
89
|
+
|
90
|
+
# pkg.install
|
91
|
+
pkg
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.package_specification_with_semantics(version)
|
95
|
+
#XXX: implement the full x.y(.z)? semantics
|
96
|
+
r = SEMANTICS[version]
|
97
|
+
raise SpecificationError, "Unknown version #{version}." unless r
|
98
|
+
r
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
module Actions
|
103
|
+
|
104
|
+
class InstallFile
|
105
|
+
|
106
|
+
attr_reader :source, :destination, :mode
|
107
|
+
|
108
|
+
def initialize(source, destination, mode, options)
|
109
|
+
@source = source
|
110
|
+
@destination = destination
|
111
|
+
@mode = mode
|
112
|
+
@options = options
|
113
|
+
end
|
114
|
+
|
115
|
+
def install
|
116
|
+
dirs = [@options.destdir.to_s, @destination].select {|x| x}
|
117
|
+
d = File.expand_path(File.join(dirs)).w32
|
118
|
+
FileUtils.install @source, d,
|
119
|
+
{:verbose => @options.verbose,
|
120
|
+
:noop => @options.noop, :mode => @mode }
|
121
|
+
end
|
122
|
+
|
123
|
+
def hash
|
124
|
+
[@source.hash, @destination.hash].hash
|
125
|
+
end
|
126
|
+
|
127
|
+
def eql?(other)
|
128
|
+
self.class == other.class &&
|
129
|
+
@source == other.source &&
|
130
|
+
@destination == other.destination &&
|
131
|
+
@mode == other.mode
|
132
|
+
end
|
133
|
+
|
134
|
+
def <=>(other)
|
135
|
+
FULL_ORDER[self, other] || self.destination <=> other.destination
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
class MkDir
|
140
|
+
|
141
|
+
attr_reader :directory
|
142
|
+
|
143
|
+
def initialize(directory, options)
|
144
|
+
@directory = directory
|
145
|
+
@options = options
|
146
|
+
end
|
147
|
+
|
148
|
+
def install
|
149
|
+
dirs = [@options.destdir.to_s, @directory].select {|x| x}
|
150
|
+
d = File.expand_path(File.join(dirs)).w32
|
151
|
+
FileUtils.mkdir_p d,
|
152
|
+
{:verbose => @options.verbose,
|
153
|
+
:noop => @options.noop }
|
154
|
+
end
|
155
|
+
|
156
|
+
def <=>(other)
|
157
|
+
FULL_ORDER[self, other] || self.directory <=> other.directory
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
class FixShebang
|
162
|
+
|
163
|
+
attr_reader :destination
|
164
|
+
|
165
|
+
def initialize(destination, options)
|
166
|
+
@options = options
|
167
|
+
@destination = destination
|
168
|
+
end
|
169
|
+
|
170
|
+
def install
|
171
|
+
dirs = [@options.destdir.to_s, @destination].select {|x| x}
|
172
|
+
d = File.expand_path(File.join(dirs)).w32
|
173
|
+
path = d
|
174
|
+
fix_shebang(path)
|
175
|
+
end
|
176
|
+
|
177
|
+
# taken from rpa-base, originally based on setup.rb's
|
178
|
+
# modify: #!/usr/bin/ruby
|
179
|
+
# modify: #! /usr/bin/ruby
|
180
|
+
# modify: #!ruby
|
181
|
+
# not modify: #!/usr/bin/env ruby
|
182
|
+
SHEBANG_RE = /\A\#!\s*\S*ruby\S*/
|
183
|
+
|
184
|
+
#TODO allow the ruby-prog to be placed in the shebang line to be passed as
|
185
|
+
# an option
|
186
|
+
def fix_shebang(path)
|
187
|
+
tmpfile = path + '.tmp'
|
188
|
+
begin
|
189
|
+
#XXX: needed at all?
|
190
|
+
# it seems that FileUtils doesn't expose its default output
|
191
|
+
# @fileutils_output = $stderr
|
192
|
+
# we might want to allow this to be redirected.
|
193
|
+
$stderr.puts "shebang:open #{tmpfile}" if @options.verbose
|
194
|
+
unless @options.noop
|
195
|
+
File.open(path) do |r|
|
196
|
+
File.open(tmpfile, 'w', 0755) do |w|
|
197
|
+
first = r.gets
|
198
|
+
return unless SHEBANG_RE =~ first
|
199
|
+
w.print first.sub(SHEBANG_RE, '#!' + Config::CONFIG['ruby-prog'])
|
200
|
+
w.write r.read
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
FileUtils.mv(tmpfile, path, :verbose => @options.verbose,
|
205
|
+
:noop => @options.noop)
|
206
|
+
ensure
|
207
|
+
FileUtils.rm_f(tmpfile, :verbose => @options.verbose,
|
208
|
+
:noop => @options.noop)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
def <=>(other)
|
213
|
+
FULL_ORDER[self, other] || self.destination <=> other.destination
|
214
|
+
end
|
215
|
+
|
216
|
+
def hash
|
217
|
+
@destination.hash
|
218
|
+
end
|
219
|
+
|
220
|
+
def eql?(other)
|
221
|
+
self.class == other.class && self.destination == other.destination
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
order = [MkDir, InstallFile, FixShebang]
|
226
|
+
FULL_ORDER = lambda do |me, other|
|
227
|
+
a, b = order.index(me.class), order.index(other.class)
|
228
|
+
if a && b
|
229
|
+
(r = a - b) == 0 ? nil : r
|
230
|
+
else
|
231
|
+
-1 # arbitrary
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
class ActionList < Array
|
236
|
+
|
237
|
+
def directories!(options)
|
238
|
+
dirnames = []
|
239
|
+
map! { |d|
|
240
|
+
if d.kind_of?(InstallFile) && !dirnames.include?(File.dirname(d.destination))
|
241
|
+
dirnames << File.dirname(d.destination)
|
242
|
+
[MkDir.new(File.dirname(d.destination), options), d]
|
243
|
+
else
|
244
|
+
d
|
245
|
+
end
|
246
|
+
}
|
247
|
+
flatten!
|
248
|
+
end
|
249
|
+
|
250
|
+
def run(task)
|
251
|
+
each { |action| action.__send__ task }
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
end # module Actions
|
256
|
+
|
257
|
+
Options = Struct.new(:noop, :verbose, :destdir)
|
258
|
+
|
259
|
+
class PackageSpecification_1_0
|
260
|
+
|
261
|
+
TASKS = %w[config setup install test show]
|
262
|
+
# default options for translate(foo => bar)
|
263
|
+
TRANSLATE_DEFAULT_OPTIONS = { :inherit => true }
|
264
|
+
|
265
|
+
def self.declare_file_type(args, &handle_arg)
|
266
|
+
str_arr_p = lambda{|x| Array === x && x.all?{|y| String === y}}
|
267
|
+
|
268
|
+
# strict type checking --- we don't want this to be extended arbitrarily
|
269
|
+
unless args.size == 1 && Hash === args.first &&
|
270
|
+
args.first.all?{|f,r| [Proc, String, NilClass].include?(r.class) &&
|
271
|
+
(String === f || str_arr_p[f])} or
|
272
|
+
args.all?{|x| String === x || str_arr_p[x]}
|
273
|
+
raise SpecificationError,
|
274
|
+
"Unspecified semantics for the given arguments: #{args.inspect}"
|
275
|
+
end
|
276
|
+
|
277
|
+
if args.size == 1 && Hash === args.first
|
278
|
+
args.first.to_a.each do |file, rename_info|
|
279
|
+
if Array === file
|
280
|
+
# ignoring boring files
|
281
|
+
handle_arg.call(file, true, rename_info)
|
282
|
+
else
|
283
|
+
# we do want "boring" files given explicitly
|
284
|
+
handle_arg.call([file], false, rename_info)
|
285
|
+
end
|
286
|
+
end
|
287
|
+
else
|
288
|
+
args.each do |a|
|
289
|
+
if Array === a
|
290
|
+
a.each{|file| handle_arg.call(file, true, nil)}
|
291
|
+
else
|
292
|
+
handle_arg.call(a, false, nil)
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
#{{{ define the file tagging methods
|
299
|
+
KINDS.each { |kind|
|
300
|
+
define_method(kind) { |*args| # if this were 1.9 we could also take a block
|
301
|
+
bin_callback = lambda do |kind_, type, dest, options|
|
302
|
+
next if kind_ != :bin || type == :dir
|
303
|
+
@actions << Actions::FixShebang.new(dest, options)
|
304
|
+
end
|
305
|
+
#TODO: refactor
|
306
|
+
self.class.declare_file_type(args) do |files, ignore_p, opt_rename_info|
|
307
|
+
files.each do |file|
|
308
|
+
next if ignore_p && IGNORE_FILES.any?{|re| re.match(file)}
|
309
|
+
add_file(kind, file, opt_rename_info, &bin_callback)
|
310
|
+
end
|
311
|
+
end
|
312
|
+
}
|
313
|
+
}
|
314
|
+
|
315
|
+
def unit_test(*files)
|
316
|
+
@unit_tests.concat files.flatten
|
317
|
+
end
|
318
|
+
|
319
|
+
def ri(*files)
|
320
|
+
@ri_files.concat files.flatten
|
321
|
+
end
|
322
|
+
|
323
|
+
attr_accessor :actions, :options
|
324
|
+
|
325
|
+
def self.metadata(name)
|
326
|
+
define_method(name) { |*args|
|
327
|
+
if args.size == 1
|
328
|
+
@metadata[name] = args.first
|
329
|
+
end
|
330
|
+
@metadata[name]
|
331
|
+
}
|
332
|
+
end
|
333
|
+
|
334
|
+
metadata :name
|
335
|
+
metadata :version
|
336
|
+
metadata :author
|
337
|
+
|
338
|
+
|
339
|
+
def translate_dir(kind, dir)
|
340
|
+
replaced_dir_parts = dir.split(%r{/})
|
341
|
+
kept_dir_parts = []
|
342
|
+
loop do
|
343
|
+
replaced_path = replaced_dir_parts.join("/")
|
344
|
+
target, options = @translate[kind][replaced_path]
|
345
|
+
options ||= TRANSLATE_DEFAULT_OPTIONS
|
346
|
+
if target && (replaced_path == dir || options[:inherit])
|
347
|
+
dir = (target != '' ? File.join(target, *kept_dir_parts) :
|
348
|
+
File.join(*kept_dir_parts))
|
349
|
+
break
|
350
|
+
end
|
351
|
+
break if replaced_dir_parts.empty?
|
352
|
+
kept_dir_parts.unshift replaced_dir_parts.pop
|
353
|
+
end
|
354
|
+
dir
|
355
|
+
end
|
356
|
+
|
357
|
+
def add_file(kind, filename, new_filename_info, &callback)
|
358
|
+
#TODO: refactor!!!
|
359
|
+
if File.directory? filename #XXX setup.rb and rpa-base defined File.dir?
|
360
|
+
# to cope with some win32 issue
|
361
|
+
dir = filename.sub(/\A\.\//, "").sub(/\/\z/, "")
|
362
|
+
dest = File.join(@prefixes[kind], @dirs[kind], translate_dir(kind, dir))
|
363
|
+
@actions << Actions::MkDir.new(dest, @options)
|
364
|
+
callback.call(kind, :dir, dest, @options) if block_given?
|
365
|
+
else
|
366
|
+
if new_filename_info
|
367
|
+
case new_filename_info
|
368
|
+
when Proc
|
369
|
+
dest_name = new_filename_info.call(filename.dup)
|
370
|
+
else
|
371
|
+
dest_name = new_filename_info.dup
|
372
|
+
end
|
373
|
+
else
|
374
|
+
dest_name = filename.dup
|
375
|
+
end
|
376
|
+
|
377
|
+
dirname = File.dirname(dest_name)
|
378
|
+
dirname = "" if dirname == "."
|
379
|
+
dest_name = File.join(translate_dir(kind, dirname), File.basename(dest_name))
|
380
|
+
|
381
|
+
dest = File.join(@prefixes[kind], @dirs[kind], dest_name)
|
382
|
+
@actions << Actions::InstallFile.new(filename, dest, MODES[kind], @options)
|
383
|
+
callback.call(kind, :file, dest, @options) if block_given?
|
384
|
+
end
|
385
|
+
end
|
386
|
+
|
387
|
+
def initialize(prefixes = nil, dirs = nil)
|
388
|
+
@prefix = Config::CONFIG["prefix"].gsub(/\A\//, '')
|
389
|
+
@translate = {}
|
390
|
+
@prefixes = (prefixes || {}).dup
|
391
|
+
KINDS.each { |kind|
|
392
|
+
@prefixes[kind] = @prefix unless prefixes
|
393
|
+
@translate[kind] = {}
|
394
|
+
}
|
395
|
+
|
396
|
+
@dirs = (dirs || {}).dup
|
397
|
+
@dirs.update SITE_DIRS unless dirs
|
398
|
+
|
399
|
+
@actions = Actions::ActionList.new
|
400
|
+
|
401
|
+
@metadata = {}
|
402
|
+
@unit_tests = []
|
403
|
+
@ri_files = []
|
404
|
+
|
405
|
+
@options = Options.new
|
406
|
+
@options.verbose = true
|
407
|
+
@options.noop = false # XXX for testing
|
408
|
+
@options.destdir = ''
|
409
|
+
|
410
|
+
@tasks = []
|
411
|
+
end
|
412
|
+
|
413
|
+
def aoki
|
414
|
+
(KINDS - [:ext]).each { |kind|
|
415
|
+
translate(kind, kind.to_s => "", :inherit => true)
|
416
|
+
__send__ kind, Dir["#{kind}/**/*"]
|
417
|
+
}
|
418
|
+
translate(:ext, "ext/*" => "", :inherit => true)
|
419
|
+
ext Dir["ext/**/*.#{Config::CONFIG['DLEXT']}"]
|
420
|
+
end
|
421
|
+
|
422
|
+
def install
|
423
|
+
$stderr.puts "Installing #{name || "unknown package"} #{version}..." if options.verbose
|
424
|
+
|
425
|
+
actions.uniq!
|
426
|
+
actions.sort!
|
427
|
+
actions.directories!(options)
|
428
|
+
|
429
|
+
actions.run :install
|
430
|
+
|
431
|
+
unless @ri_files.empty?
|
432
|
+
$stderr.puts "Generating ri documentation from #{@ri_files.join(',')}"
|
433
|
+
require 'rdoc/rdoc'
|
434
|
+
unless options.noop
|
435
|
+
begin
|
436
|
+
RDoc::RDoc.new.document(["--ri-site"].concat(@ri_files.flatten))
|
437
|
+
rescue Exception => e
|
438
|
+
$stderr.write("Installation of ri documentation failed: #{e.to_s} #{e.backtrace.join("\n")}")
|
439
|
+
end
|
440
|
+
end
|
441
|
+
end
|
442
|
+
end
|
443
|
+
|
444
|
+
def test
|
445
|
+
unless @unit_tests.empty?
|
446
|
+
puts "Testing #{name || "unknown package"} #{version}..." if options.verbose
|
447
|
+
require 'test/unit'
|
448
|
+
unless options.noop
|
449
|
+
t = Test::Unit::AutoRunner.new(true)
|
450
|
+
t.process_args(@unit_tests)
|
451
|
+
#t.process_args(['test/TC_AppConfig.rb','TC_ISAAC.rb'])
|
452
|
+
t.run
|
453
|
+
end
|
454
|
+
end
|
455
|
+
end
|
456
|
+
|
457
|
+
def config
|
458
|
+
File.open("config.save", "w") { |f|
|
459
|
+
YAML.dump({:prefixes => @prefixes, :dirs => @dirs}, f)
|
460
|
+
}
|
461
|
+
end
|
462
|
+
|
463
|
+
def show
|
464
|
+
KINDS.each { |kind|
|
465
|
+
puts "#{kind}\t#{File.join(options.destdir, @prefixes[kind], @dirs[kind])}"
|
466
|
+
}
|
467
|
+
end
|
468
|
+
|
469
|
+
def translate(kind, additional_translations)
|
470
|
+
default_opts = TRANSLATE_DEFAULT_OPTIONS.dup
|
471
|
+
key_val_pairs = additional_translations.to_a
|
472
|
+
option_pairs = key_val_pairs.select{|(k,v)| Symbol === k}
|
473
|
+
default_opts.update(Hash[*option_pairs.flatten])
|
474
|
+
|
475
|
+
(key_val_pairs - option_pairs).each do |key, val|
|
476
|
+
add_translation(kind, key, val, default_opts)
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
480
|
+
def add_translation(kind, src, dest, options)
|
481
|
+
if is_glob?(src)
|
482
|
+
dirs = expand_dir_glob(src)
|
483
|
+
else
|
484
|
+
dirs = [src]
|
485
|
+
end
|
486
|
+
dirs.each do |dirname|
|
487
|
+
dirname = dirname.sub(%r{\A\./}, "").sub(%r{/\z}, "")
|
488
|
+
@translate[kind].update({dirname => [dest, options]})
|
489
|
+
end
|
490
|
+
end
|
491
|
+
|
492
|
+
def is_glob?(x)
|
493
|
+
/(^|[^\\])[*?{\[]/.match(x)
|
494
|
+
end
|
495
|
+
|
496
|
+
def expand_dir_glob(src)
|
497
|
+
Dir[src].select{|x| File.directory?(x)}
|
498
|
+
end
|
499
|
+
|
500
|
+
def clean_path(path)
|
501
|
+
path.gsub(/\A\//, '').gsub(/\/+\Z/, '').squeeze("/")
|
502
|
+
end
|
503
|
+
|
504
|
+
def parse_command_line
|
505
|
+
opts = OptionParser.new(nil, 24, ' ') { |opts|
|
506
|
+
opts.banner = "Usage: setup.rb [options] [task]"
|
507
|
+
|
508
|
+
opts.separator ""
|
509
|
+
opts.separator "Tasks:"
|
510
|
+
opts.separator " config configures paths"
|
511
|
+
opts.separator " show shows paths"
|
512
|
+
opts.separator " setup compiles ruby extentions and others XXX"
|
513
|
+
opts.separator " install installs files"
|
514
|
+
opts.separator " test runs unit tests"
|
515
|
+
|
516
|
+
|
517
|
+
opts.separator ""
|
518
|
+
opts.separator "Specific options:"
|
519
|
+
|
520
|
+
opts.on "--prefix=PREFIX",
|
521
|
+
"path prefix of target environment [#@prefix]" do |prefix|
|
522
|
+
@prefix.replace clean_path(prefix) # Shared!
|
523
|
+
end
|
524
|
+
|
525
|
+
opts.separator ""
|
526
|
+
|
527
|
+
KINDS.each { |kind|
|
528
|
+
opts.on "--#{kind}prefix=PREFIX",
|
529
|
+
"path prefix for #{kind} files [#{@prefixes[kind]}]" do |prefix|
|
530
|
+
@prefixes[kind] = clean_path(prefix)
|
531
|
+
end
|
532
|
+
}
|
533
|
+
|
534
|
+
opts.separator ""
|
535
|
+
|
536
|
+
KINDS.each { |kind|
|
537
|
+
opts.on "--#{kind}dir=PREFIX",
|
538
|
+
"directory for #{kind} files [#{@dirs[kind]}]" do |prefix|
|
539
|
+
@dirs[kind] = clean_path(prefix)
|
540
|
+
end
|
541
|
+
}
|
542
|
+
|
543
|
+
opts.separator ""
|
544
|
+
|
545
|
+
KINDS.each { |kind|
|
546
|
+
opts.on "--#{kind}=PREFIX",
|
547
|
+
"absolute directory for #{kind} files [#{File.join(@prefixes[kind], @dirs[kind])}]" do |prefix|
|
548
|
+
@prefixes[kind] = clean_path(prefix)
|
549
|
+
end
|
550
|
+
}
|
551
|
+
|
552
|
+
opts.separator ""
|
553
|
+
opts.separator "Predefined path configurations:"
|
554
|
+
opts.on "--site", "install into site-local directories (default)" do
|
555
|
+
@dirs.update SITE_DIRS
|
556
|
+
end
|
557
|
+
|
558
|
+
opts.on "--vendor", "install into distribution directories (for packagers)" do
|
559
|
+
@dirs.update VENDOR_DIRS
|
560
|
+
end
|
561
|
+
|
562
|
+
opts.separator ""
|
563
|
+
opts.separator "General options:"
|
564
|
+
|
565
|
+
opts.on "--destdir=DESTDIR",
|
566
|
+
"install all files relative to DESTDIR (/)" do |destdir|
|
567
|
+
@options.destdir = destdir
|
568
|
+
end
|
569
|
+
|
570
|
+
opts.on "--dry-run", "only display what to do if given [#{@options.noop}]" do
|
571
|
+
@options.noop = true
|
572
|
+
end
|
573
|
+
|
574
|
+
opts.on "--no-harm", "only display what to do if given" do
|
575
|
+
@options.noop = true
|
576
|
+
end
|
577
|
+
|
578
|
+
opts.on "--[no-]verbose", "output messages verbosely [#{@options.verbose}]" do |verbose|
|
579
|
+
@options.verbose = verbose
|
580
|
+
end
|
581
|
+
|
582
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
583
|
+
puts opts
|
584
|
+
exit
|
585
|
+
end
|
586
|
+
}
|
587
|
+
|
588
|
+
opts.parse! ARGV
|
589
|
+
|
590
|
+
if (ARGV - TASKS).empty? # Only existing tasks?
|
591
|
+
@tasks = ARGV
|
592
|
+
@tasks = ["install"] if @tasks.empty?
|
593
|
+
else
|
594
|
+
abort "Unknown task(s) #{(ARGV-TASKS).join ", "}."
|
595
|
+
end
|
596
|
+
end
|
597
|
+
|
598
|
+
def run_tasks
|
599
|
+
@tasks.each { |task| __send__ task }
|
600
|
+
end
|
601
|
+
end
|
602
|
+
|
603
|
+
end # module Package
|
604
|
+
|
605
|
+
require 'rbconfig'
|
606
|
+
def config(x)
|
607
|
+
Config::CONFIG[x]
|
608
|
+
end
|