rufus-lua-win 5.1.5
Sign up to get free protection for your applications and to get access to all the features.
- 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,399 @@
|
|
1
|
+
|
2
|
+
--- Module implementing the LuaRocks "search" command.
|
3
|
+
-- Queries LuaRocks servers.
|
4
|
+
module("luarocks.search", package.seeall)
|
5
|
+
|
6
|
+
local dir = require("luarocks.dir")
|
7
|
+
local path = require("luarocks.path")
|
8
|
+
local manif = require("luarocks.manif")
|
9
|
+
local deps = require("luarocks.deps")
|
10
|
+
local cfg = require("luarocks.cfg")
|
11
|
+
local util = require("luarocks.util")
|
12
|
+
|
13
|
+
help_summary = "Query the LuaRocks servers."
|
14
|
+
help_arguments = "[--source] [--binary] { <name> [<version>] | --all }"
|
15
|
+
help = [[
|
16
|
+
--source Return only rockspecs and source rocks,
|
17
|
+
to be used with the "build" command.
|
18
|
+
--binary Return only pure Lua and binary rocks (rocks that can be used
|
19
|
+
with the "install" command without requiring a C toolchain).
|
20
|
+
--all List all contents of the server that are suitable to
|
21
|
+
this platform, do not filter by name.
|
22
|
+
]]
|
23
|
+
|
24
|
+
--- Convert the arch field of a query table to table format.
|
25
|
+
-- @param query table: A query table.
|
26
|
+
local function query_arch_as_table(query)
|
27
|
+
local format = type(query.arch)
|
28
|
+
if format == "table" then
|
29
|
+
return
|
30
|
+
elseif format == "nil" then
|
31
|
+
local accept = {}
|
32
|
+
accept["src"] = true
|
33
|
+
accept["all"] = true
|
34
|
+
accept["rockspec"] = true
|
35
|
+
accept["installed"] = true
|
36
|
+
accept[cfg.arch] = true
|
37
|
+
query.arch = accept
|
38
|
+
elseif format == "string" then
|
39
|
+
local accept = {}
|
40
|
+
for a in query.arch:gmatch("[%w_-]+") do
|
41
|
+
accept[a] = true
|
42
|
+
end
|
43
|
+
query.arch = accept
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
--- Store a search result (a rock or rockspec) in the results table.
|
48
|
+
-- @param results table: The results table, where keys are package names and
|
49
|
+
-- versions are tables matching version strings to an array of servers.
|
50
|
+
-- @param name string: Package name.
|
51
|
+
-- @param version string: Package version.
|
52
|
+
-- @param arch string: Architecture of rock ("all", "src" or platform
|
53
|
+
-- identifier), "rockspec" or "installed"
|
54
|
+
-- @param repo string: Pathname of a local repository of URL of
|
55
|
+
-- rocks server.
|
56
|
+
local function store_result(results, name, version, arch, repo)
|
57
|
+
assert(type(results) == "table")
|
58
|
+
assert(type(name) == "string")
|
59
|
+
assert(type(version) == "string")
|
60
|
+
assert(type(arch) == "string")
|
61
|
+
assert(type(repo) == "string")
|
62
|
+
|
63
|
+
if not results[name] then results[name] = {} end
|
64
|
+
if not results[name][version] then results[name][version] = {} end
|
65
|
+
table.insert(results[name][version], {
|
66
|
+
arch = arch,
|
67
|
+
repo = repo
|
68
|
+
})
|
69
|
+
end
|
70
|
+
|
71
|
+
--- Test the name field of a query.
|
72
|
+
-- If query has a boolean field exact_name set to false,
|
73
|
+
-- then substring match is performed; otherwise, exact string
|
74
|
+
-- comparison is done.
|
75
|
+
-- @param query table: A query in dependency table format.
|
76
|
+
-- @param name string: A package name.
|
77
|
+
-- @return boolean: True if names match, false otherwise.
|
78
|
+
local function match_name(query, name)
|
79
|
+
assert(type(query) == "table")
|
80
|
+
assert(type(name) == "string")
|
81
|
+
if query.exact_name == false then
|
82
|
+
return name:find(query.name, 0, true) and true or false
|
83
|
+
else
|
84
|
+
return name == query.name
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
--- Store a match in a results table if version matches query.
|
89
|
+
-- Name, version, arch and repository path are stored in a given
|
90
|
+
-- table, optionally checking if version and arch (if given) match
|
91
|
+
-- a query.
|
92
|
+
-- @param results table: The results table, where keys are package names and
|
93
|
+
-- versions are tables matching version strings to an array of servers.
|
94
|
+
-- @param repo string: URL or pathname of the repository.
|
95
|
+
-- @param name string: The name of the package being tested.
|
96
|
+
-- @param version string: The version of the package being tested.
|
97
|
+
-- @param arch string: The arch of the package being tested.
|
98
|
+
-- @param query table: A table describing the query in dependency
|
99
|
+
-- format (for example, {name = "filesystem", exact_name = false,
|
100
|
+
-- constraints = {op = "~>", version = {1,0}}}, arch = "rockspec").
|
101
|
+
-- If the arch field is omitted, the local architecture (cfg.arch)
|
102
|
+
-- is used. The special value "any" is also recognized, returning all
|
103
|
+
-- matches regardless of architecture.
|
104
|
+
local function store_if_match(results, repo, name, version, arch, query)
|
105
|
+
if match_name(query, name) then
|
106
|
+
if query.arch[arch] or query.arch["any"] then
|
107
|
+
if deps.match_constraints(deps.parse_version(version), query.constraints) then
|
108
|
+
store_result(results, name, version, arch, repo)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
--- Perform search on a local repository.
|
115
|
+
-- @param repo string: The pathname of the local repository.
|
116
|
+
-- @param query table: A table describing the query in dependency
|
117
|
+
-- format (for example, {name = "filesystem", exact_name = false,
|
118
|
+
-- constraints = {op = "~>", version = {1,0}}}, arch = "rockspec").
|
119
|
+
-- If the arch field is omitted, the local architecture (cfg.arch)
|
120
|
+
-- is used. The special value "any" is also recognized, returning all
|
121
|
+
-- matches regardless of architecture.
|
122
|
+
-- @param results table or nil: If given, this table will store the
|
123
|
+
-- results; if not given, a new table will be created.
|
124
|
+
-- @param table: The results table, where keys are package names and
|
125
|
+
-- versions are tables matching version strings to an array of servers.
|
126
|
+
-- If a table was given in the "results" parameter, that is the result value.
|
127
|
+
function disk_search(repo, query, results)
|
128
|
+
assert(type(repo) == "string")
|
129
|
+
assert(type(query) == "table")
|
130
|
+
assert(type(results) == "table" or not results)
|
131
|
+
|
132
|
+
local fs = require("luarocks.fs")
|
133
|
+
|
134
|
+
if not results then
|
135
|
+
results = {}
|
136
|
+
end
|
137
|
+
query_arch_as_table(query)
|
138
|
+
|
139
|
+
for _, name in pairs(fs.list_dir(repo)) do
|
140
|
+
local pathname = dir.path(repo, name)
|
141
|
+
local rname, rversion, rarch = path.parse_name(name)
|
142
|
+
if fs.is_dir(pathname) then
|
143
|
+
for _, version in pairs(fs.list_dir(pathname)) do
|
144
|
+
if version:match("-%d+$") then
|
145
|
+
store_if_match(results, repo, name, version, "installed", query)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
elseif rname then
|
149
|
+
store_if_match(results, repo, rname, rversion, rarch, query)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
return results
|
153
|
+
end
|
154
|
+
|
155
|
+
--- Perform search on a rocks server.
|
156
|
+
-- @param results table: The results table, where keys are package names and
|
157
|
+
-- versions are tables matching version strings to an array of servers.
|
158
|
+
-- @param repo string: The URL of the rocks server.
|
159
|
+
-- @param query table: A table describing the query in dependency
|
160
|
+
-- format (for example, {name = "filesystem", exact_name = false,
|
161
|
+
-- constraints = {op = "~>", version = {1,0}}}, arch = "rockspec").
|
162
|
+
-- If the arch field is omitted, the local architecture (cfg.arch)
|
163
|
+
-- is used. The special value "any" is also recognized, returning all
|
164
|
+
-- matches regardless of architecture.
|
165
|
+
-- @return true or, in case of errors, nil and an error message.
|
166
|
+
function manifest_search(results, repo, query)
|
167
|
+
assert(type(results) == "table")
|
168
|
+
assert(type(repo) == "string")
|
169
|
+
assert(type(query) == "table")
|
170
|
+
|
171
|
+
query_arch_as_table(query)
|
172
|
+
local manifest, err = manif.load_manifest(repo)
|
173
|
+
if not manifest then
|
174
|
+
return nil, "Failed loading manifest: "..err
|
175
|
+
end
|
176
|
+
for name, versions in pairs(manifest.repository) do
|
177
|
+
for version, items in pairs(versions) do
|
178
|
+
for _, item in ipairs(items) do
|
179
|
+
store_if_match(results, repo, name, version, item.arch, query)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
return true
|
184
|
+
end
|
185
|
+
|
186
|
+
--- Search on all configured rocks servers.
|
187
|
+
-- @param query table: A dependency query.
|
188
|
+
-- @return table or (nil, string): A table where keys are package names
|
189
|
+
-- and values are tables matching version strings to an array of
|
190
|
+
-- rocks servers; if no results are found, an empty table is returned.
|
191
|
+
-- In case of errors, nil and and error message are returned.
|
192
|
+
function search_repos(query)
|
193
|
+
assert(type(query) == "table")
|
194
|
+
|
195
|
+
local results = {}
|
196
|
+
for _, repo in ipairs(cfg.rocks_servers) do
|
197
|
+
local protocol, pathname = dir.split_url(repo)
|
198
|
+
if protocol == "file" then
|
199
|
+
repo = pathname
|
200
|
+
end
|
201
|
+
local ok, err = manifest_search(results, repo, query)
|
202
|
+
if not ok then
|
203
|
+
util.warning("Failed searching manifest: "..err)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
return results
|
207
|
+
end
|
208
|
+
|
209
|
+
--- Prepare a query in dependency table format.
|
210
|
+
-- @param name string: The query name.
|
211
|
+
-- @param version string or nil:
|
212
|
+
-- @return table: A query in table format
|
213
|
+
function make_query(name, version)
|
214
|
+
assert(type(name) == "string")
|
215
|
+
assert(type(version) == "string" or not version)
|
216
|
+
|
217
|
+
local query = {
|
218
|
+
name = name,
|
219
|
+
constraints = {}
|
220
|
+
}
|
221
|
+
if version then
|
222
|
+
table.insert(query.constraints, { op = "==", version = deps.parse_version(version)})
|
223
|
+
end
|
224
|
+
return query
|
225
|
+
end
|
226
|
+
|
227
|
+
--- Get the URL for the latest in a set of versions.
|
228
|
+
-- @param name string: The package name to be used in the URL.
|
229
|
+
-- @param versions table: An array of version informations, as stored
|
230
|
+
-- in search results tables.
|
231
|
+
-- @return string or nil: the URL for the latest version if one could
|
232
|
+
-- be picked, or nil.
|
233
|
+
local function pick_latest_version(name, versions)
|
234
|
+
assert(type(name) == "string")
|
235
|
+
assert(type(versions) == "table")
|
236
|
+
|
237
|
+
local vtables = {}
|
238
|
+
for v, _ in pairs(versions) do
|
239
|
+
table.insert(vtables, deps.parse_version(v))
|
240
|
+
end
|
241
|
+
table.sort(vtables)
|
242
|
+
local version = vtables[#vtables].string
|
243
|
+
local items = versions[version]
|
244
|
+
if items then
|
245
|
+
local pick = 1
|
246
|
+
for i, item in ipairs(items) do
|
247
|
+
if (item.arch == 'src' and items[pick].arch == 'rockspec')
|
248
|
+
or (item.arch ~= 'src' and item.arch ~= 'rockspec') then
|
249
|
+
pick = i
|
250
|
+
end
|
251
|
+
end
|
252
|
+
return path.make_url(items[pick].repo, name, version, items[pick].arch)
|
253
|
+
end
|
254
|
+
return nil
|
255
|
+
end
|
256
|
+
|
257
|
+
--- Attempt to get a single URL for a given search.
|
258
|
+
-- @param query table: A dependency query.
|
259
|
+
-- @return string or table or (nil, string): URL for matching rock if
|
260
|
+
-- a single one was found, a table of candidates if it could not narrow to
|
261
|
+
-- a single result, or nil followed by an error message.
|
262
|
+
function find_suitable_rock(query)
|
263
|
+
assert(type(query) == "table")
|
264
|
+
|
265
|
+
local results, err = search_repos(query)
|
266
|
+
if not results then
|
267
|
+
return nil, err
|
268
|
+
end
|
269
|
+
local first = next(results)
|
270
|
+
if not first then
|
271
|
+
return nil, "No results matching query were found."
|
272
|
+
elseif not next(results, first) then
|
273
|
+
return pick_latest_version(query.name, results[first])
|
274
|
+
else
|
275
|
+
return results
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
--- Print a list of rocks/rockspecs on standard output.
|
280
|
+
-- @param results table: A table where keys are package names and versions
|
281
|
+
-- are tables matching version strings to an array of rocks servers.
|
282
|
+
-- @param show_repo boolean or nil: Whether to show repository
|
283
|
+
-- @param long boolean or nil: Whether to show module files
|
284
|
+
-- information or not. Default is true.
|
285
|
+
function print_results(results, show_repo, long)
|
286
|
+
assert(type(results) == "table")
|
287
|
+
assert(type(show_repo) == "boolean" or not show_repo)
|
288
|
+
-- Force display of repo location for the time being
|
289
|
+
show_repo = true -- show_repo == nil and true or show_repo
|
290
|
+
|
291
|
+
for package, versions in util.sortedpairs(results) do
|
292
|
+
util.printout(package)
|
293
|
+
for version, repos in util.sortedpairs(versions, deps.compare_versions) do
|
294
|
+
if show_repo then
|
295
|
+
for _, repo in ipairs(repos) do
|
296
|
+
util.printout(" "..version.." ("..repo.arch..") - "..repo.repo)
|
297
|
+
end
|
298
|
+
else
|
299
|
+
util.printout(" "..version)
|
300
|
+
end
|
301
|
+
end
|
302
|
+
util.printout()
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
--- Splits a list of search results into two lists, one for "source" results
|
307
|
+
-- to be used with the "build" command, and one for "binary" results to be
|
308
|
+
-- used with the "install" command.
|
309
|
+
-- @param results table: A search results table.
|
310
|
+
-- @return (table, table): Two tables, one for source and one for binary
|
311
|
+
-- results.
|
312
|
+
local function split_source_and_binary_results(results)
|
313
|
+
local sources, binaries = {}, {}
|
314
|
+
for name, versions in pairs(results) do
|
315
|
+
for version, repos in pairs(versions) do
|
316
|
+
for _, repo in ipairs(repos) do
|
317
|
+
local where = sources
|
318
|
+
if repo.arch == "all" or repo.arch == cfg.arch then
|
319
|
+
where = binaries
|
320
|
+
end
|
321
|
+
store_result(where, name, version, repo.arch, repo.repo)
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
325
|
+
return sources, binaries
|
326
|
+
end
|
327
|
+
|
328
|
+
--- Given a name and optionally a version, try to find in the rocks
|
329
|
+
-- servers a single .src.rock or .rockspec file that satisfies
|
330
|
+
-- the request, and run the given function on it; or display to the
|
331
|
+
-- user possibilities if it couldn't narrow down a single match.
|
332
|
+
-- @param action function: A function that takes a .src.rock or
|
333
|
+
-- .rockspec URL as a parameter.
|
334
|
+
-- @param name string: A rock name
|
335
|
+
-- @param version string or nil: A version number may also be given.
|
336
|
+
-- @return The result of the action function, or nil and an error message.
|
337
|
+
function act_on_src_or_rockspec(action, name, version, ...)
|
338
|
+
assert(type(action) == "function")
|
339
|
+
assert(type(name) == "string")
|
340
|
+
assert(type(version) == "string" or not version)
|
341
|
+
|
342
|
+
local query = make_query(name, version)
|
343
|
+
query.arch = "src|rockspec"
|
344
|
+
local results, err = find_suitable_rock(query)
|
345
|
+
if type(results) == "string" then
|
346
|
+
return action(results, ...)
|
347
|
+
elseif type(results) == "table" and next(results) then
|
348
|
+
util.printout("Multiple search results were returned.")
|
349
|
+
util.printout()
|
350
|
+
util.printout("Search results:")
|
351
|
+
util.printout("---------------")
|
352
|
+
print_results(results)
|
353
|
+
return nil, "Please narrow your query."
|
354
|
+
else
|
355
|
+
return nil, "Could not find a result named "..name..(version and " "..version or "").."."
|
356
|
+
end
|
357
|
+
end
|
358
|
+
|
359
|
+
--- Driver function for "search" command.
|
360
|
+
-- @param name string: A substring of a rock name to search.
|
361
|
+
-- @param version string or nil: a version may also be passed.
|
362
|
+
-- @return boolean or (nil, string): True if build was successful; nil and an
|
363
|
+
-- error message otherwise.
|
364
|
+
function run(...)
|
365
|
+
local flags, name, version = util.parse_flags(...)
|
366
|
+
|
367
|
+
if flags["all"] then
|
368
|
+
name, version = "", nil
|
369
|
+
end
|
370
|
+
|
371
|
+
if type(name) ~= "string" and not flags["all"] then
|
372
|
+
return nil, "Enter name and version or use --all; see help."
|
373
|
+
end
|
374
|
+
|
375
|
+
local query = make_query(name:lower(), version)
|
376
|
+
query.exact_name = false
|
377
|
+
local results, err = search_repos(query)
|
378
|
+
if not results then
|
379
|
+
return nil, err
|
380
|
+
end
|
381
|
+
util.printout()
|
382
|
+
util.printout("Search results:")
|
383
|
+
util.printout("===============")
|
384
|
+
util.printout()
|
385
|
+
local sources, binaries = split_source_and_binary_results(results)
|
386
|
+
if next(sources) and not flags["binary"] then
|
387
|
+
util.printout("Rockspecs and source rocks:")
|
388
|
+
util.printout("---------------------------")
|
389
|
+
util.printout()
|
390
|
+
print_results(sources, true)
|
391
|
+
end
|
392
|
+
if next(binaries) and not flags["source"] then
|
393
|
+
util.printout("Binary and pure-Lua rocks:")
|
394
|
+
util.printout("--------------------------")
|
395
|
+
util.printout()
|
396
|
+
print_results(binaries, true)
|
397
|
+
end
|
398
|
+
return true
|
399
|
+
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
|
2
|
+
--- Module implementing the LuaRocks "show" command.
|
3
|
+
-- Shows information about an installed rock.
|
4
|
+
module("luarocks.show", package.seeall)
|
5
|
+
|
6
|
+
local search = require("luarocks.search")
|
7
|
+
local cfg = require("luarocks.cfg")
|
8
|
+
local util = require("luarocks.util")
|
9
|
+
local path = require("luarocks.path")
|
10
|
+
local dir = require("luarocks.dir")
|
11
|
+
local deps = require("luarocks.deps")
|
12
|
+
local fetch = require("luarocks.fetch")
|
13
|
+
local manif = require("luarocks.manif")
|
14
|
+
help_summary = "Shows information about an installed rock."
|
15
|
+
|
16
|
+
help = [[
|
17
|
+
<argument> is an existing package name.
|
18
|
+
Without any flags, show all module information.
|
19
|
+
With these flags, return only the desired information:
|
20
|
+
|
21
|
+
--home home page of project
|
22
|
+
--modules all modules provided by this package as used by require()
|
23
|
+
--deps packages this package depends on
|
24
|
+
--rockspec the full path of the rockspec file
|
25
|
+
--mversion the package version
|
26
|
+
--tree local tree where rock is installed
|
27
|
+
--rock-dir data directory of the installed rock
|
28
|
+
]]
|
29
|
+
|
30
|
+
local function keys_as_string(t, sep)
|
31
|
+
return table.concat(util.keys(t), sep or " ")
|
32
|
+
end
|
33
|
+
|
34
|
+
local function word_wrap(line)
|
35
|
+
local width = tonumber(os.getenv("COLUMNS")) or 80
|
36
|
+
if width > 80 then width = 80 end
|
37
|
+
if #line > width then
|
38
|
+
local brk = width
|
39
|
+
while brk > 0 and line:sub(brk, brk) ~= " " do
|
40
|
+
brk = brk - 1
|
41
|
+
end
|
42
|
+
if brk > 0 then
|
43
|
+
return line:sub(1, brk-1) .. "\n" .. word_wrap(line:sub(brk+1))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
return line
|
47
|
+
end
|
48
|
+
|
49
|
+
local function format_text(text)
|
50
|
+
text = text:gsub("^%s*",""):gsub("%s$", ""):gsub("\n[ \t]+","\n"):gsub("([^\n])\n([^\n])","%1 %2")
|
51
|
+
local paragraphs = util.split_string(text, "\n\n")
|
52
|
+
for n, line in ipairs(paragraphs) do
|
53
|
+
paragraphs[n] = word_wrap(line)
|
54
|
+
end
|
55
|
+
return (table.concat(paragraphs, "\n\n"):gsub("%s$", ""))
|
56
|
+
end
|
57
|
+
|
58
|
+
--- Driver function for "show" command.
|
59
|
+
-- @param name or nil: an existing package name.
|
60
|
+
-- @param version string or nil: a version may also be passed.
|
61
|
+
-- @return boolean: True if succeeded, nil on errors.
|
62
|
+
function run(...)
|
63
|
+
local flags, name, version = util.parse_flags(...)
|
64
|
+
if not name then
|
65
|
+
return nil, "Argument missing, see help."
|
66
|
+
end
|
67
|
+
local results = {}
|
68
|
+
local query = search.make_query(name, version)
|
69
|
+
query.exact_name = true
|
70
|
+
local tree_map = {}
|
71
|
+
for _, tree in ipairs(cfg.rocks_trees) do
|
72
|
+
local rocks_dir = path.rocks_dir(tree)
|
73
|
+
tree_map[rocks_dir] = tree
|
74
|
+
search.manifest_search(results, rocks_dir, query)
|
75
|
+
end
|
76
|
+
|
77
|
+
if not next(results) then --
|
78
|
+
return nil,"cannot find package "..name.."\nUse 'list' to find installed rocks"
|
79
|
+
end
|
80
|
+
|
81
|
+
local version,repo_url
|
82
|
+
local package, versions = util.sortedpairs(results)()
|
83
|
+
--question: what do we do about multiple versions? This should
|
84
|
+
--give us the latest version on the last repo (which is usually the global one)
|
85
|
+
for vs, repos in util.sortedpairs(versions, deps.compare_versions) do
|
86
|
+
if not version then version = vs end
|
87
|
+
for _, rp in ipairs(repos) do repo_url = rp.repo end
|
88
|
+
end
|
89
|
+
|
90
|
+
|
91
|
+
local repo = tree_map[repo_url]
|
92
|
+
local directory = path.install_dir(name,version,repo)
|
93
|
+
local rockspec_file = path.rockspec_file(name, version, repo)
|
94
|
+
local rockspec, err = fetch.load_local_rockspec(rockspec_file)
|
95
|
+
if not rockspec then return nil,err end
|
96
|
+
|
97
|
+
local descript = rockspec.description or {}
|
98
|
+
local manifest, err = manif.load_manifest(repo_url)
|
99
|
+
if not manifest then return nil,err end
|
100
|
+
local minfo = manifest.repository[name][version][1]
|
101
|
+
|
102
|
+
if flags["tree"] then util.printout(repo)
|
103
|
+
elseif flags["rock-dir"] then util.printout(directory)
|
104
|
+
elseif flags["home"] then util.printout(descript.homepage)
|
105
|
+
elseif flags["modules"] then util.printout(keys_as_string(minfo.modules))
|
106
|
+
elseif flags["deps"] then util.printout(keys_as_string(minfo.dependencies))
|
107
|
+
elseif flags["rockspec"] then util.printout(rockspec_file)
|
108
|
+
elseif flags["mversion"] then util.printout(version)
|
109
|
+
else
|
110
|
+
util.printout()
|
111
|
+
util.printout(rockspec.package.." "..rockspec.version.." - "..(descript.summary or ""))
|
112
|
+
util.printout()
|
113
|
+
if descript.detailed then
|
114
|
+
util.printout(format_text(descript.detailed))
|
115
|
+
util.printout()
|
116
|
+
end
|
117
|
+
if descript.license then
|
118
|
+
util.printout("License: ", descript.license)
|
119
|
+
end
|
120
|
+
if descript.homepage then
|
121
|
+
util.printout("Homepage: ", descript.homepage)
|
122
|
+
end
|
123
|
+
util.printout("Installed in: ", repo)
|
124
|
+
if next(minfo.modules) then
|
125
|
+
util.printout()
|
126
|
+
util.printout("Modules:")
|
127
|
+
util.printout("\t"..keys_as_string(minfo.modules, "\n\t"))
|
128
|
+
end
|
129
|
+
if next(minfo.dependencies) then
|
130
|
+
util.printout()
|
131
|
+
util.printout("Depends on:")
|
132
|
+
util.printout("\t"..keys_as_string(minfo.dependencies, "\n\t"))
|
133
|
+
end
|
134
|
+
util.printout()
|
135
|
+
end
|
136
|
+
return true
|
137
|
+
end
|
138
|
+
|