Seeing Is Believing is a ruby gem to evaluate Ruby code, recording the results of each line. This minor mode provides an easy way to run it from emacs on the current region or entire buffer.
Download the package and add it to your load path.
To install from MELPA, follow the instructions in the MELPA readme.
Once that's set up, you can run (package-install 'seeing-is-believing)
Alternatively, if you use spacemacs, add seeing-is-believing to your dotspacemacs-additional-packages variable in your .spacemacs file and reload your config.
Enable the mode by typing M-x seeing-is-believing or by adding
something similar to the following to your emacs init file:
(require 'seeing-is-believing)
(add-hook 'ruby-mode-hook 'seeing-is-believing)
When the mode is active you can run seeing is believing by typing C-c ? s. If you prefer the
xmpfilter
style of explicitly specifying where you want to see the output type
C-c ? x. You can clear out the output from seeing is believing by
typing C-c ? c.
You can change the keybinding shortcuts from the default of C-c ? by
customising the seeing-is-believing-prefix variable
(M-x set-variable <return> seeing-is-believing-prefix <return>).
You can also customize or set variables that affect how seeing-is-believing
operates:
seeing-is-believing-executablecan be set to the name of the program file for the executable (default "seeing_is_believing")seeing-is-believing-max-lengthcan be set to an integer that limits the length of lines produced, source plus comments (default 1000).seeing-is-believing-max-resultscan be set to an integer that limits the number of results produced, whenseeing-is-believingshows multiple results per comment (default 10),seeing-is-believing-timeoutcan be set to a decimal number for the number of secondsseeing-is-believingruns before it times out or to 0 for no timeout (default 0), andseeing-is-believing-alignmentcan be set to one of'chunk,'file, or'lineto change the wayseeing-is-believingaligns its comments, on a chunk-by-chunk basis, across the whole file, or on a line-by-line basis, effectively no alignment (default'chunk).
Either use the customize interface to set these, or set them in your init.el
file:
(setq seeing-is-believing-max-length 150
seeing-is-believing-max-results 10
seeing-is-believing-timeout 10.5
seeing-is-believing-alignment 'file)Copyright 2015 John Cinnamond
This mode is distributed under the same licence as GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.