Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r-unic/rogems
A Ruby to Lua transpiler written in pure Ruby for use in the Roblox game engine
https://github.com/r-unic/rogems
compiler game lua roblox roblox-ruby rogems ruby transpiler
Last synced: about 2 months ago
JSON representation
A Ruby to Lua transpiler written in pure Ruby for use in the Roblox game engine
- Host: GitHub
- URL: https://github.com/r-unic/rogems
- Owner: R-unic
- License: mit
- Created: 2023-01-19T16:56:35.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-08T05:43:57.000Z (over 1 year ago)
- Last Synced: 2024-10-08T13:54:34.033Z (3 months ago)
- Topics: compiler, game, lua, roblox, roblox-ruby, rogems, ruby, transpiler
- Language: Ruby
- Homepage: https://rubygems.org/gems/rogems
- Size: 4.47 MB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# RoGems
RoGems is a Ruby to Lua transpiler written for use with Roblox (like roblox-ts)
It is **unfinished**.## Examples
See examples for more### Lava Bricks
Ruby Source
```rb
collection = game.GetService("CollectionService")
lava_bricks = collection.GetTagged("Lava")lava_bricks.each do |lava|
lava.Touched.Connect do |hit|
parent = hit.Parent
humanoid = parent.FindFirstChildOfClass("Humanoid")
if !humanoid.nil? then
humanoid.TakeDamage(humanoid.Health)
end
end
end
```Lua Output
```lua
local ruby = require(game.ReplicatedStorage.Ruby.Runtime)local collection = game:GetService("CollectionService")
local lava_bricks = collection:GetTagged("Lava")
for lava in ruby.list(lava_bricks) do
(type(lava.Touched) == "function" and lava:Touched() or lava.Touched):Connect(function(hit)
local parent = (type(hit.Parent) == "function" and hit:Parent() or hit.Parent)
local humanoid = parent:FindFirstChildOfClass("Humanoid")
if humanoid == nil then
humanoid:TakeDamage((type(humanoid.Health) == "function" and humanoid:Health() or humanoid.Health))
end
end)
end
```