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

https://github.com/shime/uby_interpreter

Ruby-like interpreter implementation
https://github.com/shime/uby_interpreter

Last synced: about 1 year ago
JSON representation

Ruby-like interpreter implementation

Awesome Lists containing this project

README

          

# UbyInterpreter

Ruby-like interpreter implementation.

Based on a [talk](https://www.youtube.com/watch?v=r1JMxJ06I98) by [Ryan Davis](https://github.com/zenspider).

## Features

* Basic numeric types, true, false, strings, arrays, hashes and nil
* Conditional branching and looping
* Primitive and user defined functions
* Local variables and variable scoping
* Test-driven, extensible, patterns-based design
* ~130 LOC for implementation, ~70 LOC for tests
* Fits in one head

## Installation

Add this line to your application's Gemfile:

gem 'uby_interpreter'

And then execute:

$ bundle

Or install it yourself as:

$ gem install uby_interpreter

## Usage

Comes with executable.

Run a file with

$ uby /path/to/your/file

Or simply run

$ ./bin/uby example.rb

to see what this little fellow can do!

## Running tests

$ rake

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request