Hello world

This commit is contained in:
Frederik Hanghøj Iversen 2019-11-22 11:11:59 +01:00
commit a31cd7e6a9
3 changed files with 52 additions and 0 deletions

6
BACKLOG.md Normal file
View file

@ -0,0 +1,6 @@
# Source `zdi.sh` on startup.
# Have `zdi help_center -d` running as a daemon
Run a `help_center` shell in the background as a server and send
commands to it. That way we should be able to re-run RSpec way faster
because we don't suffer the overhead of whatever ZDI and Docker needs
to do to get up and running.

15
README.md Normal file
View file

@ -0,0 +1,15 @@
# Emacs integration for ZDI
A small utility for running rspec directly from the comfort of emacs.
Its just a first rough version that works for developing on help
center. I havent made it super configurable. You should modify it
to your own needs or make it more configurable and send a PR.
It allows you to go to an rspec file in help center and run the RSpec
on it by doing `M-x compile`.
## Installation
(add-to-list 'load-path PATH-TO-ZDI)
(require zdi)
(add-hook 'ruby-mode-hook 'zdi-set-compile-command)

31
zdi.el Normal file
View file

@ -0,0 +1,31 @@
;;; Jira --- A simple wrapper around ZDI
;;; Commentary:
;;; Emacs integration for ZDI.
;;; Code:
(provide 'zdi)
(require 'projectile)
(defun projectile-get-relative-path-buffer ()
"Get the project-relative path of the current buffer."
(file-relative-name buffer-file-name (projectile-project-root)))
(defvar zdi-build-command-format
"source ~/git/zendesk/zdi/dockmaster/zdi.sh
function strip-colors() {
gsed -r \"s/\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g\"
}
zdi help_center -d run bundle exec rspec %s | strip-colors
")
(defun zdi-set-compile-command ()
"Set the command used to compile your project to run rspec through zdi."
(set (make-local-variable 'compile-command)
(format zdi-build-command-format (projectile-get-relative-path-buffer))))
;;; zdi.el ends here