diff --git a/ChangeLog b/ChangeLog index a54fe38..0fc11b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-02-07 Dmitry Galinsky + + * rails-scripts.el (rails-script:console): passed default environment to script/console + 2007-12-23 Michael Klishin * rails-spec.el (rails-spec:run-this-spec): Run spec where the point is diff --git a/History b/History index 4d6c9a4..069775a 100644 --- a/History +++ b/History @@ -1,3 +1,6 @@ +SVN +* Fixed [#16742]: pass rails environment to script/console + 0.5.99.6 * Removed file 'untabify-file.el' from package emacs-rails * Updated highlight of compilation output diff --git a/rails-ruby.el b/rails-ruby.el index 9aa02b3..2659aae 100644 --- a/rails-ruby.el +++ b/rails-ruby.el @@ -173,11 +173,11 @@ See the variable `align-rules-list' for more details.") (require 'inf-ruby) -(defun run-ruby-in-buffer (cmd buf) +(defun run-ruby-in-buffer (buf script &optional params) "Run CMD as a ruby process in BUF if BUF does not exist." (let ((abuf (concat "*" buf "*"))) (when (not (comint-check-proc abuf)) - (set-buffer (make-comint buf rails-ruby-command nil cmd))) + (set-buffer (make-comint buf rails-ruby-command nil script params))) (inferior-ruby-mode) (make-local-variable 'inferior-ruby-first-prompt-pattern) (make-local-variable 'inferior-ruby-prompt-pattern) diff --git a/rails-scripts.el b/rails-scripts.el index a1cb066..a65675b 100644 --- a/rails-scripts.el +++ b/rails-scripts.el @@ -300,25 +300,29 @@ BUFFER-MAJOR-MODE and process-sentinel SENTINEL." ;;;;;;;;;; Shells ;;;;;;;;;; -(defun rails-script:run-interactive (name script) +(defun rails-script:run-interactive (name script &optional params) "Run an interactive shell with SCRIPT in a buffer named *rails--*." (rails-project:with-root (root) - (let ((buffer-name (format "rails-%s-%s" (rails-project:name) name))) - (run-ruby-in-buffer (rails-core:file script) - buffer-name) + (let ((buffer-name (format "rails-%s-%s" (rails-project:name) name)) + (script (rails-core:file script))) + (run-ruby-in-buffer buffer-name + script + params) (setq ruby-buffer buffer-name)) (rails-minor-mode t))) (defun rails-script:console () "Run script/console." (interactive) - (rails-script:run-interactive "console" "script/console")) + (rails-script:run-interactive (format "console at (%s)" rails-default-environment) + "script/console" + rails-default-environment)) (defun rails-script:breakpointer () "Run script/breakpointer." (interactive) (rails-script:run-interactive "breakpointer" "script/breakpointer")) -(provide 'rails-scripts) \ No newline at end of file +(provide 'rails-scripts) diff --git a/rails.el b/rails.el index 685c1d7..1d08e86 100644 --- a/rails.el +++ b/rails.el @@ -292,25 +292,25 @@ 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? ")))) + (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")) + (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")) + (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"))) + (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")))))