Skip to content

rajshah11/ruby-book

Repository files navigation

RubyBook

RubyBook is a VSCode extension that provides a notebook interface for Ruby code. 📓

This extension spawns a pry process in the background to allow users to create experiences with connected, executable Ruby cells and informational Markdown cells. 🎉

Currently, this extension works for Mac and Linux systems only.

Features

  • Run Ruby code within cells
  • Organize multiple cells in a file with data flowing from one cell to the next
  • Use Markdown to create human-readable cells documentating the code
  • Uses the power of pry to run code and maintain variables and results between multiple cells.


RubyBook Demo

Requirements

Mac or Linux system

Note: The extension spawns a process by just running pry, so please make sure that pry is installed properly and added to the PATH. Easiest way to check is to run pry from terminal.

Installation

Search 'RubyBook' in the VSCode extensions tab

RubyBook - VSCode Extenstion URL

VSCode Extension Installation

How to use

  • Open or create a file with the extension .rubybook
  • Search for RubyBook in the VSCode command palette

Extension Settings

No settings, as of now. Configuration settings like execution timeouts, polling interval for output, etc. coming soon. Currently, the execution does not timeout and tries to run forever. The pry process is polled for output every 500 ms.

Known Issues

  • The extension adopts a little hacky method to poll for completion of a code cell. It checks for the existence of the pry prompt (for ex., [2] pry(main)> ) instead of gracefully inspecting Node.js I/O streams.
  • No configuration settings for execution timeouts or polling intervals. Note: You can stop execution of a command through the VSCode UI.
  • Window not focused on a newly created RubyBook.

Feature Ideas

  • Short-term

    • Configuration settings
    • Add comments in the extension code
    • Add example .rubybook files
    • Add language icon
  • Medium-term

    • A custom renderer to colorize and pretty print output and errors for code execution cells
  • Long-term

If you have any issues, bugs or suggestions, please feel free to create a Github issue

If you are willing contribute, please start a discussion and feel free to create a pull request

Release Notes

1.0.0

Initial release of RubyBook 🎉

About

A basic notebook interface for Ruby code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published