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
Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | Dec 7 | Dec 6 | Dec 5 | Dec 4 | Dec 3 | Dec 2 | Dec 1 | Nov 30 | Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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.