Permalink
Browse files

rails-ws.el (rails-ws:available-servers-list): Added Thin support.

rails.el (rails-templates-list): Added js.rjs and builder templates


git-svn-id: svn+ssh://rubyforge.org/var/svn/emacs-rails/trunk@225 cc5033d0-740f-0410-afc7-949910e492f2
  • Loading branch information...
1 parent 4b6fba1 commit 0607b85dfa56ec3cceb1ac4ad914e2a6d8253c81 dimaexe committed Mar 2, 2008
Showing with 47 additions and 16 deletions.
  1. +6 −0 ChangeLog
  2. +8 −1 rails-test.el
  3. +3 −0 rails-ui.el
  4. +18 −5 rails-ws.el
  5. +12 −10 rails.el
View
@@ -1,3 +1,9 @@
+2008-03-03 Dmitry Galinsky <dima.exe@gmail.com>
+
+ * rails-ws.el (rails-ws:available-servers-list): Added Thin support.
+
+ * rails.el (rails-templates-list): Added js.rjs and builder templates
+
2008-02-15 Dmitry Galinsky <dima.exe@gmail.com>
* rails-core.el (rails-core:observer-p, rails-core:mailer-p): fixed regexp.
View
@@ -108,10 +108,17 @@
'(rails-test-error
rails-test-trace))
(add-hook 'after-change-functions 'rails-test:print-progress nil t)
- (add-hook 'rails-script:run-after-stop-hook 'rails-test:print-result nil t)
(add-hook 'rails-script:run-after-stop-hook 'rails-test:hide-rails-project-root t t)
+;; (add-hook 'rails-script:run-after-stop-hook 'rails-test:scroll-of-buffer t t)
+ (add-hook 'rails-script:run-after-stop-hook 'rails-test:print-result t t)
(add-hook 'rails-script:show-buffer-hook 'rails-test:reset-point-and-height t t))
+;; (defun rails-test:scroll-of-buffer ()
+;; (with-current-buffer "ROutput"
+;; (buffer "ROutput")
+;; (goto-char (point-min))
+;; (scroll-down-nomark (count-lines (point-min) (point-max)))))
+
(defun rails-test:hide-rails-project-root ()
"Show files that are relative to the project root as relative filenames
As the buffer is read-only this is merely a change in appearance"
View
@@ -172,6 +172,9 @@
([rails ws use-mongrel] '(menu-item "Use Mongrel" (lambda() (interactive)
(rails-ws:switch-default-server-type "mongrel"))
:button (:toggle . (rails-ws:default-server-type-p "mongrel"))))
+ ([rails ws use-thin] '(menu-item "Use Thin" (lambda() (interactive)
+ (rails-ws:switch-default-server-type "thin"))
+ :button (:toggle . (rails-ws:default-server-type-p "thin"))))
([rails ws separator] '("--"))
([rails ws brows] '(menu-item "Open Browser..." rails-ws:open-browser-on-controller
View
@@ -45,7 +45,7 @@
:type 'string
:tag "Rails Server Type")
-(defvar rails-ws:available-servers-list (list "mongrel" "lighttpd" "webrick"))
+(defvar rails-ws:available-servers-list (list "mongrel" "lighttpd" "webrick" "thin"))
(defvar rails-ws:buffer-name "*RWebServer*")
(defvar rails-ws:process-environment nil)
@@ -88,20 +88,33 @@ using `rails-default-environment'."
(message "Only one instance rails-ws allowed")
(let* ((default-directory root)
(env (if env env rails-default-environment))
+ (command (rails-ws:compute-server-conmmand rails-ws:default-server-type rails-ws:port env))
(proc
(rails-cmd-proxy:start-process rails-ruby-command
rails-ws:buffer-name
- rails-ruby-command
- (format "script/server %s -p %s -e %s"
- rails-ws:default-server-type
- rails-ws:port env))))
+ (car command)
+ (cadr command))))
(set-process-sentinel proc 'rails-ws:sentinel-proc)
(setq rails-ws:process-environment env)
(message (format "%s (%s) starting with port %s"
(capitalize rails-ws:default-server-type)
env
rails-ws:port)))))))
+(defun rails-ws:compute-server-conmmand (server-type port env)
+ (cond
+ ((string= "thin" server-type)
+ (list server-type
+ (format "-p %s -e %s start"
+ port
+ env)))
+ (t
+ (list rails-ruby-command
+ (format "script/server %s -p %s -e %s"
+ server-type
+ port
+ env)))))
+
(defun rails-ws:stop ()
"Stop the WebServer process."
(interactive)
View
@@ -146,7 +146,7 @@ Emacs w3m browser."
:type 'string)
(defvar rails-version "0.5.99.6")
-(defvar rails-templates-list '("html.erb" "erb" "rhtml" "rxml" "rjs" "haml" "liquid" "mab"))
+(defvar rails-templates-list '("html.erb" "erb" "js.rjs" "builder" "rhtml" "rxml" "rjs" "haml" "liquid" "mab"))
(defvar rails-use-another-define-key nil)
(defvar rails-primary-switch-func nil)
(defvar rails-secondary-switch-func nil)
@@ -437,15 +437,17 @@ necessary."
(autoload 'haml-mode "haml-mode" "" t)
-(setq auto-mode-alist (cons '("\\.rb$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.rake$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.mab$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("Rakefile$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.haml$" . haml-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.rjs$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.rxml$" . ruby-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.rhtml$" . html-mode) auto-mode-alist))
-(setq auto-mode-alist (cons '("\\.erb$" . html-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.rb$" . ruby-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.rake$" . ruby-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.mab$" . ruby-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("Rakefile$" . ruby-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.haml$" . haml-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.rjs$" . ruby-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.rxml$" . ruby-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.builder$" . ruby-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.rjs$" . ruby-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.rhtml$" . html-mode) auto-mode-alist))
+(setq auto-mode-alist (cons '("\\.erb$" . html-mode) auto-mode-alist))
(modify-coding-system-alist 'file "\\.rb$" 'utf-8)
(modify-coding-system-alist 'file "\\.rake$" 'utf-8)

0 comments on commit 0607b85

Please sign in to comment.