Skip to content

Commit

Permalink
Add seeing is believing
Browse files Browse the repository at this point in the history
  • Loading branch information
brandoncc authored and sdwolfz committed Aug 11, 2018
1 parent b18672d commit 6302748
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions layers/+lang/ruby/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [[#toggles][Toggles]]
- [[#rake][Rake]]
- [[#refactor][Refactor]]
- [[#seeing-is-believing][Seeing is believing]]
- [[#layer-options][Layer options]]

* Description
Expand Down Expand Up @@ -55,6 +56,7 @@ based on your version manager):
- =pry= and =pry-doc= are required for *jump to definition* and *code documentation* (=robe-mode=)
- =ruby_parser= is required for *goto-step_definition* in =feature-mode=
- =rubocop= is required for rubocop integration
- =seeing_is_believing= helps you evaluate code inline

You can install the gems in the context of your current project by
adding them to the =Gemfile=, e.g.:
Expand Down Expand Up @@ -210,6 +212,13 @@ When =ruby-test-runner= equals =minitest=.
| ~SPC m r R c~ | Extract constant |
| ~SPC m r R l~ | Extract to let (rspec) |

** Seeing is believing

| Key Binding | Description |
|-----------------+----------------------------------|
| ~<SPC> m @ @~ | Run seeing is believing |
| ~<SPC> m @ c~ | Clear seeing is believing output |

* Layer options

| Variable | Default value | Description |
Expand Down
16 changes: 16 additions & 0 deletions layers/+lang/ruby/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
ruby-test-mode
ruby-tools
rvm
seeing-is-believing
smartparens
rake
))
Expand Down Expand Up @@ -330,3 +331,18 @@
"kr" 'rake-rerun
"kR" 'rake-regenerate-cache
"kf" 'rake-find-task))))

(defun ruby/init-seeing-is-believing ()
(use-package seeing-is-believing
:defer t
:commands (seeing-is-believing seeing-is-believing-run seeing-is-believing-clear)
:if (executable-find "seeing_is_believing")
:init
(progn
(spacemacs|diminish seeing-is-believing " 👁" " @")
(dolist (hook '(ruby-mode-hook enh-ruby-mode-hook))
(add-hook hook 'seeing-is-believing))
(dolist (mode '(ruby-mode enh-ruby-mode))
(spacemacs/set-leader-keys-for-major-mode mode
"@@" 'seeing-is-believing-run
"@c" 'seeing-is-believing-clear)))))

0 comments on commit 6302748

Please sign in to comment.