ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Selection​Ruby​Eval

by jcshih ALL

A Sublime Text plugin for executing ruby code on multiple selections.

Details

Installs

  • Total 750
  • Win 327
  • Mac 241
  • Linux 182
Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

SelectionRubyEval

A Sublime Text plugin to execute ruby code on multiple selections.

Installation

Assumes ruby is installed, and that ruby is available in path.

Install using Package Control (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