Compare commits
3 commits
a31cd7e6a9
...
f71afc0160
Author | SHA1 | Date | |
---|---|---|---|
f71afc0160 | |||
42f9790570 | |||
f263264a77 |
1
dir-locals/copenhagen_theme.el
Symbolic link
1
dir-locals/copenhagen_theme.el
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/Users/frederikhanghjiversen/git/zendesk/copenhagen_theme/.dir-locals.el
|
1
dir-locals/guide-acceptance-tests.el
Symbolic link
1
dir-locals/guide-acceptance-tests.el
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/Users/frederikhanghjiversen/git/zendesk/guide-acceptance-tests/.dir-locals.el
|
1
dir-locals/help_center.el
Symbolic link
1
dir-locals/help_center.el
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/Users/frederikhanghjiversen/git/zendesk/help_center/.dir-locals.el
|
22
zdi.el
22
zdi.el
|
@ -13,14 +13,7 @@
|
||||||
"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
|
(defvar zdi-build-command-format "docker exec -it help_center bundle exec rspec --no-color %s")
|
||||||
"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."
|
||||||
|
@ -28,4 +21,17 @@ zdi help_center -d run bundle exec rspec %s | strip-colors
|
||||||
(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