Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xord/cruby

CRuby Interpreter for macOS and iOS
https://github.com/xord/cruby

cocoapods ios macos ruby

Last synced: about 20 hours ago
JSON representation

CRuby Interpreter for macOS and iOS

Awesome Lists containing this project

README

        

# CRuby Interpreter for macOS and iOS

This library allows you to embed CRuby interpreter to your macOS or iOS app.

![Build](https://github.com/xord/cruby/workflows/Build/badge.svg)

# How To Use

Prepare the following podfile for the Xcode project you want to use CRuby in.

```
platform :ios, '10.0'
pod 'CRuby', git: 'https://github.com/xord/cruby'
```

Run the following in a terminal.

```sh
$ CRUBY_OS=ios pod install --verbose
```
(Due to the long compile time, it is recommended to use the --verbose option)

Where you want to use CRuby, you can evaluate the string as follows.

```objc
CRBValue *result = [CRuby eval:@"[1, 2, 3].map {|n| n ** 2}"];
NSString *string = result.inspect;
NSLog(@"result: %@", string);
```