Skip to content

Commit c635d6d

Browse files
committed
changes
1 parent 584d432 commit c635d6d

2 files changed

Lines changed: 39 additions & 22 deletions

File tree

README.md

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
# Lua Additions (beta | not safe for production usage)
1+
# Lua Additions
22

3-
## About
3+
## Warning
4+
### This is a beta version of Lua Additions (use at your own risk).
45

5-
### This library aims to provide enhancements for Roblox and Lua's standard library.
6-
### This library is ready to use (with little modifications) inside of Roblox.
6+
## About
7+
### Lua Additions aims to provide enhancements for Roblox and Lua's standard library.
78
### Most of the methods in this library are directly inspired by the TC39 ECMAScript (JavaScript) standard.
89

9-
## Notice
10-
### Currently we have not released a require-able asset for this repository, therefore you must download this repository and use a tool called Rojo to use it Roblox.
10+
## Installation
11+
1. Download the latest release from the [releases](https://github.com/Inertia-Lighting/lua-additions/releases) page.
12+
2. Insert the `lua-additions[...].rbxm` file into the `Workspace` folder in Roblox Studio.
13+
3. Ensure that the `lua-additions` folder was inserted into the `Workspace` folder.
1114

12-
## Example Usage for Roblox
15+
## Usage
1316
```lua
14-
-- some script
15-
local LA = require(game.Workspace:WaitForChild('lua-additions').MainModule)
17+
-- import lua-additions from your `Workspace` folder
18+
local LA = require(game.Workspace:WaitForChild('lua-additions'):WaitForChild('MainModule'))
1619

1720
local mathProblems = {
18-
add = { 24, 3, 5, 7 }, -- goal: add all of the numbers
19-
subtract = { 24, 3, 5, 7 }, -- goal: subtract all of the numbers
21+
['add'] = { 24, 3, 5, 7 }, -- goal: add all of the numbers
22+
['subtract'] = { 24, 3, 5, 7 }, -- goal: subtract all of the numbers
2023
}
2124

2225
local solvedMathProblems = LA.Table.map(mathProblems, function(mathProblemValues, mathProblemType)
@@ -31,27 +34,41 @@ local solvedMathProblems = LA.Table.map(mathProblems, function(mathProblemValues
3134
end)
3235
end)
3336

34-
print('solvedMathProblems:', solvedMathProblems)
37+
print('Output:')
38+
LA.Table.forEach(solvedMathProblems, function(solvedMathProblemValue, solvedMathProblemType)
39+
print(solvedMathProblemType, ':', solvedMathProblemValue)
40+
end)
3541

36-
-- solvedMathProblems: {
37-
-- add = 39,
38-
-- subtract = 9,
39-
-- }
42+
-- Output:
43+
-- add : 39
44+
-- subtract : 9
4045
```
4146

42-
## Example Testing for Roblox
47+
## Testing
48+
To test this library, you must require the tests module.
4349
```lua
4450
-- some script
45-
local luaAdditionsTestsWereSuccessful = require(game.Workspace:WaitForChild('lua-additions').tests.tests)
51+
local luaAdditionsFolder = game.Workspace:WaitForChild('lua-additions')
52+
local luaAdditionsTestsFolder = luaAdditionsFolder:WaitForChild('tests')
53+
local luaAdditionsTestsFolderScript = luaAdditionsTestsFolder:WaitForChild('tests')
54+
local luaAdditionsTestsWereSuccessful = require(luaAdditionsTestsFolderScript)
4655

4756
print('luaAdditionsTestsWereSuccessful:', luaAdditionsTestsWereSuccessful)
4857

4958
-- luaAdditionsTestsWereSuccessful: true
50-
-- or
51-
-- luaAdditionsTestsWereSuccessful: false
59+
```
60+
Any errors will be outputted to the console.
61+
62+
## Development
63+
To assist with developing this library, you can use Rojo.
64+
```
65+
rojo serve
5266
```
5367

5468
## License
5569

5670
### This repository uses the MIT license.
57-
### Check out the [License](./LICENSE.md).
71+
### You can read the license [here](./LICENSE.md).
72+
73+
## Copyright
74+
Copyright © Inertia Lighting | Some Rights Reserved

tests/tests.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ local rootFolder = testsFolder.Parent
1111

1212
local LA = require(rootFolder.MainModule)
1313

14-
local testsWereSuccessful = spawn(function()
14+
local testsWereSuccessful = pcall(function()
1515
--------------------------------------------------------------------------------------------------------------------------------
1616
-- Testing LA.String
1717
--------------------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)