{"id":13878361,"url":"https://github.com/synvert-hq/synvert-ruby","last_synced_at":"2025-04-09T05:08:31.455Z","repository":{"id":14416901,"uuid":"17127853","full_name":"synvert-hq/synvert-ruby","owner":"synvert-hq","description":"write snippet code to rewrite your project code","archived":false,"fork":false,"pushed_at":"2024-04-13T01:19:07.000Z","size":431,"stargazers_count":686,"open_issues_count":1,"forks_count":19,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-04-13T13:08:32.582Z","etag":null,"topics":["ruby","synvert"],"latest_commit_sha":null,"homepage":"https://synvert.net","language":"Ruby","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/synvert-hq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2014-02-24T06:53:46.000Z","updated_at":"2024-04-15T08:58:35.411Z","dependencies_parsed_at":"2024-01-02T01:02:41.502Z","dependency_job_id":"5cd5531f-2e48-4acc-a5c4-a0a76fa9c48c","html_url":"https://github.com/synvert-hq/synvert-ruby","commit_stats":{"total_commits":401,"total_committers":8,"mean_commits":50.125,"dds":0.06234413965087282,"last_synced_commit":"ca4144a1448e8b24a108a38c8a6db10f4c3394fe"},"previous_names":["synvert-hq/synvert-ruby","xinminlabs/synvert-ruby"],"tags_count":83,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synvert-hq%2Fsynvert-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synvert-hq%2Fsynvert-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synvert-hq%2Fsynvert-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synvert-hq%2Fsynvert-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synvert-hq","download_url":"https://codeload.github.com/synvert-hq/synvert-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ruby","synvert"],"created_at":"2024-08-06T08:01:47.318Z","updated_at":"2025-04-09T05:08:31.437Z","avatar_url":"https://github.com/synvert-hq.png","language":"Ruby","readme":"# synvert-ruby\n\n\u003cimg src=\"https://synvert.net/img/logo_96.png\" alt=\"logo\" width=\"32\" height=\"32\" /\u003e\n\n[![AwesomeCode Status for synvert-hq/synvert-ruby](https://awesomecode.io/projects/47cd9805-171c-4c61-b927-baa46cd4020a/status)](https://awesomecode.io/repos/synvert-hq/synvert-ruby)\n[![Build Status](https://github.com/synvert-hq/synvert-ruby/actions/workflows/main.yml/badge.svg)](https://github.com/synvert-hq/synvert-ruby/actions/workflows/main.yml)\n[![Gem Version](https://badge.fury.io/rb/synvert.svg)](http://badge.fury.io/rb/synvert)\n\n`synvert-ruby` is a command tool to rewrite ruby code automatically, it depends on `synvert-core-ruby` and `synvert-snippets-ruby`.\n\n[synvert-core-ruby](https://github.com/synvert-hq/synvert-core-ruby) provides a set of DSLs to rewrite ruby code.\n\n[synvert-snippets-ruby](https://github.com/synvert-hq/synvert-snippets-ruby) provides official snippets to rewrite ruby code.\n\n## Installation\n\nTo install the latest version, run\n\n\n```\n$ gem install synvert\n```\n\nThis will also install `synvert-core-ruby`.\n\nSynvert is completely working with remote snippets on github,\nbut you can sync all official snippets locally to make it run faster.\n\n```\n$ synvert-ruby --sync\n```\n\nThen you can use synvert to rewrite your ruby code, e.g.\n\n```\n$ synvert-ruby -r factory_bot/use_short_syntax\n```\n\n## Usage\n\n```\n$ synvert-ruby -h\nUsage: synvert-ruby [project_path]\n    -l, --list                       list all available snippets\n    -q, --query QUERY                query specified snippets\n    -s, --show SNIPPET_NAME          show specified snippet description, SNIPPET_NAME is combined by group and name, e.g. ruby/new_hash_syntax\n    -o, --open SNIPPET_NAME          Open a snippet\n    -g, --generate NEW_SNIPPET_NAME  generate a new snippet\n        --sync                       sync snippets\n        --execute EXECUTE_COMMAND    execute snippet\n    -r, --run SNIPPET_NAME           run a snippet with snippet name, e.g. ruby/new_hash_syntax, or remote url, or local file path\n    -t, --test SNIPPET_NAME          test a snippet with snippet name, e.g. ruby/new_hash_syntax, or remote url, or local file path\n        --show-run-process           show processing files when running a snippet\n        --only-paths DIRECTORIES     only specified files or directories, separated by comma, e.g. app/models,app/controllers\n        --skip-paths FILE_PATTERNS   skip specified files or directories, separated by comma, e.g. vendor/,lib/**/*.rb\n    -f, --format FORMAT              output format\n        --number-of-workers NUMBER_OF_WORKERS\n                                     set the number of workers, if it is greater than 1, it tests snippet in parallel\n        --double-quote               prefer double quote, it uses single quote by default\n        --tab-width TAB_WIDTH        prefer tab width, it uses 2 by default\n    -v, --version                    show this version\n```\n\n### Sync snippets\n\n[Official Snippets](https://github.com/synvert-hq/synvert-snippets-ruby) are available on github,\nyou can sync them any time you want.\n\n```\n$ synvert-ruby --sync\n```\n\n### List snippets\n\nList all available snippets\n\n```\n$ synvert-ruby -l\n\n$ synvert-ruby --list --format json\n```\n\n### Show a snippet\n\nDescribe what a snippet does.\n\n```\n$ synvert-ruby -s factory_bot/use_short_syntax\n```\n\n### Open a snippet\n\nOpen a snippet in your editor, editor is defined in\n`ENV['SNIPPET_EDITOR']` or `ENV['EDITOR']`\n\n```\n$ synvert-ruby -o factory_bot/use_short_syntax\n```\n\n### Run a snippet\n\nRun a snippet, analyze and then rewrite code.\n\n```\n$ synvert-ruby -r factory_bot/use_short_syntax ~/Sites/synvert-hq/synvert-core-ruby\n```\n\nRun a snippet from remote url\n\n```\n$ synvert-ruby -r https://raw.githubusercontent.com/synvert-hq/synvert-snippets-ruby/master/lib/factory_bot/use_short_syntax.rb ~/sites/synvert-hq/synvert-core-ruby\n```\n\nRun a snippet from local path\n\n```\n$ synvert-ruby -r ~/.synvert-ruby/lib/factory_bot/use_short_syntax.rb ~/sites/synvert-hq/synvert-core-ruby\n```\n\nSkip paths\n\n```\n$ synvert-ruby -r factory_bot/use_short_syntax --skip-paths vendor/ ~/sites/synvert-hq/synvert-core-ruby\n```\n\nOnly paths\n\n```\n$ synvert-ruby -r factory_bot/use_short_syntax --only-paths app/models/ ~/sites/synvert-hq/synvert-core-ruby\n```\n\nShow processing files when running a snippet.\n\n```\n$ synvert-ruby -r factory_bot/use_short_syntax --show-run-process ~/Sites/synvert-hq/synvert-core-ruby\n```\n\n### Generate a snippet\n\nGenerate a new snippet\n\n```\n$ synvert-ruby -g ruby/convert_foo_to_bar\n```\n","funding_links":[],"categories":["Ruby","ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynvert-hq%2Fsynvert-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynvert-hq%2Fsynvert-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynvert-hq%2Fsynvert-ruby/lists"}