ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Ruby Extract Method

by pashamur ST2

Sublime Text Plugin that allows you to perform the Extract Method refactoring in ruby code. Inspired by https://github.com/wesf90/rails-partial

Details

  • 2014.01.20.23.03.36
  • github.​com
  • github.​com
  • 11 years ago
  • 2 hours ago
  • 11 years ago

Installs

  • Total 790
  • Win 280
  • Mac 349
  • Linux 161
Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12
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.

  1. Select the block of code you wish to put into a method and hit the Shortcut Key (Alt+M)
  2. Name the method
  3. Hit Enter
  4. 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

  1. Ensure Package Control is installed and Sublime Text 2 has been restarted.
  2. Open the Command Palette (Command+Shift+P on OS X, Control+Shift+P on Linux/Windows).
  3. Select “Package Control: Install Package”
  4. 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.