Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add seeing is believing layer #3436

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions layers/+lang/ruby/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [[#tests][Tests]]
- [[#rspec-mode][RSpec-mode]]
- [[#ruby-test-mode][Ruby-test-mode]]
- [[#seeing-is-believing][seeing-is-believing]]
- [[#rake][Rake]]

* Description
Expand Down Expand Up @@ -48,6 +49,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 @@ -164,6 +166,13 @@ When =ruby-test-runner= equals =ruby-test=.
| ~SPC m t b~ | run test file |
| ~SPC m t t~ | run test at pointer |

** seeing-is-believing

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to find other key bindings, these one are reserved for REPL interactions.
Can those two functions be unified together into a toggle ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ain't changing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't used spacemacs in quite a while. Someone else is welcome to find better bindings, but I doubt I will ever do it.

** Rake

| Key binding | Description |
Expand Down
15 changes: 15 additions & 0 deletions layers/+lang/ruby/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
(ruby-mode :location built-in :toggle (not ruby-enable-enh-ruby-mode))
ruby-test-mode
ruby-tools
seeing-is-believing
rvm
smartparens
rake
Expand Down Expand Up @@ -53,6 +54,20 @@
(dolist (mode '(ruby-mode enh-ruby-mode))
(push mode company-dabbrev-code-modes)))))

(defun seeing-is-believing/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
(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
"sb" 'seeing-is-believing-run
"sc" 'seeing-is-believing-clear)))))

(defun ruby/init-chruby ()
(use-package chruby
:if (equal ruby-version-manager 'chruby)
Expand Down