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
  • 10 years ago
  • 1 hour ago
  • 11 years ago

Installs

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