JoshCheek / atom-seeing-is-believing

Seeing is Believing integration for the Atom text editor.
Do What The F*ck You Want To Public License
62 stars 4 forks source link

seeing-is-believing package

Integrates Atom with Seeing Is Believing, allowing Ruby programs to show you the result of each line of code that was evaluated.

Here is an example session:

example

Here is a longer video that goes into more details.

Using the package

Keybindings:

Snippets (use SiB to play around with ideas without needing a complex environment):

Install the Atom package

Or, you can do it from the command line $ apm install seeing-is-believing

You need Seeing Is Believing installed

This integrates into your specific environment, it doesn't come with the gem loaded by default. Install it by getting into the environment you want, and running:

$ gem install seeing_is_believing
$ seeing_is_believing -e '1 + 1'   # to check that it worked

If you use rbenv, you may need to $ rbenv rehash

Configuration

Custom / non-working Ruby environment

Atom loads your environment by launching a new shell and copying its environment variables into Atom's environment variables. So, assuming that your shell sets your Ruby, then everything should just work. Note that it looks in the SHELL environment variable to decide what shell to use (you can change yours with chsh).

If seeing_is_believing is not available by default in a new shell (perhaps because it's not located in a $PATH directory, or your Ruby environment needs some fancier setup) then you can use the "Seeing is believing command" configuration option to either change the name or pass an absolute path to a script you wrote. This allows you total control over how to set it up. I've used this to setup non-standard environments and then exec SiB. When I want to try features from my development SiB, I set mine to /Users/josh/code/seeing_is_believing/bin/seeing_is_believing.

Flags

You can get a full list of flags by running seeing_is_believing --help The most common and useful ones are going to be:

WTFPL License

Copyright (C) 2014 Josh Cheek <josh.cheek@gmail.com>

This program is free software. It comes without any warranty,
to the extent permitted by applicable law.
You can redistribute it and/or modify it under the terms of the
Do What The Fuck You Want To Public License,
Version 2, as published by Sam Hocevar.
See http://www.wtfpl.net/ for more details.