Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
Added config.el template.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmexe committed Mar 5, 2009
1 parent b33172c commit c7c2f35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion files-ext.el
Expand Up @@ -48,7 +48,9 @@
"Read sexpr from a file named FILE-NAME."
(with-temp-buffer
(insert-file-contents file-name)
(read (current-buffer))))
(goto-char (point-min))
(unless (string-ext/empty-p (buffer-substring-no-properties (point-min) (point-max)))
(read (current-buffer)))))

(defun files-ext/directory-files-recursive (dir regexp)
(let ((dir-stack '())
Expand Down
5 changes: 5 additions & 0 deletions rails-project.el
Expand Up @@ -30,6 +30,9 @@
:group 'rails
:type 'string)

(defvar rails/project/template
"((rails/webserver-bundle/port . 3000)\n (rails/default-environment . \"development\")\n (rails/bundles/disabled-list . (test-unit)))\n")

(defun rails/project/apply (root buffer config)
(with-current-buffer buffer
(when-bind (root (rails/root))
Expand All @@ -49,6 +52,8 @@
(setq root (rails/root)))
(when root
(rails/find-file root rails/project/config)
(when (string-ext/empty-p (buffer-substring-no-properties (point-min) (point-max)))
(insert rails/project/template))
(add-hook 'after-save-hook 'rails/project/update t t)))

(defun rails/project/update (&optional root)
Expand Down

0 comments on commit c7c2f35

Please sign in to comment.