emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 1e2fe55 098/215: Add rspec loc pattern..


From: Rocky Bernstein
Subject: [elpa] master 1e2fe55 098/215: Add rspec loc pattern..
Date: Sat, 30 Jul 2016 14:48:57 +0000 (UTC)

branch: master
commit 1e2fe5515c119a153a8f6bdf174ccfa291260a77
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    Add rspec loc pattern..
    
    .. in the never-ending battle of again location reporting originality
    
    init.el: DRY
---
 realgud/common/backtrack-mode.el |    2 +-
 realgud/debugger/rdebug/init.el  |    2 +-
 realgud/debugger/trepan/init.el  |   17 ++++++-----------
 realgud/lang/ruby.el             |   17 +++++++++++++++++
 4 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/realgud/common/backtrack-mode.el b/realgud/common/backtrack-mode.el
index 2a48f2a..aaf89c9 100644
--- a/realgud/common/backtrack-mode.el
+++ b/realgud/common/backtrack-mode.el
@@ -61,7 +61,7 @@ debugger with that information"
        (let* ((base-variable-name
                (or (gethash debugger-name realgud:variable-basename-hash)
                    debugger-name))
-              (specific-track-mode (intern (concat prefix "-backtrack-mode")))
+              (specific-track-mode (intern (concat base-variable-name 
"-backtrack-mode")))
               )
          (if (and (not (eval specific-track-mode))
                   (functionp specific-track-mode))
diff --git a/realgud/debugger/rdebug/init.el b/realgud/debugger/rdebug/init.el
index 3f0021f..7dc6fb3 100644
--- a/realgud/debugger/rdebug/init.el
+++ b/realgud/debugger/rdebug/init.el
@@ -132,4 +132,4 @@ realgud-loc-pat struct")
 (setf (gethash "shell" realgud-rdebug-command-hash) "irb")
 (setf (gethash "rdebug" realgud-command-hash) realgud-rdebug-command-hash)
 
-(provide-me "realgud-rdebug-")
+2(provide-me "realgud-rdebug-")
diff --git a/realgud/debugger/trepan/init.el b/realgud/debugger/trepan/init.el
index 2da793e..f2148fa 100644
--- a/realgud/debugger/trepan/init.el
+++ b/realgud/debugger/trepan/init.el
@@ -47,18 +47,13 @@ realgud-loc-pat struct")
 (setf (gethash "syntax-error" realgud:trepan-pat-hash)
       realgud-ruby-YARV-syntax-error-pat)
 
-;; Regular expression that describes a Ruby YARV 1.9 backtrace line.
-;; For example:
-;; <internal:lib/rubygems/custom_require>:29:in `require'
-;; <internal:lib/rubygems/custom_require>:29:in `require'
-;; /tmp/Rakefile:50:in `<top /src/external-vcs/laser/Rakefile>'
-;;     from /usr/lib/ruby/gems/rspec/compatibility.rb:6:in `const_missing'
+;; Regular expression that describes a Ruby YARV backtrace line.
+;; For example: 
+;;     from /ruby/gems/2.2.0/gems/fog-1.32.0/lib/fog/digitalocean.rb:1:in 
`<top (required)>'
+;;     from /Users/fog-1.32.0/lib/fog.rb:28:in `require'
 (setf (gethash "lang-backtrace" realgud:trepan-pat-hash)
-  (make-realgud-loc-pat
-   :regexp "^\\(?:[\t]from \\)?\\([^:]+\\):\\([0-9]+\\)\\(?:in `.*'\\)?"
-   :file-group 1
-   :line-group 2))
-
+      realgud-ruby-backtrace-loc-pat)
+   
 ;;  Regular expression that describes a ruby $! backtrace
 (setf (gethash "dollar-bang-backtrace" realgud:trepan-pat-hash)
       realgud-ruby-dollar-bang-loc-pat)
diff --git a/realgud/lang/ruby.el b/realgud/lang/ruby.el
index aa1ffa4..6c11cc4 100644
--- a/realgud/lang/ruby.el
+++ b/realgud/lang/ruby.el
@@ -16,6 +16,14 @@
   "A realgud-loc-pat struct that describes a Rails backtrace (or
 traceback) line."  )
 
+(defconst realgud-rspec-backtrace-loc-pat
+  (make-realgud-loc-pat
+   :regexp "^[ ]*# \\([^:]+\\):\\([0-9]+\\)\\(?:[:]in `.*'\\)?"
+   :file-group 1
+   :line-group 2)
+  "A realgud-loc-pat struct that describes an rspec backtrace (or
+traceback) line."  )
+
 ;; Regular expression that describes a Ruby YARV 1.9 syntax error line.
 ;; SyntaxError: /tmp/columnize.rb:270: syntax error, unexpected $end, ...
 (defconst realgud-ruby-YARV-syntax-error-pat
@@ -65,6 +73,14 @@ described by PT."
   (interactive "d")
   (realgud-goto-line-for-pt pt "rails-backtrace"))
 
+;; FIXME: there is probably a less redundant way to do the following
+;; FNS.
+(defun realgud:rspec-goto-backtrace-line (pt)
+  "Display the location mentioned by the Rails backtrace line
+described by PT."
+  (interactive "d")
+  (realgud-goto-line-for-pt pt "rspec-backtrace"))
+
 (defun realgud:rubinius-goto-Xagent-backtrace-line (pt)
   "Display the location mentioned by the Rubinius Xagent- backtrace line
 described by PT."
@@ -91,6 +107,7 @@ described by PT."
   (define-key map (kbd "C-c !!") 'realgud:ruby-goto-dollar-bang-line)
   (define-key map (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line)
   (define-key map (kbd "C-c !r") 'realgud:rails-goto-backtrace-line)
+  (define-key map (kbd "C-c !s") 'realgud:rspec-goto-backtrace-line)
   )
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]