Ruby tools is a collection of handy functions for Emacs
ruby-mode. You can turn a string to symbol, symbol to string, single
to double quote string, double to single quote string, clear string,
interpolate and more...
I recommend installing via ELPA, but manual installation is simple as well:
(add-to-list 'load-path "/path/to/ruby-tools")
(require 'ruby-tools)
When ruby-mode is started, ruby-tools-mode will automatically start.
Once started, this functionality is available:
Insert:
foo(:bar)
Place cursor on :bar, then press C-' and you will see:
foo('bar')
Insert:
foo('bar')
foo("bar")
Place cursor on bar, then press C-: and you will see:
foo(:bar)
foo(:bar)
Insert:
foo('bar')
Place cursor on bar, then press C-" and you will see:
foo("bar")
Insert:
foo("bar")
Place cursor on bar, then press C-' and you will see:
foo('bar')
Insert:
foo('bar')
Place cursor on bar, then press C-; and you will see:
foo('')
Insert:
foo('bar')
foo("bar")
`bar`
%(bar)
Place cursor on bar, then press # and you will see:
foo('b#ar')
foo("b#{}ar")
`b#{}ar`
%(b#{}ar)
- Add/remove parenthesis on function call/definition
re-builderfor Ruby regex syntax
Contribution is much welcome! Ruby tools is tested using Ecukes. When adding new features, please write tests for them!
Install cask if you haven't already, then:
$ cd /path/to/ruby-tools
$ cask
Run all tests with:
$ make