Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 105 lines (63 sloc) 1.89 kB
ecf7200 @rejeep Update README.
authored
1 # Ruby tools
a536e61 @rejeep Make sure people understand it's for Emacs.
authored
2 Ruby tools is a collection of handy functions for Emacs
3 `ruby-mode`. You can turn a string to symbol, symbol to string, single
4 to double quote string, double to single quote string, clear string,
5 interpolate and more...
ecf7200 @rejeep Update README.
authored
6
7 ## Installation
8 I recommend installing via ELPA, but manual installation is simple as well:
9
10 (add-to-list 'load-path "/path/to/ruby-tools")
11 (require 'ruby-tools)
12
13 ## Usage
14 When `ruby-mode` is started, `ruby-tools-mode` will automatically start.
15
0c94824 @rejeep Update README.
authored
16 Once started, this functionality is available:
ecf7200 @rejeep Update README.
authored
17
0c94824 @rejeep Update README.
authored
18 ### Convert symbol to string
ecf7200 @rejeep Update README.
authored
19
20 Insert:
21
22 foo(:bar)
9921862 @rejeep Update README.
authored
23
ecf7200 @rejeep Update README.
authored
24 Place cursor on `:bar`, then press `C-'` and you will see:
25
26 foo('bar')
27
0c94824 @rejeep Update README.
authored
28 ### Convert string to symbol
ecf7200 @rejeep Update README.
authored
29
30 Insert:
31
32 foo('bar')
33 foo("bar")
9921862 @rejeep Update README.
authored
34
ecf7200 @rejeep Update README.
authored
35 Place cursor on `bar`, then press `C-:` and you will see:
36
37 foo(:bar)
9921862 @rejeep Update README.
authored
38 foo(:bar)
ecf7200 @rejeep Update README.
authored
39
79aed7e @rejeep Not 'and reverse'
authored
40 ### Convert single quote string to double quote string
ecf7200 @rejeep Update README.
authored
41
42 Insert:
43
44 foo('bar')
9921862 @rejeep Update README.
authored
45
ecf7200 @rejeep Update README.
authored
46 Place cursor on `bar`, then press `C-"` and you will see:
47
48 foo("bar")
49
0c94824 @rejeep Update README.
authored
50 ### Convert double quote string to single quote string
ecf7200 @rejeep Update README.
authored
51
52 Insert:
53
9921862 @rejeep Update README.
authored
54 foo("bar")
55
ecf7200 @rejeep Update README.
authored
56 Place cursor on `bar`, then press `C-'` and you will see:
57
58 foo('bar')
59
0c94824 @rejeep Update README.
authored
60 ### Clear string content
ecf7200 @rejeep Update README.
authored
61
62 Insert:
63
64 foo('bar')
9921862 @rejeep Update README.
authored
65
ecf7200 @rejeep Update README.
authored
66 Place cursor on `bar`, then press `C-;` and you will see:
67
68 foo('')
9921862 @rejeep Update README.
authored
69
0c94824 @rejeep Update README.
authored
70 ### String interpolation
ecf7200 @rejeep Update README.
authored
71
72 Insert:
73
74 foo('bar')
75 foo("bar")
9921862 @rejeep Update README.
authored
76 `bar`
77 %(bar)
ecf7200 @rejeep Update README.
authored
78
9921862 @rejeep Update README.
authored
79 Place cursor on `bar`, then press `#` and you will see:
ecf7200 @rejeep Update README.
authored
80
9921862 @rejeep Update README.
authored
81 foo('b#ar')
82 foo("b#{}ar")
83 `b#{}ar`
84 %(b#{}ar)
ecf7200 @rejeep Update README.
authored
85
a5f86ea @rejeep Add TODO in README.
authored
86 ## TODO
87
88 * Convert `do/end` block to `{/}` and reverse
3325ed9 @rejeep Also on definition.
authored
89 * Add/remove parenthesis on function call/definition
a5f86ea @rejeep Add TODO in README.
authored
90
ecf7200 @rejeep Update README.
authored
91 ## Contribution
92 Contribution is much welcome! Ruby tools is tested using
93 [Ecukes](http://ecukes.info). When Adding new features, please write
94 tests for them!
95
96 To fetch Ecukes:
97
98 $ cd /path/to/ruby-tools
99 $ git submodule init
100 $ git submodule update
9921862 @rejeep Update README.
authored
101
ecf7200 @rejeep Update README.
authored
102 Run the tests with:
103
104 $ ./util/ecukes/ecukes features
Something went wrong with that request. Please try again.