Skip to content

Latest commit

 

History

History
73 lines (62 loc) · 1.46 KB

ruby.org

File metadata and controls

73 lines (62 loc) · 1.46 KB

Ruby

Ruby

(use-package rbenv
    :ensure t)
(use-package bundler :ensure t)


(use-package enh-ruby-mode
   :ensure t
   :init (progn
   (autoload 'enh-ruby-mode "enh-ruby-mode" "Major mode for ruby files" t)
   (add-to-list 'auto-mode-alist '("\\.rb$" . enh-ruby-mode))
   (add-to-list 'interpreter-mode-alist '("ruby" . enh-ruby-mode))
   ))

Lints

(use-package rubocop
  :ensure t)

Syntax

(use-package flymake-ruby
  :ensure t
  :init (add-hook 'enh-ruby-mode-hook 'flymake-ruby-load))

(use-package ruby-hash-syntax
  :ensure t)

(use-package rubocopfmt
  :ensure t)

Ruby REPL/Run

(use-package inf-ruby
  :ensure t)

LSP

Specs

(defun my/rspec-verify-single ()
    "Run single"
    (interactive)
      (rspec-run-single-file
       (concat
        (rspec-spec-file-for (buffer-file-name))
        ":"
        (save-restriction
          (widen)
          (number-to-string (line-number-at-pos))))
       (rspec-core-options)))

(use-package rspec-mode
  :ensure t
  :config
  (progn
    (setq rspec-command-options "--fail-fast --format documentation")
    (bind-key "C-c , ," 'rspec-rerun rspec-mode-map)
    (fset 'rspec-verify-single 'my/rspec-verify-single)))

Debugger

Provide this so that it may be required

(provide 'ruby)