Compare commits
No commits in common. "f71afc0160c58a643e099872ac7c630f58a42088" and "a31cd7e6a9f4233a36b30413c19c32b17af9ce43" have entirely different histories.
f71afc0160
...
a31cd7e6a9
|
@ -1 +0,0 @@
|
||||||
/Users/frederikhanghjiversen/git/zendesk/copenhagen_theme/.dir-locals.el
|
|
|
@ -1 +0,0 @@
|
||||||
/Users/frederikhanghjiversen/git/zendesk/guide-acceptance-tests/.dir-locals.el
|
|
|
@ -1 +0,0 @@
|
||||||
/Users/frederikhanghjiversen/git/zendesk/help_center/.dir-locals.el
|
|
22
zdi.el
22
zdi.el
|
@ -13,7 +13,14 @@
|
||||||
"Get the project-relative path of the current buffer."
|
"Get the project-relative path of the current buffer."
|
||||||
(file-relative-name buffer-file-name (projectile-project-root)))
|
(file-relative-name buffer-file-name (projectile-project-root)))
|
||||||
|
|
||||||
(defvar zdi-build-command-format "docker exec -it help_center bundle exec rspec --no-color %s")
|
(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 ()
|
(defun zdi-set-compile-command ()
|
||||||
"Set the command used to compile your project to run rspec through zdi."
|
"Set the command used to compile your project to run rspec through zdi."
|
||||||
|
@ -21,17 +28,4 @@
|
||||||
(set (make-local-variable 'compile-command)
|
(set (make-local-variable 'compile-command)
|
||||||
(format zdi-build-command-format (projectile-get-relative-path-buffer))))
|
(format zdi-build-command-format (projectile-get-relative-path-buffer))))
|
||||||
|
|
||||||
(defun zdi-find-spec-file ()
|
|
||||||
"Go to the spec file corresponding to the currently visited file.
|
|
||||||
|
|
||||||
Depends on file naming convention used in Help Center."
|
|
||||||
(interactive)
|
|
||||||
(find-file (zdi-build-spec-path (buffer-file-name))))
|
|
||||||
|
|
||||||
(defun zdi-build-spec-path (path)
|
|
||||||
"Guess the location of the spec file corresponding to PATH."
|
|
||||||
(replace-regexp-in-string
|
|
||||||
"\\(\\)\\.[^\\.]*$" "_spec"
|
|
||||||
(replace-regexp-in-string "\\(app\\).*\\'" "spec" path nil nil 1) nil nil 1))
|
|
||||||
|
|
||||||
;;; zdi.el ends here
|
;;; zdi.el ends here
|
||||||
|
|
Loading…
Reference in a new issue