Skip to content

Support for rails console #2

@bosko

Description

@bosko

With

(defun railsc-arguments () '("exec" "rails" "c"))

;; This part was taken from inf-ruby
(defconst inf-ruby-prompt-format
  (concat
   (mapconcat
    #'identity
    '("\\(^%s> *\\)"                      ; Simple
      "\\(^(rdb:1) *\\)"                  ; Debugger
      "\\(^(byebug) *\\)"                 ; byebug
      "\\(^\\(irb([^)]+)"                 ; IRB default
      "\\([[0-9]+] \\)?[Pp]ry ?([^)]+)"   ; Pry
      "\\(jruby-\\|JRUBY-\\)?[1-9]\\.[0-9]\\(\\.[0-9]+\\)*\\(-?p?[0-9]+\\)?" ; RVM
      "^rbx-head\\)")                     ; RVM continued
    "\\|")
   ;; Statement and nesting counters, common to the last four.
   " ?[0-9:]* ?%s *\\)")
  "Format string for the prompt regexp pattern.
Two placeholders: first char in the Simple prompt, and the last
graphical char in all other prompts.")

(setq docker-cli-commands-alist
      (append docker-cli-commands-alist '((rails-console
                                           :command "./bin/rails"
                                           :arguments-compose-func railsc-arguments
                                           :prompt-regexp (format inf-ruby-prompt-format "[?>]" "[\]>*\"'/`]")
                                           :prompt-cont-regexp (format inf-ruby-prompt-format "[?>]" "[\]>*\"'/`]")))))

Rails console starts in the target container but it always echoes back command issues even though comint-process-echoes is set to t

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions