Ruby Extract Method
Sublime Text Plugin that allows you to perform the Extract Method refactoring in ruby code. Inspired by https://github.com/wesf90/rails-partial
Details
Installs
- Total 790
- Win 280
- Mac 349
- Linux 161
Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime Text 2 plugin: Ruby Extract Method
A lightweight plugin that creates a method from the highlighted text and saves it to your clipboard.
Shortcut Keys
Windows / OSX / Linux:
ALT+M
- Extract Method
How to perform the Extract Method refactoring in a Ruby file.
- Select the block of code you wish to put into a method and hit the Shortcut Key (
Alt+M
) - Name the method
- Hit
Enter
- Move your cursor to where you want to put the method, and hit
Shift+Ctrl+V
(paste with indent)
Hint: You can also redefine Ctrl+V
as paste_with_indent
, which will make this plugin a little more intuitive.
Installation
You have two options, the easier of which is to install this package through Package Control.
Package Control
- Ensure Package Control is installed and Sublime Text 2 has been restarted.
- Open the Command Palette (Command+Shift+P on OS X, Control+Shift+P on Linux/Windows).
- Select “Package Control: Install Package”
- Select Ruby Extract Method when the list appears.
Congratulations! The package is now installed on your system.
Git
$ git clone git://github.com/pashamur/ruby-extract-method.git RubyExtractMethod
Further instructions below.
Windows XP, 7 and 8
Execute the commands below one by one in your Command prompt.
$ cd "%APPDATA%\Sublime Text 2\Packages"
$ git clone git://github.com/pashamur/ruby-extract-method.git "RubyExtractMethod"
Linux
Execute the commands below one by one in your terminal.
$ cd ~/.config/sublime-text-2/Packages/
$ git clone git://github.com/pashamur/ruby-extract-method.git RubyExtractMethod
Limitations
The plugin does not currently support multiple selections. If you select more than one block, only the first one will be used in method creation.