Seeing Is Believing
Integration of Seeing Is Believing (display results of every line of Ruby code) with Sublime Text 2
Details
Installs
- Total 383
- Win 68
- Mac 243
- Linux 72
Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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
Seeing Is Believing
Integration of seeing_is_believing
to Sublime Text 2 and 3.
Prerequisites
You need to have seeing_is_believing 2.0 or greater installed:
gem install seeing_is_believing
Installation
You have two options for installing the SeeingIsBelieving Plugin: using Git, or just downloading it. Then you will need to fix the settings.
Git
Open your terminal application and go to your Packages directory, whose location depends on your operating system:
Sublime Text 2:
- OS X -
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
- Linux -
cd ~/.Sublime\ Text 2/Packages/
- Windows -
cd %APPDATA%/Sublime Text 2/Packages/
Sublime Text 3:
- OS X -
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages
- Linux -
cd ~/.Sublime\ Text 3/Packages/
- Windows -
cd %APPDATA%/Sublime Text 3/Packages/
After this, you need to clone this repository: git clone git://github.com/JoshCheek/sublime-text-2-and-3-seeing-is-believing.git SeeingIsBelieving
Download
Click on the nice cloud icon above and download the zip file containing this plugin. Then unzip the file and move the resulting folder to your Packages directory.
Customizing
You can customize which Ruby to use, and how to invoke SiB in the settings.
In particular, you'll need to go here if it can't find your Ruby.
In that situation, try opening a shell and running ruby -e 'p RbConfig.ruby'
,
its possible that what it prints is the value you need to set. You can also
set environment variables here, and set any flags that you want passed to SiB.
Usage
Open a Ruby file or write some code.
10.times do |i|
i * 2
end
Now run the command Evaluate Ruby code with Seeing Is Believing
from your command pallete (⌘ + ⇧ + P on OS X) or press the pre-defined keyboard shortcut (⌥ + ⌘ + B on OS X).
You will see comments added adjacent to each line of your code, showing you what that line evaluated to.
10.times do |i|
i * 2 # => 0, 2, 4, 6, 8, 10, 12, 14, 16, 18
end # => 10
Now you want to edit it, so run Remove Seeing Is Believing annotations
or press (⌥ + ⌘ + V on OS X).
And you are back to the original.
There are also some default snippets you can use to play around with SiB.
s_arb
tab - In memory ActiveRecord environments_nokogiri
tab - Practice parsing html/xml/css selectors/xpath in Rubys_sinatra
tab - Play with Sinatra, without needing to host it on a servers_reflection
tab - Examples of reflection in Ruby (knowing these makes SiB much more useful)
Configuration
You can edit these from your preferences folder. You can specify how to find Ruby (e.g. integrate with your version manager). And you can specify what command-line arguments to pass to Seeing Is Believing. I'm trying to figure out how to get this in the menu, but the docs are pretty weak.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Author
Karsten Silkenbäumer wrote the one for XMPfilter that I (Josh Cheek) modified to work with Seeing Is Believing.