SelectionRubyEval ============= A Sublime Text plugin to execute ruby code on multiple selections. Installation ------------ Assumes [ruby](https://www.ruby-lang.org) is installed, and that ruby is available in path. Install using [Package Control](https://sublime.wbond.net/) (Recommended), or by cloning this repository into the `Packages` directory. Usage ----- Default key bindings: - OSX: Cmd+Shift+r - Linux: Ctrl+Shift+r - Windows: Ctrl+Shift+r Through Command Palette, find `SelectionRubyEval: evaluate selections` Enter a ruby expression, where the variable `x` will contain the selection as a string. To also evaluate the selection itself as a ruby expression, use `eval(x)`. Outputs are treated as string also, so if the result of an expression is a ruby structure, you can use `#to_s` to get its string representation. Note: Currently, SelectionRubyEval does not handle newlines, so each selection's input and output must reside on one line. Examples -------- ![](https://raw.githubusercontent.com/wiki/jcshih/MultiRubyEval/ex1.gif) ![](https://raw.githubusercontent.com/wiki/jcshih/MultiRubyEval/ex2.gif) ![](https://raw.githubusercontent.com/wiki/jcshih/MultiRubyEval/ex3.gif)