Skip to content

Instantly share code, notes, and snippets.

@stouset
Created September 18, 2012 19:28
Show Gist options
  • Save stouset/3745268 to your computer and use it in GitHub Desktop.
Save stouset/3745268 to your computer and use it in GitHub Desktop.
(setenv "PATH"
(concat (expand-file-name "~/.rbenv/shims:")
(expand-file-name "~/.rbenv/bin:")
(getenv "PATH")))
(setq exec-path
(append
(list (expand-file-name "~/.rbenv/shims")
(expand-file-name "~/.rbenv/bin"))
exec-path))
(setq ruby-deep-indent-paren nil)
(defun st/inf-ruby-bundle-setup ()
"Initialize Bundler gems for the current project"
(comint-send-string (inf-ruby-proc)
(concat "(begin; require 'bundler';"
"Bundler.setup(:default, :development);"
"rescue LoadError; end); nil\n")))
(defun st/inf-ruby-require-current-project ()
"Require the library for the current project"
(comint-send-string (inf-ruby-proc)
(concat "(begin; require '"
(projectile-get-project-name)
"'; rescue LoadError; end)\n")))
(eval-after-load "inf-ruby"
'(setq inf-ruby-default-implementation "pry"
inf-ruby-prompt-pattern "^\\(>> .*\\)"
inf-ruby-first-prompt-pattern "^\\(>> .*\\)"
inf-ruby-implementations (cons
'("pry" . "pry -I lib")
inf-ruby-implementations)))
(eval-after-load "inf-ruby"
'(defconst inf-rub-eval-binding "Pry.toplevel_binding"))
(add-hook 'prelude-ruby-mode-hook 'prelude-prog-mode-defaults t)
(add-hook 'prelude-ruby-mode-hook 'auto-fill-mode t)
(add-hook 'inf-ruby-mode-hook 'st/inf-ruby-bundle-setup t)
(add-hook 'inf-ruby-mode-hook 'st/inf-ruby-require-current-project t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment