{"id":16405932,"url":"https://github.com/geoffharcourt/vim-ruby-private-method-extract","last_synced_at":"2026-02-08T16:03:02.890Z","repository":{"id":10537407,"uuid":"12732236","full_name":"geoffharcourt/vim-ruby-private-method-extract","owner":"geoffharcourt","description":null,"archived":false,"fork":false,"pushed_at":"2013-09-10T15:36:27.000Z","size":124,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-27T15:53:35.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"VimL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geoffharcourt.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-10T14:46:05.000Z","updated_at":"2017-06-01T18:18:53.000Z","dependencies_parsed_at":"2022-08-28T19:31:08.496Z","dependency_job_id":null,"html_url":"https://github.com/geoffharcourt/vim-ruby-private-method-extract","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/geoffharcourt/vim-ruby-private-method-extract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffharcourt%2Fvim-ruby-private-method-extract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffharcourt%2Fvim-ruby-private-method-extract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffharcourt%2Fvim-ruby-private-method-extract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffharcourt%2Fvim-ruby-private-method-extract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geoffharcourt","download_url":"https://codeload.github.com/geoffharcourt/vim-ruby-private-method-extract/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffharcourt%2Fvim-ruby-private-method-extract/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29236138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T14:18:14.570Z","status":"ssl_error","status_checked_at":"2026-02-08T14:18:14.071Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T06:07:53.650Z","updated_at":"2026-02-08T16:03:02.870Z","avatar_url":"https://github.com/geoffharcourt.png","language":"VimL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vim-ruby-private-method-extract\n\nExperimental project to extract private methods out of longer existing methods.\n\n* Creates a private section of the class if one doesn't exist.\n* Takes a visual selection and names the method after the local variable before the equals sign.\n* Makes the statement following the equals sign the method body.\n* Trims whitespace and fixes indentation after call.\n\nThis project is an initial effort in learning Vimscript. Contributions and suggestions for improvement are very welcome.\n\n# How to use\n1. In visual mode (I use visual-line mode), select a piece of a method that you want to extract to a private method.\n2. Call ExtractPrivateMethod(). You can bind this to a shortcut for maximum efficiency.\n3. If your class has a private section, a new private method is inserted with the statement selected. The method is named after the local variable before the equals sign, and the method body is the statement after the equals sign.\n4. The original statement is deleted.\n\nExample:\n\nStart with this:\n\n```ruby\nclass MyClass\n  \n  def too_long_method\n    temp_query = thing_to_call.method_to_call\n\n    temp_query.something_else_to_do\n  end\n\nend\n```\n\nAfter highlighting the first line of ````too_long_method```` and calling ````ExtractPrivateMethod()````, the class looks like this:\n\n```ruby\nclass MyClass\n  \n  def too_long_method\n    temp_query.something_else_to_do\n  end\n\n  private\n\n  def temp_query\n    thing_to_call.method_to_call\n  end\n\nend\n```\n\n# Credits\nvim-ruby-private-method-extract was created and is maintained by [Geoff Harcourt](http://github.com/geoffharcourt).\n\nThe functionality was inspired by a macro run by [Ben Orenstein](http://github/com/r00k) during his \"Refactoring From Good to Great\" talks.\n\n## License\nvim-ruby-private-method-extract is free software, and may be redistributed under the terms specified in the [LICENSE](https://github.com/geoffharcourt/vim-ruby-private-method-extract/blob/master/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoffharcourt%2Fvim-ruby-private-method-extract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeoffharcourt%2Fvim-ruby-private-method-extract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoffharcourt%2Fvim-ruby-private-method-extract/lists"}