         ruby-test-mode
         ruby-tools
         rvm
+        smartparens
         ))
 (if ruby-enable-enh-ruby-mode
     (add-to-list 'ruby-packages 'enh-ruby-mode)

    (progn
      (spacemacs/set-leader-keys-for-major-mode 'ruby-mode
        "'" 'ruby-toggle-string-quotes
        "{" 'ruby-toggle-block)
      (with-eval-after-load 'smartparens
        (sp-with-modes 'ruby-mode
          (sp-local-pair "{" "}"
                         :pre-handlers '(sp-ruby-pre-handler)
                         :post-handlers '(sp-ruby-post-handler (spacemacs/smartparens-pair-newline-and-indent "RET"))
                         :suffix ""))))))

(defun ruby/init-ruby-tools ()
  (use-package ruby-tools

      (setq rspec-use-rvm t)
      (spacemacs/add-to-hooks 'rvm-activate-corresponding-ruby
                              '(ruby-mode-hook enh-ruby-mode-hook)))))

(defun ruby/post-init-smartparens ()
  (spacemacs|use-package-add-hook smartparens
    :post-config
    (sp-with-modes (if ruby-enable-enh-ruby-mode 'enh-ruby-mode 'ruby-mode)
      (sp-local-pair
       "{" "}"
       :pre-handlers '(sp-ruby-pre-handler)
       :post-handlers '(sp-ruby-post-handler
                        (spacemacs/smartparens-pair-newline-and-indent "RET"))
       :suffix ""))))
