From a1821035d3eb167d6ac4017368297ec48ce1bf98 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Fri, 30 Jul 2021 22:44:11 +0100 Subject: [PATCH] Add a bit of version information to the bios It's probably the lowest traffic module :p. Also (somewhat) improve the deprecated messages in os.loadAPI. We really need a proper article on require and converting from os.loadAPI. --- build.gradle | 1 - doc/stub/global.lua | 5 +++++ doc/stub/os.lua | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index a25010f58..069723644 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,6 @@ buildscript { } } dependencies { - classpath 'com.google.code.gson:gson:2.8.1' classpath 'net.minecraftforge.gradle:ForgeGradle:5.0.24' } } diff --git a/doc/stub/global.lua b/doc/stub/global.lua index ebeb66452..a2d54fa12 100644 --- a/doc/stub/global.lua +++ b/doc/stub/global.lua @@ -101,6 +101,9 @@ the prompt. write("> ") local msg = read(nil, history, function(text) return completion.choice(text, choices) end, "app") print(msg) + +@changed 1.74 Added `completeFn` parameter. +@changed 1.80pr1 Added `default` parameter. ]] function read(replaceChar, history, completeFn, default) end @@ -108,6 +111,7 @@ function read(replaceChar, history, completeFn, default) end -- -- For example, `ComputerCraft 1.93.0 (Minecraft 1.15.2)`. -- @usage _HOST +-- @since 1.76 _HOST = _HOST --[[- The default computer settings as defined in the ComputerCraft @@ -121,5 +125,6 @@ An example value to disable autocompletion: shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false @usage _CC_DEFAULT_SETTINGS +@since 1.77 ]] _CC_DEFAULT_SETTINGS = _CC_DEFAULT_SETTINGS diff --git a/doc/stub/os.lua b/doc/stub/os.lua index 89a472bf3..da03257c7 100644 --- a/doc/stub/os.lua +++ b/doc/stub/os.lua @@ -2,9 +2,6 @@ --[[- Loads the given API into the global environment. -**Warning** This function is deprecated. Use of this function will pollute the -global table, use @{require} instead. - This function loads and executes the file at the given path, and all global variables and functions exported by it will by available through the use of `myAPI.`, where `myAPI` is the base name of the API file. @@ -12,7 +9,10 @@ variables and functions exported by it will by available through the use of @tparam string path The path of the API to load. @treturn boolean Whether or not the API was successfully loaded. -@deprecated Use @{require}. +@deprecated When possible it's best to avoid using this function. It pollutes +the global table and can mask errors. + +@{require} should be used to load libraries instead. ]] function loadAPI(path) end @@ -21,7 +21,7 @@ function loadAPI(path) end -- This effectively removes the specified table from `_G`. -- -- @tparam string name The name of the API to unload. --- @deprecated Use @{require}. +-- @deprecated See @{os.loadAPI} for why. function unloadAPI(name) end --[[- Pause execution of the current thread and waits for any events matching