EmacsÃRuby - PryãEmacsã§ä½¿ã£ã¦ã¿ã
Pry = IRB.succ
ä»åã¯ä¹ ã ã«Rubyï¼Emacsãªã話ã§ãã
ããªãã¯Rubyããã°ã©ãã³ã°ã§è©¦è¡é¯èª¤ããã¨ãã«
ã©ããããã¼ã«ã使ã£ã¦ãã¾ããï¼
irbï¼
xmp(rcodetools)ï¼
irbã¯Rubyãã¤ã³ã¹ãã¼ã«ããã¨ãã«
æããã¤ãã¦ãã対話çRubyã§ãã
ã·ã§ã«ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã§Rubyã®å¼ã
æ¸ãããè©ä¾¡çµæã表示ãã¦ããã¾ãã
ãã®é²åå½¢ãPryã§ãã
ã§ãpryã¨ã¯ä½ãã¨ããã¨ã
ãPry = IRB + Shell + Ruby Shell + Debuggerã
ã¨ãã£ãæãã§ãã
Emacsã®ä¸çã«ããeshellã¯
ãEshell = IELM + Shell + Emacs Lisp Shellã
ãªã®ã§ãpryã¯Rubyçã®eshellã¿ãããªãã®ã¨
æã£ã¦ããã ããã°ããã§ãã
$ sudo gem install pry pry-nav
ã§ã¤ã³ã¹ãã¼ã«ãã¦ãã ããã
Emacsã§ä½¿ãæºå
pryã¯Emacsãã使ãã¾ãã
Rubyã®ããã±ã¼ã¸ã«ã¯ãruby-mode.elãªã©ã®elispã
å«ã¾ãã¦ãã¾ãããå¤ãã®ã§MELPAã®ãã®ã使ãã¾ãã
æããEmacsã§irbã使ãã«ã¯inf-ruby.elã使ãã®ã§ããã
MELPAçã®inf-ruby.elã¯pryã«ã対å¿ãã¦ãã¾ãã
M-x package-refresh-contents
M-x package-install inf-ruby
ããã¦ã以ä¸ã®è¨å®ããã¦ãã ããã
==== pry-init.el
(require 'inf-ruby)
(setq inf-ruby-default-implementation "pry")
(setq inf-ruby-eval-binding "Pry.toplevel_binding")
;; riãªã©ã®ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ãå¦çããè²ä»ããã
(add-hook 'inf-ruby-mode-hook 'ansi-color-for-comint-mode-on)
Emacsã¨ä½µç¨ããã®ã§pryã®è¨å®ãã¡ã¤ã«ã§ãã
.pryrcã§emacsclientãã¨ãã£ã¿ã«è¨å®ãã¦ãã ããã
==== ~/.pryrc
Pry.config.editor = "emacsclient"
ç¶ãã¯ã¡ã«ãã¬ã§
Emacsã§Pryã使ãã®ã¯æ¥½ãããã®ã§ãã
ç¶ãã¯ææ¥ã®ã¡ã«ãã¬ã§ã話ãã¾ããã楽ãã¿ã«ï¼