Skip to content
Browse files

customizable variable rails-api-root wasn't usable

  • Loading branch information...
1 parent 6b54735 commit 715f1d11e958d082f9c8e5dbb76dd1876b599c52 @remvee remvee committed Mar 5, 2010
Showing with 23 additions and 21 deletions.
  1. +23 −21 rails.el
View
44 rails.el
@@ -85,7 +85,7 @@
;;;;;;;;;; Variable definition ;;;;;;;;;;
-(defcustom rails-api-root nil
+(defcustom rails-api-root ""
"*Root of Rails API html documentation. Must be a local directory."
:group 'rails
:type 'string)
@@ -389,29 +389,31 @@ Emacs w3m browser."
it in case it's still empty for the project."
(rails-project:with-root
(root)
- (unless (or (file-exists-p (rails-core:file "doc/api/index.html"))
- (not (yes-or-no-p (concat "This project has no API documentation. "
- "Would you like to configure it now? "))))
- (let (clobber-gems)
- (message "This may take a while. Please wait...")
- (unless (file-exists-p (rails-core:file "vendor/rails"))
- (setq clobber-gems t)
- (message "Freezing gems...")
- (shell-command-to-string "rake rails:freeze:gems"))
- ;; Hack to allow generation of the documentation for Rails 1.0 and 1.1
- ;; See http://dev.rubyonrails.org/ticket/4459
- (unless (file-exists-p (rails-core:file "vendor/rails/activesupport/README"))
- (write-string-to-file (rails-core:file "vendor/rails/activesupport/README")
- "Placeholder"))
- (message "Generating documentation...")
- (shell-command-to-string "rake doc:rails")
- (if clobber-gems
+ (if (file-exists-p (rails-core:file (concat rails-api-root "/index.html")))
+ t
+ (unless (or (file-exists-p (rails-core:file "doc/api/index.html"))
+ (not (yes-or-no-p (concat "This project has no API documentation. "
+ "Would you like to configure it now? "))))
+ (let (clobber-gems)
+ (message "This may take a while. Please wait...")
+ (unless (file-exists-p (rails-core:file "vendor/rails"))
+ (setq clobber-gems t)
+ (message "Freezing gems...")
+ (shell-command-to-string "rake rails:freeze:gems"))
+ ;; Hack to allow generation of the documentation for Rails 1.0 and 1.1
+ ;; See http://dev.rubyonrails.org/ticket/4459
+ (unless (file-exists-p (rails-core:file "vendor/rails/activesupport/README"))
+ (write-string-to-file (rails-core:file "vendor/rails/activesupport/README")
+ "Placeholder"))
+ (message "Generating documentation...")
+ (shell-command-to-string "rake doc:rails")
+ (if clobber-gems
(progn
(message "Unfreezing gems...")
(shell-command-to-string "rake rails:unfreeze")))
- (message "Done...")))
- (if (file-exists-p (rails-core:file "doc/api/index.html"))
- (setq rails-api-root (rails-core:file "doc/api")))))
+ (message "Done...")))
+ (if (file-exists-p (rails-core:file "doc/api/index.html"))
+ (setq rails-api-root (rails-core:file "doc/api"))))))
(defun rails-browse-api ()
"Browse Rails API on RAILS-API-ROOT."

0 comments on commit 715f1d1

Please sign in to comment.
Something went wrong with that request. Please try again.