Coder Social home page Coder Social logo

tiagotex / ruby-extract-method Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pashamur/ruby-extract-method

0.0 2.0 0.0 161 KB

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

JavaScript 3.78% Python 96.22%

ruby-extract-method's Introduction

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.

ruby-extract-method's People

Contributors

pashamur avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.