rufus-lua-win 5.1.5
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/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +69 -0
- data/Rakefile +1 -0
- data/lib/rufus/lua/win.rb +18 -0
- data/lib/rufus/lua/win/version.rb +7 -0
- data/rufus-lua-win.gemspec +23 -0
- data/vendor/lua/bin/liblua.dll +0 -0
- data/vendor/lua/lib/lua/LuaXml.lua +119 -0
- data/vendor/lua/lib/lua/alien.lua +250 -0
- data/vendor/lua/lib/lua/alien/core.dll +0 -0
- data/vendor/lua/lib/lua/alien/struct.dll +0 -0
- data/vendor/lua/lib/lua/base.lua +536 -0
- data/vendor/lua/lib/lua/bin.lua +20 -0
- data/vendor/lua/lib/lua/bit.dll +0 -0
- data/vendor/lua/lib/lua/cdlua.dll +0 -0
- data/vendor/lua/lib/lua/cdluacontextplus.dll +0 -0
- data/vendor/lua/lib/lua/cdluagl.dll +0 -0
- data/vendor/lua/lib/lua/cdluaim.dll +0 -0
- data/vendor/lua/lib/lua/cdluapdf.dll +0 -0
- data/vendor/lua/lib/lua/copas.lua +543 -0
- data/vendor/lua/lib/lua/coxpcall.lua +57 -0
- data/vendor/lua/lib/lua/date.lua +745 -0
- data/vendor/lua/lib/lua/debug_ext.lua +84 -0
- data/vendor/lua/lib/lua/debug_init.lua +2 -0
- data/vendor/lua/lib/lua/des56.dll +0 -0
- data/vendor/lua/lib/lua/dist/config.lua +109 -0
- data/vendor/lua/lib/lua/dist/constraints.lua +271 -0
- data/vendor/lua/lib/lua/dist/depends.lua +601 -0
- data/vendor/lua/lib/lua/dist/git.lua +307 -0
- data/vendor/lua/lib/lua/dist/init.lua +278 -0
- data/vendor/lua/lib/lua/dist/manifest.lua +225 -0
- data/vendor/lua/lib/lua/dist/package.lua +583 -0
- data/vendor/lua/lib/lua/dist/sys.lua +367 -0
- data/vendor/lua/lib/lua/dist/utils.lua +130 -0
- data/vendor/lua/lib/lua/ex.dll +0 -0
- data/vendor/lua/lib/lua/fstable.lua +116 -0
- data/vendor/lua/lib/lua/getopt.lua +273 -0
- data/vendor/lua/lib/lua/git.lua +5 -0
- data/vendor/lua/lib/lua/git/core.dll +0 -0
- data/vendor/lua/lib/lua/git/objects.lua +121 -0
- data/vendor/lua/lib/lua/git/pack.lua +316 -0
- data/vendor/lua/lib/lua/git/protocol.lua +188 -0
- data/vendor/lua/lib/lua/git/repo.lua +283 -0
- data/vendor/lua/lib/lua/git/util.lua +233 -0
- data/vendor/lua/lib/lua/gzio.dll +0 -0
- data/vendor/lua/lib/lua/gzip.lua +81 -0
- data/vendor/lua/lib/lua/iconv.dll +0 -0
- data/vendor/lua/lib/lua/imlua.dll +0 -0
- data/vendor/lua/lib/lua/imlua_fftw.dll +0 -0
- data/vendor/lua/lib/lua/imlua_jp2.dll +0 -0
- data/vendor/lua/lib/lua/imlua_process.dll +0 -0
- data/vendor/lua/lib/lua/imlua_process_omp.dll +0 -0
- data/vendor/lua/lib/lua/io_ext.lua +115 -0
- data/vendor/lua/lib/lua/iuplua.dll +0 -0
- data/vendor/lua/lib/lua/iuplua_mglplot.dll +0 -0
- data/vendor/lua/lib/lua/iuplua_pplot.dll +0 -0
- data/vendor/lua/lib/lua/iupluacd.dll +0 -0
- data/vendor/lua/lib/lua/iupluacontrols.dll +0 -0
- data/vendor/lua/lib/lua/iupluagl.dll +0 -0
- data/vendor/lua/lib/lua/iupluaim.dll +0 -0
- data/vendor/lua/lib/lua/iupluaimglib.dll +0 -0
- data/vendor/lua/lib/lua/iupluatuio.dll +0 -0
- data/vendor/lua/lib/lua/lanes-keeper.lua +302 -0
- data/vendor/lua/lib/lua/lanes.lua +591 -0
- data/vendor/lua/lib/lua/lanes/core.dll +0 -0
- data/vendor/lua/lib/lua/lcs.lua +55 -0
- data/vendor/lua/lib/lua/lemock.lua +659 -0
- data/vendor/lua/lib/lua/lfs.dll +0 -0
- data/vendor/lua/lib/lua/list.lua +375 -0
- data/vendor/lua/lib/lua/logging.lua +189 -0
- data/vendor/lua/lib/lua/logging/console.lua +22 -0
- data/vendor/lua/lib/lua/logging/email.lua +44 -0
- data/vendor/lua/lib/lua/logging/file.lua +55 -0
- data/vendor/lua/lib/lua/logging/rolling_file.lua +81 -0
- data/vendor/lua/lib/lua/logging/socket.lua +35 -0
- data/vendor/lua/lib/lua/logging/sql.lua +64 -0
- data/vendor/lua/lib/lua/loop/base.lua +68 -0
- data/vendor/lua/lib/lua/loop/cached.lua +312 -0
- data/vendor/lua/lib/lua/loop/collection/MapWithArrayOfKeys.lua +64 -0
- data/vendor/lua/lib/lua/loop/collection/ObjectCache.lua +39 -0
- data/vendor/lua/lib/lua/loop/collection/OrderedSet.lua +164 -0
- data/vendor/lua/lib/lua/loop/collection/PriorityQueue.lua +86 -0
- data/vendor/lua/lib/lua/loop/collection/UnorderedArray.lua +32 -0
- data/vendor/lua/lib/lua/loop/collection/UnorderedArraySet.lua +56 -0
- data/vendor/lua/lib/lua/loop/compiler/Arguments.lua +108 -0
- data/vendor/lua/lib/lua/loop/compiler/Conditional.lua +50 -0
- data/vendor/lua/lib/lua/loop/compiler/Expression.lua +215 -0
- data/vendor/lua/lib/lua/loop/component/base.lua +221 -0
- data/vendor/lua/lib/lua/loop/component/contained.lua +71 -0
- data/vendor/lua/lib/lua/loop/component/dynamic.lua +223 -0
- data/vendor/lua/lib/lua/loop/component/intercepted.lua +354 -0
- data/vendor/lua/lib/lua/loop/component/wrapped.lua +195 -0
- data/vendor/lua/lib/lua/loop/debug/Inspector.lua +521 -0
- data/vendor/lua/lib/lua/loop/debug/Matcher.lua +192 -0
- data/vendor/lua/lib/lua/loop/debug/Verbose.lua +266 -0
- data/vendor/lua/lib/lua/loop/debug/Viewer.lua +200 -0
- data/vendor/lua/lib/lua/loop/multiple.lua +105 -0
- data/vendor/lua/lib/lua/loop/object/Exception.lua +57 -0
- data/vendor/lua/lib/lua/loop/object/Publisher.lua +43 -0
- data/vendor/lua/lib/lua/loop/object/Wrapper.lua +39 -0
- data/vendor/lua/lib/lua/loop/scoped.lua +585 -0
- data/vendor/lua/lib/lua/loop/serial/FileStream.lua +48 -0
- data/vendor/lua/lib/lua/loop/serial/Serializer.lua +291 -0
- data/vendor/lua/lib/lua/loop/serial/SocketStream.lua +51 -0
- data/vendor/lua/lib/lua/loop/serial/StringStream.lua +47 -0
- data/vendor/lua/lib/lua/loop/simple.lua +75 -0
- data/vendor/lua/lib/lua/loop/table.lua +71 -0
- data/vendor/lua/lib/lua/loop/thread/CoSocket.lua +416 -0
- data/vendor/lua/lib/lua/loop/thread/IOScheduler.lua +170 -0
- data/vendor/lua/lib/lua/loop/thread/Scheduler.lua +327 -0
- data/vendor/lua/lib/lua/loop/thread/SocketScheduler.lua +88 -0
- data/vendor/lua/lib/lua/loop/thread/Timer.lua +54 -0
- data/vendor/lua/lib/lua/lpeg.dll +0 -0
- data/vendor/lua/lib/lua/ltn12.lua +292 -0
- data/vendor/lua/lib/lua/luaXML_lib.dll +0 -0
- data/vendor/lua/lib/lua/luacurl.dll +0 -0
- data/vendor/lua/lib/lua/luadoc/config.lua +34 -0
- data/vendor/lua/lib/lua/luadoc/doclet/debug.lua +46 -0
- data/vendor/lua/lib/lua/luadoc/doclet/formatter.lua +84 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html.lua +289 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/file.lp +113 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/function.lp +64 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/index.lp +70 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/luadoc.css +286 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/menu.lp +55 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/module.lp +109 -0
- data/vendor/lua/lib/lua/luadoc/doclet/html/table.lp +15 -0
- data/vendor/lua/lib/lua/luadoc/doclet/raw.lua +12 -0
- data/vendor/lua/lib/lua/luadoc/init.lua +58 -0
- data/vendor/lua/lib/lua/luadoc/lp.lua +130 -0
- data/vendor/lua/lib/lua/luadoc/taglet/standard.lua +495 -0
- data/vendor/lua/lib/lua/luadoc/taglet/standard/tags.lua +171 -0
- data/vendor/lua/lib/lua/luadoc/util.lua +233 -0
- data/vendor/lua/lib/lua/luagl.dll +0 -0
- data/vendor/lua/lib/lua/luaglu.dll +0 -0
- data/vendor/lua/lib/lua/luaidl.lua +113 -0
- data/vendor/lua/lib/lua/luaidl/lex.lua +793 -0
- data/vendor/lua/lib/lua/luaidl/pre.lua +149 -0
- data/vendor/lua/lib/lua/luaidl/sin.lua +3631 -0
- data/vendor/lua/lib/lua/luarocks/add.lua +108 -0
- data/vendor/lua/lib/lua/luarocks/admin_remove.lua +87 -0
- data/vendor/lua/lib/lua/luarocks/build.lua +330 -0
- data/vendor/lua/lib/lua/luarocks/build/builtin.lua +253 -0
- data/vendor/lua/lib/lua/luarocks/build/cmake.lua +54 -0
- data/vendor/lua/lib/lua/luarocks/build/command.lua +32 -0
- data/vendor/lua/lib/lua/luarocks/build/make.lua +92 -0
- data/vendor/lua/lib/lua/luarocks/cache.lua +85 -0
- data/vendor/lua/lib/lua/luarocks/cfg.lua +449 -0
- data/vendor/lua/lib/lua/luarocks/command_line.lua +163 -0
- data/vendor/lua/lib/lua/luarocks/deps.lua +654 -0
- data/vendor/lua/lib/lua/luarocks/dir.lua +69 -0
- data/vendor/lua/lib/lua/luarocks/download.lua +90 -0
- data/vendor/lua/lib/lua/luarocks/fetch.lua +321 -0
- data/vendor/lua/lib/lua/luarocks/fetch/cvs.lua +44 -0
- data/vendor/lua/lib/lua/luarocks/fetch/git.lua +81 -0
- data/vendor/lua/lib/lua/luarocks/fetch/git_file.lua +17 -0
- data/vendor/lua/lib/lua/luarocks/fetch/hg.lua +54 -0
- data/vendor/lua/lib/lua/luarocks/fetch/sscm.lua +42 -0
- data/vendor/lua/lib/lua/luarocks/fetch/svn.lua +53 -0
- data/vendor/lua/lib/lua/luarocks/fs.lua +40 -0
- data/vendor/lua/lib/lua/luarocks/fs/lua.lua +676 -0
- data/vendor/lua/lib/lua/luarocks/fs/unix.lua +88 -0
- data/vendor/lua/lib/lua/luarocks/fs/unix/tools.lua +325 -0
- data/vendor/lua/lib/lua/luarocks/fs/win32.lua +107 -0
- data/vendor/lua/lib/lua/luarocks/fs/win32/tools.lua +334 -0
- data/vendor/lua/lib/lua/luarocks/help.lua +101 -0
- data/vendor/lua/lib/lua/luarocks/index.lua +172 -0
- data/vendor/lua/lib/lua/luarocks/install.lua +151 -0
- data/vendor/lua/lib/lua/luarocks/list.lua +35 -0
- data/vendor/lua/lib/lua/luarocks/loader.lua +228 -0
- data/vendor/lua/lib/lua/luarocks/make.lua +71 -0
- data/vendor/lua/lib/lua/luarocks/make_manifest.lua +34 -0
- data/vendor/lua/lib/lua/luarocks/manif.lua +360 -0
- data/vendor/lua/lib/lua/luarocks/manif_core.lua +75 -0
- data/vendor/lua/lib/lua/luarocks/new_version.lua +141 -0
- data/vendor/lua/lib/lua/luarocks/pack.lua +205 -0
- data/vendor/lua/lib/lua/luarocks/path.lua +315 -0
- data/vendor/lua/lib/lua/luarocks/persist.lua +173 -0
- data/vendor/lua/lib/lua/luarocks/refresh_cache.lua +30 -0
- data/vendor/lua/lib/lua/luarocks/remove.lua +135 -0
- data/vendor/lua/lib/lua/luarocks/rep.lua +313 -0
- data/vendor/lua/lib/lua/luarocks/require.lua +6 -0
- data/vendor/lua/lib/lua/luarocks/search.lua +399 -0
- data/vendor/lua/lib/lua/luarocks/show.lua +138 -0
- data/vendor/lua/lib/lua/luarocks/site_config.lua +23 -0
- data/vendor/lua/lib/lua/luarocks/tools/patch.lua +712 -0
- data/vendor/lua/lib/lua/luarocks/tools/tar.lua +144 -0
- data/vendor/lua/lib/lua/luarocks/tools/zip.lua +245 -0
- data/vendor/lua/lib/lua/luarocks/type_check.lua +267 -0
- data/vendor/lua/lib/lua/luarocks/unpack.lua +151 -0
- data/vendor/lua/lib/lua/luarocks/util.lua +420 -0
- data/vendor/lua/lib/lua/luarocks/validate.lua +164 -0
- data/vendor/lua/lib/lua/luars232.dll +0 -0
- data/vendor/lua/lib/lua/luasql/mysql.dll +0 -0
- data/vendor/lua/lib/lua/luasql/postgres.dll +0 -0
- data/vendor/lua/lib/lua/luasql/sqlite3.dll +0 -0
- data/vendor/lua/lib/lua/luaunit.lua +601 -0
- data/vendor/lua/lib/lua/lxp.dll +0 -0
- data/vendor/lua/lib/lua/lxp/lom.lua +60 -0
- data/vendor/lua/lib/lua/math_ext.lua +27 -0
- data/vendor/lua/lib/lua/mbox.lua +53 -0
- data/vendor/lua/lib/lua/md5.lua +19 -0
- data/vendor/lua/lib/lua/md5/core.dll +0 -0
- data/vendor/lua/lib/lua/metalua.lua +0 -0
- data/vendor/lua/lib/lua/metalua/ast_to_string.mlua +553 -0
- data/vendor/lua/lib/lua/metalua/base.lua +104 -0
- data/vendor/lua/lib/lua/metalua/bytecode.lua +0 -0
- data/vendor/lua/lib/lua/metalua/clopts.mlua +204 -0
- data/vendor/lua/lib/lua/metalua/compiler.lua +3 -0
- data/vendor/lua/lib/lua/metalua/dollar.mlua +24 -0
- data/vendor/lua/lib/lua/metalua/extension/H-runtime.mlua +216 -0
- data/vendor/lua/lib/lua/metalua/extension/H.mlua +22 -0
- data/vendor/lua/lib/lua/metalua/extension/anaphoric.mlua +54 -0
- data/vendor/lua/lib/lua/metalua/extension/clist.mlua +149 -0
- data/vendor/lua/lib/lua/metalua/extension/continue.mlua +53 -0
- data/vendor/lua/lib/lua/metalua/extension/localin.mlua +2 -0
- data/vendor/lua/lib/lua/metalua/extension/log.mlua +39 -0
- data/vendor/lua/lib/lua/metalua/extension/match.mlua +374 -0
- data/vendor/lua/lib/lua/metalua/extension/ternary.mlua +10 -0
- data/vendor/lua/lib/lua/metalua/extension/trycatch.mlua +189 -0
- data/vendor/lua/lib/lua/metalua/extension/types-runtime.mlua +159 -0
- data/vendor/lua/lib/lua/metalua/extension/types.mlua +352 -0
- data/vendor/lua/lib/lua/metalua/extension/withdo.mlua +30 -0
- data/vendor/lua/lib/lua/metalua/extension/xglobal-runtime.lua +41 -0
- data/vendor/lua/lib/lua/metalua/extension/xglobal.mlua +20 -0
- data/vendor/lua/lib/lua/metalua/extension/xloop.mlua +100 -0
- data/vendor/lua/lib/lua/metalua/extension/xmatch.mlua +216 -0
- data/vendor/lua/lib/lua/metalua/metaloop.mlua +76 -0
- data/vendor/lua/lib/lua/metalua/mlc.lua +0 -0
- data/vendor/lua/lib/lua/metalua/mlc_xcall.lua +119 -0
- data/vendor/lua/lib/lua/metalua/mlp.lua +0 -0
- data/vendor/lua/lib/lua/metalua/package2.lua +101 -0
- data/vendor/lua/lib/lua/metalua/runtime.lua +3 -0
- data/vendor/lua/lib/lua/metalua/string2.lua +44 -0
- data/vendor/lua/lib/lua/metalua/table2.lua +372 -0
- data/vendor/lua/lib/lua/metalua/walk.mlua +304 -0
- data/vendor/lua/lib/lua/metalua/walk/bindings.mlua +41 -0
- data/vendor/lua/lib/lua/metalua/walk/id.mlua +186 -0
- data/vendor/lua/lib/lua/metalua/walk/scope.lua +54 -0
- data/vendor/lua/lib/lua/mime.lua +87 -0
- data/vendor/lua/lib/lua/mime/core.dll +0 -0
- data/vendor/lua/lib/lua/mobdebug.lua +1484 -0
- data/vendor/lua/lib/lua/modules.lua +16 -0
- data/vendor/lua/lib/lua/object.lua +56 -0
- data/vendor/lua/lib/lua/oil/Exception.lua +26 -0
- data/vendor/lua/lib/lua/oil/arch.lua +27 -0
- data/vendor/lua/lib/lua/oil/arch/basic/client.lua +29 -0
- data/vendor/lua/lib/lua/oil/arch/basic/common.lua +13 -0
- data/vendor/lua/lib/lua/oil/arch/basic/server.lua +27 -0
- data/vendor/lua/lib/lua/oil/arch/cooperative/common.lua +10 -0
- data/vendor/lua/lib/lua/oil/arch/cooperative/server.lua +16 -0
- data/vendor/lua/lib/lua/oil/arch/corba/client.lua +39 -0
- data/vendor/lua/lib/lua/oil/arch/corba/common.lua +58 -0
- data/vendor/lua/lib/lua/oil/arch/corba/intercepted/client.lua +9 -0
- data/vendor/lua/lib/lua/oil/arch/corba/intercepted/server.lua +9 -0
- data/vendor/lua/lib/lua/oil/arch/corba/server.lua +35 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/byref.lua +18 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/client.lua +19 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/common.lua +18 -0
- data/vendor/lua/lib/lua/oil/arch/ludo/server.lua +19 -0
- data/vendor/lua/lib/lua/oil/arch/typed/client.lua +27 -0
- data/vendor/lua/lib/lua/oil/arch/typed/common.lua +9 -0
- data/vendor/lua/lib/lua/oil/arch/typed/server.lua +18 -0
- data/vendor/lua/lib/lua/oil/assert.lua +87 -0
- data/vendor/lua/lib/lua/oil/builder.lua +45 -0
- data/vendor/lua/lib/lua/oil/builder/basic/client.lua +31 -0
- data/vendor/lua/lib/lua/oil/builder/basic/common.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/basic/server.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/cooperative/common.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/cooperative/server.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/corba/client.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/corba/common.lua +24 -0
- data/vendor/lua/lib/lua/oil/builder/corba/gencode.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/corba/intercepted/client.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/corba/intercepted/server.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/corba/server.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/lua/client.lua +11 -0
- data/vendor/lua/lib/lua/oil/builder/lua/server.lua +12 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/byref.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/client.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/common.lua +14 -0
- data/vendor/lua/lib/lua/oil/builder/ludo/server.lua +13 -0
- data/vendor/lua/lib/lua/oil/builder/typed/client.lua +16 -0
- data/vendor/lua/lib/lua/oil/builder/typed/server.lua +12 -0
- data/vendor/lua/lib/lua/oil/compat.lua +846 -0
- data/vendor/lua/lib/lua/oil/component.lua +1 -0
- data/vendor/lua/lib/lua/oil/corba/giop.lua +301 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Codec.lua +1568 -0
- data/vendor/lua/lib/lua/oil/corba/giop/CodecGen.lua +589 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Exception.lua +25 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Indexer.lua +63 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Listener.lua +343 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Messenger.lua +228 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Referrer.lua +180 -0
- data/vendor/lua/lib/lua/oil/corba/giop/Requester.lua +462 -0
- data/vendor/lua/lib/lua/oil/corba/idl.lua +597 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Compiler.lua +133 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Importer.lua +235 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Indexer.lua +95 -0
- data/vendor/lua/lib/lua/oil/corba/idl/Registry.lua +1821 -0
- data/vendor/lua/lib/lua/oil/corba/idl/ir.lua +847 -0
- data/vendor/lua/lib/lua/oil/corba/idl/sysex.lua +21 -0
- data/vendor/lua/lib/lua/oil/corba/iiop/Profiler.lua +200 -0
- data/vendor/lua/lib/lua/oil/corba/intercepted/Listener.lua +158 -0
- data/vendor/lua/lib/lua/oil/corba/intercepted/Requester.lua +181 -0
- data/vendor/lua/lib/lua/oil/corba/services/event.lua +126 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/ConsumerAdmin.lua +50 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/EventFactory.lua +15 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/EventQueue.lua +37 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/ProxyPushConsumer.lua +75 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/ProxyPushSupplier.lua +62 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/SingleDeferredDispatcher.lua +60 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/SingleSynchronousDispatcher.lua +39 -0
- data/vendor/lua/lib/lua/oil/corba/services/event/SupplierAdmin.lua +50 -0
- data/vendor/lua/lib/lua/oil/corba/services/naming.lua +436 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Acceptor.lua +268 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Channels.lua +121 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Connector.lua +147 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Dispatcher.lua +99 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies.lua +86 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/asynchronous.lua +56 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/protected.lua +17 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/synchronous.lua +17 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Proxies/utils.lua +29 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Receiver.lua +110 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Servants.lua +207 -0
- data/vendor/lua/lib/lua/oil/kernel/base/Sockets.lua +44 -0
- data/vendor/lua/lib/lua/oil/kernel/cooperative/Receiver.lua +139 -0
- data/vendor/lua/lib/lua/oil/kernel/intercepted/Listener.lua +47 -0
- data/vendor/lua/lib/lua/oil/kernel/intercepted/Requester.lua +58 -0
- data/vendor/lua/lib/lua/oil/kernel/lua/Dispatcher.lua +76 -0
- data/vendor/lua/lib/lua/oil/kernel/lua/Proxies.lua +69 -0
- data/vendor/lua/lib/lua/oil/kernel/typed/Dispatcher.lua +91 -0
- data/vendor/lua/lib/lua/oil/kernel/typed/Proxies.lua +153 -0
- data/vendor/lua/lib/lua/oil/kernel/typed/Servants.lua +137 -0
- data/vendor/lua/lib/lua/oil/ludo/Codec.lua +66 -0
- data/vendor/lua/lib/lua/oil/ludo/CodecByRef.lua +103 -0
- data/vendor/lua/lib/lua/oil/ludo/Listener.lua +151 -0
- data/vendor/lua/lib/lua/oil/ludo/Referrer.lua +72 -0
- data/vendor/lua/lib/lua/oil/ludo/Requester.lua +107 -0
- data/vendor/lua/lib/lua/oil/oo.lua +1 -0
- data/vendor/lua/lib/lua/oil/port.lua +1 -0
- data/vendor/lua/lib/lua/oil/properties.lua +57 -0
- data/vendor/lua/lib/lua/oil/verbose.lua +133 -0
- data/vendor/lua/lib/lua/package_ext.lua +15 -0
- data/vendor/lua/lib/lua/parser.lua +268 -0
- data/vendor/lua/lib/lua/pl/Date.lua +555 -0
- data/vendor/lua/lib/lua/pl/List.lua +613 -0
- data/vendor/lua/lib/lua/pl/Map.lua +113 -0
- data/vendor/lua/lib/lua/pl/MultiMap.lua +62 -0
- data/vendor/lua/lib/lua/pl/OrderedMap.lua +151 -0
- data/vendor/lua/lib/lua/pl/Set.lua +153 -0
- data/vendor/lua/lib/lua/pl/app.lua +165 -0
- data/vendor/lua/lib/lua/pl/array2d.lua +501 -0
- data/vendor/lua/lib/lua/pl/class.lua +180 -0
- data/vendor/lua/lib/lua/pl/comprehension.lua +286 -0
- data/vendor/lua/lib/lua/pl/config.lua +176 -0
- data/vendor/lua/lib/lua/pl/data.lua +606 -0
- data/vendor/lua/lib/lua/pl/dir.lua +475 -0
- data/vendor/lua/lib/lua/pl/file.lua +70 -0
- data/vendor/lua/lib/lua/pl/func.lua +376 -0
- data/vendor/lua/lib/lua/pl/init.lua +68 -0
- data/vendor/lua/lib/lua/pl/input.lua +173 -0
- data/vendor/lua/lib/lua/pl/lapp.lua +407 -0
- data/vendor/lua/lib/lua/pl/lexer.lua +456 -0
- data/vendor/lua/lib/lua/pl/luabalanced.lua +264 -0
- data/vendor/lua/lib/lua/pl/operator.lua +201 -0
- data/vendor/lua/lib/lua/pl/path.lua +398 -0
- data/vendor/lua/lib/lua/pl/permute.lua +63 -0
- data/vendor/lua/lib/lua/pl/platf/luajava.lua +101 -0
- data/vendor/lua/lib/lua/pl/pretty.lua +285 -0
- data/vendor/lua/lib/lua/pl/seq.lua +551 -0
- data/vendor/lua/lib/lua/pl/sip.lua +344 -0
- data/vendor/lua/lib/lua/pl/strict.lua +70 -0
- data/vendor/lua/lib/lua/pl/stringio.lua +158 -0
- data/vendor/lua/lib/lua/pl/stringx.lua +440 -0
- data/vendor/lua/lib/lua/pl/tablex.lua +817 -0
- data/vendor/lua/lib/lua/pl/template.lua +103 -0
- data/vendor/lua/lib/lua/pl/test.lua +135 -0
- data/vendor/lua/lib/lua/pl/text.lua +243 -0
- data/vendor/lua/lib/lua/pl/utils.lua +550 -0
- data/vendor/lua/lib/lua/pl/xml.lua +689 -0
- data/vendor/lua/lib/lua/profiler.dll +0 -0
- data/vendor/lua/lib/lua/re.lua +248 -0
- data/vendor/lua/lib/lua/rex_onig.dll +0 -0
- data/vendor/lua/lib/lua/rex_pcre.dll +0 -0
- data/vendor/lua/lib/lua/rex_posix.dll +0 -0
- data/vendor/lua/lib/lua/rings.dll +0 -0
- data/vendor/lua/lib/lua/serialize.lua +193 -0
- data/vendor/lua/lib/lua/set.lua +149 -0
- data/vendor/lua/lib/lua/socket.lua +133 -0
- data/vendor/lua/lib/lua/socket/core.dll +0 -0
- data/vendor/lua/lib/lua/socket/ftp.lua +281 -0
- data/vendor/lua/lib/lua/socket/http.lua +350 -0
- data/vendor/lua/lib/lua/socket/smtp.lua +251 -0
- data/vendor/lua/lib/lua/socket/tp.lua +123 -0
- data/vendor/lua/lib/lua/socket/url.lua +297 -0
- data/vendor/lua/lib/lua/ssl.dll +0 -0
- data/vendor/lua/lib/lua/ssl.lua +93 -0
- data/vendor/lua/lib/lua/ssl/https.lua +138 -0
- data/vendor/lua/lib/lua/stable.lua +28 -0
- data/vendor/lua/lib/lua/std.lua +16 -0
- data/vendor/lua/lib/lua/strbuf.lua +32 -0
- data/vendor/lua/lib/lua/strict.lua +45 -0
- data/vendor/lua/lib/lua/string_ext.lua +274 -0
- data/vendor/lua/lib/lua/table_ext.lua +117 -0
- data/vendor/lua/lib/lua/tar.lua +262 -0
- data/vendor/lua/lib/lua/task.dll +0 -0
- data/vendor/lua/lib/lua/tree.lua +81 -0
- data/vendor/lua/lib/lua/unicode.dll +0 -0
- data/vendor/lua/lib/lua/verbose_require.lua +11 -0
- data/vendor/lua/lib/lua/vstruct.lua +86 -0
- data/vendor/lua/lib/lua/vstruct/ast.lua +192 -0
- data/vendor/lua/lib/lua/vstruct/ast/Bitpack.lua +33 -0
- data/vendor/lua/lib/lua/vstruct/ast/Generator.lua +174 -0
- data/vendor/lua/lib/lua/vstruct/ast/IO.lua +45 -0
- data/vendor/lua/lib/lua/vstruct/ast/List.lua +56 -0
- data/vendor/lua/lib/lua/vstruct/ast/Name.lua +20 -0
- data/vendor/lua/lib/lua/vstruct/ast/Repeat.lua +23 -0
- data/vendor/lua/lib/lua/vstruct/ast/Root.lua +19 -0
- data/vendor/lua/lib/lua/vstruct/ast/Table.lua +65 -0
- data/vendor/lua/lib/lua/vstruct/cursor.lua +81 -0
- data/vendor/lua/lib/lua/vstruct/io.lua +45 -0
- data/vendor/lua/lib/lua/vstruct/io/a.lua +24 -0
- data/vendor/lua/lib/lua/vstruct/io/b.lua +28 -0
- data/vendor/lua/lib/lua/vstruct/io/bigendian.lua +21 -0
- data/vendor/lua/lib/lua/vstruct/io/c.lua +25 -0
- data/vendor/lua/lib/lua/vstruct/io/defaults.lua +24 -0
- data/vendor/lua/lib/lua/vstruct/io/endianness.lua +41 -0
- data/vendor/lua/lib/lua/vstruct/io/f.lua +129 -0
- data/vendor/lua/lib/lua/vstruct/io/hostendian.lua +21 -0
- data/vendor/lua/lib/lua/vstruct/io/i.lua +42 -0
- data/vendor/lua/lib/lua/vstruct/io/littleendian.lua +21 -0
- data/vendor/lua/lib/lua/vstruct/io/m.lua +62 -0
- data/vendor/lua/lib/lua/vstruct/io/p.lua +23 -0
- data/vendor/lua/lib/lua/vstruct/io/s.lua +27 -0
- data/vendor/lua/lib/lua/vstruct/io/seekb.lua +18 -0
- data/vendor/lua/lib/lua/vstruct/io/seekf.lua +18 -0
- data/vendor/lua/lib/lua/vstruct/io/seekto.lua +18 -0
- data/vendor/lua/lib/lua/vstruct/io/u.lua +54 -0
- data/vendor/lua/lib/lua/vstruct/io/x.lua +34 -0
- data/vendor/lua/lib/lua/vstruct/io/z.lua +63 -0
- data/vendor/lua/lib/lua/vstruct/lexer.lua +100 -0
- data/vendor/lua/lib/lua/vstruct/pack.lua +142 -0
- data/vendor/lua/lib/lua/vstruct/test.lua +47 -0
- data/vendor/lua/lib/lua/vstruct/test/basic.lua +73 -0
- data/vendor/lua/lib/lua/vstruct/test/common.lua +100 -0
- data/vendor/lua/lib/lua/vstruct/test/fp-bigendian.lua +56 -0
- data/vendor/lua/lib/lua/vstruct/test/fp-littleendian.lua +56 -0
- data/vendor/lua/lib/lua/vstruct/test/struct-test-gen.lua +1230 -0
- data/vendor/lua/lib/lua/vstruct/unpack.lua +126 -0
- data/vendor/lua/lib/lua/wx.dll +0 -0
- data/vendor/lua/lib/lua/xml.lua +75 -0
- data/vendor/lua/lib/lua/zip.dll +0 -0
- data/vendor/lua/lib/lua/zlib.dll +0 -0
- metadata +529 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
|
|
2
|
+
--- fs operations implemented with third-party tools for Windows platform abstractions.
|
|
3
|
+
-- Download http://unxutils.sourceforge.net/ for Windows GNU utilities
|
|
4
|
+
-- used by this module.
|
|
5
|
+
module("luarocks.fs.win32.tools", package.seeall)
|
|
6
|
+
|
|
7
|
+
local fs = require("luarocks.fs")
|
|
8
|
+
local cfg = require("luarocks.cfg")
|
|
9
|
+
local dir = require("luarocks.dir")
|
|
10
|
+
|
|
11
|
+
local dir_stack = {}
|
|
12
|
+
|
|
13
|
+
local vars = cfg.variables
|
|
14
|
+
|
|
15
|
+
--- Strip the last extension of a filename.
|
|
16
|
+
-- Example: "foo.tar.gz" becomes "foo.tar".
|
|
17
|
+
-- If filename has no dots, returns it unchanged.
|
|
18
|
+
-- @param filename string: The file name to strip.
|
|
19
|
+
-- @return string: The stripped name.
|
|
20
|
+
local function strip_extension(filename)
|
|
21
|
+
assert(type(filename) == "string")
|
|
22
|
+
|
|
23
|
+
return (filename:gsub("%.[^.]+$", "")) or filename
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
local function command_at(directory, cmd)
|
|
27
|
+
local drive = directory:match("^([A-Za-z]:)")
|
|
28
|
+
cmd = "cd " .. fs.Q(directory) .. " & " .. cmd
|
|
29
|
+
if drive then
|
|
30
|
+
cmd = drive .. " & " .. cmd
|
|
31
|
+
end
|
|
32
|
+
return cmd
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
--- Test for existance of a file.
|
|
36
|
+
-- @param file string: filename to test
|
|
37
|
+
-- @return boolean: true if file exists, false otherwise.
|
|
38
|
+
function exists(file)
|
|
39
|
+
assert(file)
|
|
40
|
+
return fs.execute("if not exist " .. fs.Q(file) ..
|
|
41
|
+
" invalidcommandname 2>NUL 1>NUL")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
--- Obtain current directory.
|
|
45
|
+
-- Uses the module's internal directory stack.
|
|
46
|
+
-- @return string: the absolute pathname of the current directory.
|
|
47
|
+
function current_dir()
|
|
48
|
+
local pipe = io.popen(vars.PWD)
|
|
49
|
+
local current = pipe:read("*l")
|
|
50
|
+
pipe:close()
|
|
51
|
+
for _, directory in ipairs(dir_stack) do
|
|
52
|
+
current = fs.absolute_name(directory, current)
|
|
53
|
+
end
|
|
54
|
+
return current
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
--- Test is pathname is a regular file.
|
|
58
|
+
-- @param file string: pathname to test
|
|
59
|
+
-- @return boolean: true if it is a regular file, false otherwise.
|
|
60
|
+
function is_file(file)
|
|
61
|
+
assert(file)
|
|
62
|
+
return fs.execute(vars.TEST.." -f", file)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
local md5_cmd = {
|
|
66
|
+
md5sum = vars.MD5SUM,
|
|
67
|
+
openssl = vars.OPENSSL.." md5",
|
|
68
|
+
md5 = vars.MD5,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
--- Get the MD5 checksum for a file.
|
|
72
|
+
-- @param file string: The file to be computed.
|
|
73
|
+
-- @return string: The MD5 checksum
|
|
74
|
+
function get_md5(file)
|
|
75
|
+
local cmd = md5_cmd[cfg.md5checker]
|
|
76
|
+
if not cmd then return nil end
|
|
77
|
+
local pipe = io.popen(cmd.." "..fs.absolute_name(file))
|
|
78
|
+
local computed = pipe:read("*a")
|
|
79
|
+
pipe:close()
|
|
80
|
+
if not computed then return nil end
|
|
81
|
+
return computed:match("("..("%x"):rep(32)..")")
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
--- Change the current directory.
|
|
85
|
+
-- Uses the module's internal directory stack. This does not have exact
|
|
86
|
+
-- semantics of chdir, as it does not handle errors the same way,
|
|
87
|
+
-- but works well for our purposes for now.
|
|
88
|
+
-- @param directory string: The directory to switch to.
|
|
89
|
+
function change_dir(directory)
|
|
90
|
+
assert(type(directory) == "string")
|
|
91
|
+
table.insert(dir_stack, directory)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
--- Change directory to root.
|
|
95
|
+
-- Allows leaving a directory (e.g. for deleting it) in
|
|
96
|
+
-- a crossplatform way.
|
|
97
|
+
function change_dir_to_root()
|
|
98
|
+
table.insert(dir_stack, "/")
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
--- Change working directory to the previous in the directory stack.
|
|
102
|
+
function pop_dir()
|
|
103
|
+
local directory = table.remove(dir_stack)
|
|
104
|
+
return directory ~= nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
--- Run the given command.
|
|
108
|
+
-- The command is executed in the current directory in the directory stack.
|
|
109
|
+
-- @param cmd string: No quoting/escaping is applied to the command.
|
|
110
|
+
-- @return boolean: true if command succeeds (status code 0), false
|
|
111
|
+
-- otherwise.
|
|
112
|
+
function execute_string(cmd)
|
|
113
|
+
local code = os.execute(command_at(fs.current_dir(), cmd))
|
|
114
|
+
if code == 0 or code == true then
|
|
115
|
+
return true
|
|
116
|
+
else
|
|
117
|
+
return false
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
--- Test is pathname is a regular file.
|
|
122
|
+
-- @param file string: pathname to test
|
|
123
|
+
-- @return boolean: true if it is a regular file, false otherwise.
|
|
124
|
+
function is_dir(file)
|
|
125
|
+
assert(file)
|
|
126
|
+
return fs.execute(vars.TEST.." -d " .. fs.Q(file) .. " 2>NUL 1>NUL")
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
--- Create a directory if it does not already exist.
|
|
130
|
+
-- If any of the higher levels in the path name does not exist
|
|
131
|
+
-- too, they are created as well.
|
|
132
|
+
-- @param directory string: pathname of directory to create.
|
|
133
|
+
-- @return boolean: true on success, false on failure.
|
|
134
|
+
function make_dir(directory)
|
|
135
|
+
assert(directory)
|
|
136
|
+
fs.execute(vars.MKDIR.." "..fs.Q(directory).." 1> NUL 2> NUL")
|
|
137
|
+
return 1
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
--- Remove a directory if it is empty.
|
|
141
|
+
-- Does not return errors (for example, if directory is not empty or
|
|
142
|
+
-- if already does not exist)
|
|
143
|
+
-- @param directory string: pathname of directory to remove.
|
|
144
|
+
function remove_dir_if_empty(directory)
|
|
145
|
+
assert(directory)
|
|
146
|
+
fs.execute_string(vars.RMDIR.." "..fs.Q(directory).." 1> NUL 2> NUL")
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
--- Remove a directory if it is empty.
|
|
150
|
+
-- Does not return errors (for example, if directory is not empty or
|
|
151
|
+
-- if already does not exist)
|
|
152
|
+
-- @param directory string: pathname of directory to remove.
|
|
153
|
+
function remove_dir_tree_if_empty(directory)
|
|
154
|
+
assert(directory)
|
|
155
|
+
fs.execute_string(vars.RMDIR.." "..fs.Q(directory).." 1> NUL 2> NUL")
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
--- Copy a file.
|
|
159
|
+
-- @param src string: Pathname of source
|
|
160
|
+
-- @param dest string: Pathname of destination
|
|
161
|
+
-- @return boolean or (boolean, string): true on success, false on failure,
|
|
162
|
+
-- plus an error message.
|
|
163
|
+
function copy(src, dest)
|
|
164
|
+
assert(src and dest)
|
|
165
|
+
if dest:match("[/\\]$") then dest = dest:sub(1, -2) end
|
|
166
|
+
if fs.execute(vars.CP, src, dest) then
|
|
167
|
+
return true
|
|
168
|
+
else
|
|
169
|
+
return false, "Failed copying "..src.." to "..dest
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
--- Recursively copy the contents of a directory.
|
|
174
|
+
-- @param src string: Pathname of source
|
|
175
|
+
-- @param dest string: Pathname of destination
|
|
176
|
+
-- @return boolean or (boolean, string): true on success, false on failure,
|
|
177
|
+
-- plus an error message.
|
|
178
|
+
function copy_contents(src, dest)
|
|
179
|
+
assert(src and dest)
|
|
180
|
+
if fs.execute_string(vars.CP.." -a "..src.."\\*.* "..fs.Q(dest).." 1> NUL 2> NUL") then
|
|
181
|
+
return true
|
|
182
|
+
else
|
|
183
|
+
return false, "Failed copying "..src.." to "..dest
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
--- Delete a file or a directory and all its contents.
|
|
188
|
+
-- For safety, this only accepts absolute paths.
|
|
189
|
+
-- @param arg string: Pathname of source
|
|
190
|
+
-- @return boolean: true on success, false on failure.
|
|
191
|
+
function delete(arg)
|
|
192
|
+
assert(arg)
|
|
193
|
+
assert(arg:match("^[\a-zA-Z]?:?[\\/]"))
|
|
194
|
+
fs.execute(vars.CHMOD.." a+rw -R ", arg)
|
|
195
|
+
return fs.execute_string(vars.RM.." -rf " .. fs.Q(arg) .. " 1> NUL 2> NUL")
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
--- List the contents of a directory.
|
|
199
|
+
-- @param at string or nil: directory to list (will be the current
|
|
200
|
+
-- directory if none is given).
|
|
201
|
+
-- @return table: an array of strings with the filenames representing
|
|
202
|
+
-- the contents of a directory.
|
|
203
|
+
function list_dir(at)
|
|
204
|
+
assert(type(at) == "string" or not at)
|
|
205
|
+
if not at then
|
|
206
|
+
at = fs.current_dir()
|
|
207
|
+
end
|
|
208
|
+
if not fs.is_dir(at) then
|
|
209
|
+
return {}
|
|
210
|
+
end
|
|
211
|
+
local result = {}
|
|
212
|
+
local pipe = io.popen(command_at(at, vars.LS))
|
|
213
|
+
for file in pipe:lines() do
|
|
214
|
+
table.insert(result, file)
|
|
215
|
+
end
|
|
216
|
+
pipe:close()
|
|
217
|
+
|
|
218
|
+
return result
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
--- Recursively scan the contents of a directory.
|
|
222
|
+
-- @param at string or nil: directory to scan (will be the current
|
|
223
|
+
-- directory if none is given).
|
|
224
|
+
-- @return table: an array of strings with the filenames representing
|
|
225
|
+
-- the contents of a directory. Paths are returned with forward slashes.
|
|
226
|
+
function find(at)
|
|
227
|
+
assert(type(at) == "string" or not at)
|
|
228
|
+
if not at then
|
|
229
|
+
at = fs.current_dir()
|
|
230
|
+
end
|
|
231
|
+
if not fs.is_dir(at) then
|
|
232
|
+
return {}
|
|
233
|
+
end
|
|
234
|
+
local result = {}
|
|
235
|
+
local pipe = io.popen(command_at(at, vars.FIND.." 2> NUL"))
|
|
236
|
+
for file in pipe:lines() do
|
|
237
|
+
-- Windows find is a bit different
|
|
238
|
+
local first_two = file:sub(1,2)
|
|
239
|
+
if first_two == ".\\" or first_two == "./" then file=file:sub(3) end
|
|
240
|
+
if file ~= "." then
|
|
241
|
+
table.insert(result, (file:gsub("\\", "/")))
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
return result
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
--- Download a remote file.
|
|
248
|
+
-- @param url string: URL to be fetched.
|
|
249
|
+
-- @param filename string or nil: this function attempts to detect the
|
|
250
|
+
-- resulting local filename of the remote file as the basename of the URL;
|
|
251
|
+
-- if that is not correct (due to a redirection, for example), the local
|
|
252
|
+
-- filename can be given explicitly as this second argument.
|
|
253
|
+
-- @return boolean: true on success, false on failure.
|
|
254
|
+
function download(url, filename)
|
|
255
|
+
assert(type(url) == "string")
|
|
256
|
+
assert(type(filename) == "string" or not filename)
|
|
257
|
+
|
|
258
|
+
if cfg.downloader == "wget" then
|
|
259
|
+
local wget_cmd = vars.WGET.." --no-check-certificate --no-cache --user-agent="..cfg.user_agent.." --quiet --continue "
|
|
260
|
+
if filename then
|
|
261
|
+
return fs.execute(wget_cmd.." --output-document ", filename, url)
|
|
262
|
+
else
|
|
263
|
+
return fs.execute(wget_cmd, url)
|
|
264
|
+
end
|
|
265
|
+
elseif cfg.downloader == "curl" then
|
|
266
|
+
filename = filename or dir.base_name(url)
|
|
267
|
+
return fs.execute_string(vars.CURL.." -L --user-agent "..cfg.user_agent.." "..fs.Q(url).." 2> NUL 1> "..fs.Q(filename))
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
--- Compress files in a .zip archive.
|
|
273
|
+
-- @param zipfile string: pathname of .zip archive to be created.
|
|
274
|
+
-- @param ... Filenames to be stored in the archive are given as
|
|
275
|
+
-- additional arguments.
|
|
276
|
+
-- @return boolean: true on success, false on failure.
|
|
277
|
+
function zip(zipfile, ...)
|
|
278
|
+
return fs.execute(vars.SEVENZ.." a -tzip", zipfile, ...)
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
--- Uncompress files from a .zip archive.
|
|
282
|
+
-- @param zipfile string: pathname of .zip archive to be extracted.
|
|
283
|
+
-- @return boolean: true on success, false on failure.
|
|
284
|
+
function unzip(zipfile)
|
|
285
|
+
assert(zipfile)
|
|
286
|
+
return fs.execute(vars.SEVENZ.." x", zipfile)
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
--- Uncompress gzip file.
|
|
290
|
+
-- @param archive string: Filename of archive.
|
|
291
|
+
-- @return boolean : success status
|
|
292
|
+
local function gunzip(archive)
|
|
293
|
+
return fs.execute(vars.SEVENZ.." x", archive)
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
--- Unpack an archive.
|
|
297
|
+
-- Extract the contents of an archive, detecting its format by
|
|
298
|
+
-- filename extension.
|
|
299
|
+
-- @param archive string: Filename of archive.
|
|
300
|
+
-- @return boolean or (boolean, string): true on success, false and an error message on failure.
|
|
301
|
+
function unpack_archive(archive)
|
|
302
|
+
assert(type(archive) == "string")
|
|
303
|
+
|
|
304
|
+
local ok
|
|
305
|
+
local sevenzx = vars.SEVENZ.." x"
|
|
306
|
+
if archive:match("%.tar%.gz$") then
|
|
307
|
+
ok = gunzip(archive)
|
|
308
|
+
if ok then
|
|
309
|
+
ok = fs.execute(sevenzx, strip_extension(archive))
|
|
310
|
+
end
|
|
311
|
+
elseif archive:match("%.tgz$") then
|
|
312
|
+
ok = gunzip(archive)
|
|
313
|
+
if ok then
|
|
314
|
+
ok = fs.execute(sevenzx, strip_extension(archive)..".tar")
|
|
315
|
+
end
|
|
316
|
+
elseif archive:match("%.tar%.bz2$") then
|
|
317
|
+
ok = fs.execute(sevenzx, archive)
|
|
318
|
+
if ok then
|
|
319
|
+
ok = fs.execute(sevenzx, strip_extension(archive))
|
|
320
|
+
end
|
|
321
|
+
elseif archive:match("%.zip$") then
|
|
322
|
+
ok = fs.execute(sevenzx, archive)
|
|
323
|
+
elseif archive:match("%.lua$") or archive:match("%.c$") then
|
|
324
|
+
-- Ignore .lua and .c files; they don't need to be extracted.
|
|
325
|
+
return true
|
|
326
|
+
else
|
|
327
|
+
local ext = archive:match(".*(%..*)")
|
|
328
|
+
return false, "Unrecognized filename extension "..(ext or "")
|
|
329
|
+
end
|
|
330
|
+
if not ok then
|
|
331
|
+
return false, "Failed extracting "..archive
|
|
332
|
+
end
|
|
333
|
+
return true
|
|
334
|
+
end
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
|
|
2
|
+
--- Module implementing the LuaRocks "help" command.
|
|
3
|
+
-- This is a generic help display module, which
|
|
4
|
+
-- uses a global table called "commands" to find commands
|
|
5
|
+
-- to show help for; each command should be represented by a
|
|
6
|
+
-- table containing "help" and "help_summary" fields.
|
|
7
|
+
module("luarocks.help", package.seeall)
|
|
8
|
+
|
|
9
|
+
local util = require("luarocks.util")
|
|
10
|
+
local cfg = require("luarocks.cfg")
|
|
11
|
+
|
|
12
|
+
help_summary = "Help on commands. Type '"..program_name.." help <command>' for more."
|
|
13
|
+
|
|
14
|
+
help_arguments = "[<command>]"
|
|
15
|
+
help = [[
|
|
16
|
+
<command> is the command to show help for.
|
|
17
|
+
]]
|
|
18
|
+
|
|
19
|
+
local function print_banner()
|
|
20
|
+
util.printout("\nLuaRocks "..cfg.program_version..", a module deployment system for Lua")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
local function print_section(section)
|
|
24
|
+
util.printout("\n"..section)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
local function get_status(status)
|
|
28
|
+
if status then
|
|
29
|
+
return "ok"
|
|
30
|
+
elseif status == false then
|
|
31
|
+
return "not found"
|
|
32
|
+
else
|
|
33
|
+
return "failed"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
--- Driver function for the "help" command.
|
|
38
|
+
-- @param command string or nil: command to show help for; if not
|
|
39
|
+
-- given, help summaries for all commands are shown.
|
|
40
|
+
-- @return boolean or (nil, string): true if there were no errors
|
|
41
|
+
-- or nil and an error message if an invalid command was requested.
|
|
42
|
+
function run(...)
|
|
43
|
+
local flags, command = util.parse_flags(...)
|
|
44
|
+
|
|
45
|
+
if not command then
|
|
46
|
+
local sys_file, sys_ok, home_file, home_ok = cfg.which_config()
|
|
47
|
+
print_banner()
|
|
48
|
+
print_section("NAME")
|
|
49
|
+
util.printout("\t"..program_name..[[ - ]]..program_description)
|
|
50
|
+
print_section("SYNOPSIS")
|
|
51
|
+
util.printout("\t"..program_name..[[ [--from=<server> | --only-from=<server>] [--to=<tree>] [VAR=VALUE]... <command> [<argument>] ]])
|
|
52
|
+
print_section("GENERAL OPTIONS")
|
|
53
|
+
util.printout([[
|
|
54
|
+
These apply to all commands, as appropriate:
|
|
55
|
+
|
|
56
|
+
--server=<server> Fetch rocks/rockspecs from this server
|
|
57
|
+
(takes priority over config file)
|
|
58
|
+
--only-server=<server> Fetch rocks/rockspecs from this server only
|
|
59
|
+
(overrides any entries in the config file)
|
|
60
|
+
--only-sources=<url> Restrict downloads to paths matching the
|
|
61
|
+
given URL.
|
|
62
|
+
--tree=<tree> Which tree to operate on.
|
|
63
|
+
--local Use the tree in the user's home directory.]])
|
|
64
|
+
print_section("VARIABLES")
|
|
65
|
+
util.printout([[
|
|
66
|
+
Variables from the "variables" table of the configuration file
|
|
67
|
+
can be overriden with VAR=VALUE assignments.]])
|
|
68
|
+
print_section("COMMANDS")
|
|
69
|
+
local names = {}
|
|
70
|
+
for name, command in pairs(commands) do
|
|
71
|
+
table.insert(names, name)
|
|
72
|
+
end
|
|
73
|
+
table.sort(names)
|
|
74
|
+
for _, name in ipairs(names) do
|
|
75
|
+
local command = commands[name]
|
|
76
|
+
util.printout("", name)
|
|
77
|
+
util.printout("\t", command.help_summary)
|
|
78
|
+
end
|
|
79
|
+
print_section("CONFIGURATION")
|
|
80
|
+
util.printout([[
|
|
81
|
+
System configuration file: ]]..sys_file .. " (" .. get_status(sys_ok) ..[[)
|
|
82
|
+
User configuration file: ]]..home_file .. " (" .. get_status(home_ok) ..")\n")
|
|
83
|
+
else
|
|
84
|
+
command = command:gsub("-", "_")
|
|
85
|
+
if commands[command] then
|
|
86
|
+
local arguments = commands[command].help_arguments or "<argument>"
|
|
87
|
+
print_banner()
|
|
88
|
+
print_section("NAME")
|
|
89
|
+
util.printout("\t"..program_name.." "..command.." - "..commands[command].help_summary)
|
|
90
|
+
print_section("SYNOPSIS")
|
|
91
|
+
util.printout("\t"..program_name.." "..command.." "..arguments)
|
|
92
|
+
print_section("DESCRIPTION")
|
|
93
|
+
util.printout("",(commands[command].help:gsub("\n","\n\t"):gsub("\n\t$","")))
|
|
94
|
+
print_section("SEE ALSO")
|
|
95
|
+
util.printout("","'luarocks help' for general options and configuration.\n")
|
|
96
|
+
else
|
|
97
|
+
return nil, "Unknown command '"..command.."'"
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
return true
|
|
101
|
+
end
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
|
|
2
|
+
--- Module which builds the index.html page to be used in rocks servers.
|
|
3
|
+
module("luarocks.index", package.seeall)
|
|
4
|
+
|
|
5
|
+
local util = require("luarocks.util")
|
|
6
|
+
local fs = require("luarocks.fs")
|
|
7
|
+
local deps = require("luarocks.deps")
|
|
8
|
+
local persist = require("luarocks.persist")
|
|
9
|
+
local dir = require("luarocks.dir")
|
|
10
|
+
local manif = require("luarocks.manif")
|
|
11
|
+
|
|
12
|
+
local ext_url_target = ' target="_blank"'
|
|
13
|
+
|
|
14
|
+
local index_header = [[
|
|
15
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
16
|
+
<html>
|
|
17
|
+
<head>
|
|
18
|
+
<title>Available rocks</title>
|
|
19
|
+
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
|
20
|
+
<style>
|
|
21
|
+
body {
|
|
22
|
+
background-color: white;
|
|
23
|
+
font-family: "bitstream vera sans", "verdana", "sans";
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
}
|
|
26
|
+
a {
|
|
27
|
+
color: #0000c0;
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
}
|
|
30
|
+
a:hover {
|
|
31
|
+
text-decoration: underline;
|
|
32
|
+
}
|
|
33
|
+
td.main {
|
|
34
|
+
border-style: none;
|
|
35
|
+
}
|
|
36
|
+
blockquote {
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
}
|
|
39
|
+
td.package {
|
|
40
|
+
background-color: #f0f0f0;
|
|
41
|
+
vertical-align: top;
|
|
42
|
+
}
|
|
43
|
+
td.spacer {
|
|
44
|
+
height: 5px;
|
|
45
|
+
}
|
|
46
|
+
td.version {
|
|
47
|
+
background-color: #d0d0d0;
|
|
48
|
+
vertical-align: top;
|
|
49
|
+
text-align: left;
|
|
50
|
+
padding: 5px;
|
|
51
|
+
width: 100px;
|
|
52
|
+
}
|
|
53
|
+
p.manifest {
|
|
54
|
+
font-size: 8px;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
57
|
+
</head>
|
|
58
|
+
<body>
|
|
59
|
+
<h1>Available rocks</h1>
|
|
60
|
+
<p>
|
|
61
|
+
Lua modules available from this location for use with <a href="http://www.luarocks.org">LuaRocks</a>:
|
|
62
|
+
</p>
|
|
63
|
+
<table class="main">
|
|
64
|
+
]]
|
|
65
|
+
|
|
66
|
+
local index_package_start = [[
|
|
67
|
+
<td class="package">
|
|
68
|
+
<p><a name="$anchor"></a><b>$package</b> - $summary<br/>
|
|
69
|
+
</p><blockquote><p>$detailed<br/>
|
|
70
|
+
$externaldependencies
|
|
71
|
+
<font size="-1"><a href="$original">latest sources</a> $homepage | License: $license</font></p>
|
|
72
|
+
</blockquote></a></td>
|
|
73
|
+
<td class="version">
|
|
74
|
+
]]
|
|
75
|
+
|
|
76
|
+
local index_package_end = [[
|
|
77
|
+
</td></tr>
|
|
78
|
+
<tr><td colspan="2" class="spacer"></td></tr>
|
|
79
|
+
]]
|
|
80
|
+
|
|
81
|
+
local index_footer = [[
|
|
82
|
+
</table>
|
|
83
|
+
<p class="manifest">
|
|
84
|
+
<a href="manifest">manifest file</a>
|
|
85
|
+
</p>
|
|
86
|
+
</body>
|
|
87
|
+
</html>
|
|
88
|
+
]]
|
|
89
|
+
|
|
90
|
+
function format_external_dependencies(rockspec)
|
|
91
|
+
if rockspec.external_dependencies then
|
|
92
|
+
local deplist = {}
|
|
93
|
+
local listed_set = {}
|
|
94
|
+
local plats = nil
|
|
95
|
+
for name, desc in util.sortedpairs(rockspec.external_dependencies) do
|
|
96
|
+
if name ~= "platforms" then
|
|
97
|
+
table.insert(deplist, name:lower())
|
|
98
|
+
listed_set[name] = true
|
|
99
|
+
else
|
|
100
|
+
plats = desc
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
if plats then
|
|
104
|
+
for plat, entries in util.sortedpairs(plats) do
|
|
105
|
+
for name, desc in util.sortedpairs(entries) do
|
|
106
|
+
if not listed_set[name] then
|
|
107
|
+
table.insert(deplist, name:lower() .. " (on "..plat..")")
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
return '<p><b>External dependencies:</b> ' .. table.concat(deplist, ', ').. '</p>'
|
|
113
|
+
else
|
|
114
|
+
return ""
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
function make_index(repo)
|
|
119
|
+
if not fs.is_dir(repo) then
|
|
120
|
+
return nil, "Cannot access repository at "..repo
|
|
121
|
+
end
|
|
122
|
+
local manifest = manif.load_manifest(repo)
|
|
123
|
+
local out = io.open(dir.path(repo, "index.html"), "w")
|
|
124
|
+
|
|
125
|
+
out:write(index_header)
|
|
126
|
+
for package, version_list in util.sortedpairs(manifest.repository) do
|
|
127
|
+
local latest_rockspec = nil
|
|
128
|
+
local output = index_package_start
|
|
129
|
+
for version, data in util.sortedpairs(version_list, deps.compare_versions) do
|
|
130
|
+
local versions = {}
|
|
131
|
+
output = output..version..': '
|
|
132
|
+
table.sort(data, function(a,b) return a.arch < b.arch end)
|
|
133
|
+
for _, item in ipairs(data) do
|
|
134
|
+
local link = '<a href="$url">'..item.arch..'</a>'
|
|
135
|
+
if item.arch == 'rockspec' then
|
|
136
|
+
local rs = ("%s-%s.rockspec"):format(package, version)
|
|
137
|
+
if not latest_rockspec then latest_rockspec = rs end
|
|
138
|
+
link = link:gsub("$url", rs)
|
|
139
|
+
else
|
|
140
|
+
link = link:gsub("$url", ("%s-%s.%s.rock"):format(package, version, item.arch))
|
|
141
|
+
end
|
|
142
|
+
table.insert(versions, link)
|
|
143
|
+
end
|
|
144
|
+
output = output .. table.concat(versions, ', ') .. '<br/>'
|
|
145
|
+
end
|
|
146
|
+
output = output .. index_package_end
|
|
147
|
+
if latest_rockspec then
|
|
148
|
+
local rockspec = persist.load_into_table(dir.path(repo, latest_rockspec))
|
|
149
|
+
local descript = rockspec.description or {}
|
|
150
|
+
local vars = {
|
|
151
|
+
anchor = package,
|
|
152
|
+
package = rockspec.package,
|
|
153
|
+
original = rockspec.source.url,
|
|
154
|
+
summary = descript.summary or "",
|
|
155
|
+
detailed = descript.detailed or "",
|
|
156
|
+
license = descript.license or "N/A",
|
|
157
|
+
homepage = descript.homepage and ('| <a href="'..descript.homepage..'"'..ext_url_target..'>project homepage</a>') or "",
|
|
158
|
+
externaldependencies = format_external_dependencies(rockspec)
|
|
159
|
+
}
|
|
160
|
+
vars.detailed = vars.detailed:gsub("\n\n", "</p><p>"):gsub("%s+", " ")
|
|
161
|
+
vars.detailed = vars.detailed:gsub("(https?://[a-zA-Z0-9%.%%-_%+%[%]=%?&/$@;:]+)", '<a href="%1"'..ext_url_target..'>%1</a>')
|
|
162
|
+
output = output:gsub("$(%w+)", vars)
|
|
163
|
+
else
|
|
164
|
+
output = output:gsub("$anchor", package)
|
|
165
|
+
output = output:gsub("$package", package)
|
|
166
|
+
output = output:gsub("$(%w+)", "")
|
|
167
|
+
end
|
|
168
|
+
out:write(output)
|
|
169
|
+
end
|
|
170
|
+
out:write(index_footer)
|
|
171
|
+
out:close()
|
|
172
|
+
end
|