{"id":22769683,"url":"https://github.com/bfontaine/yop","last_synced_at":"2025-03-30T11:29:30.150Z","repository":{"id":26656903,"uuid":"30113180","full_name":"bfontaine/Yop","owner":"bfontaine","description":"Bootstrap your projects with predefined templates","archived":false,"fork":false,"pushed_at":"2017-12-23T00:07:58.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T23:43:42.353Z","etag":null,"topics":["cli","ruby","tool"],"latest_commit_sha":null,"homepage":null,"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/bfontaine.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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":"2015-01-31T13:40:02.000Z","updated_at":"2023-02-17T00:08:50.000Z","dependencies_parsed_at":"2022-07-25T15:48:13.473Z","dependency_job_id":null,"html_url":"https://github.com/bfontaine/Yop","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2FYop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2FYop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2FYop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2FYop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfontaine","download_url":"https://codeload.github.com/bfontaine/Yop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246313020,"owners_count":20757417,"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":["cli","ruby","tool"],"created_at":"2024-12-11T15:13:48.360Z","updated_at":"2025-03-30T11:29:30.128Z","avatar_url":"https://github.com/bfontaine.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yop\n\n[![Build Status](https://img.shields.io/travis/bfontaine/Yop.svg)](https://travis-ci.org/bfontaine/Yop)\n[![Gem Version](https://img.shields.io/gem/v/yop.svg)](http://badge.fury.io/rb/yop)\n[![Coverage Status](https://img.shields.io/coveralls/bfontaine/Yop.svg)](https://coveralls.io/r/bfontaine/Yop)\n[![Inline docs](http://inch-ci.org/github/bfontaine/yop.svg?branch=master)](http://inch-ci.org/github/bfontaine/yop)\n\nYop bootstraps your projects with custom templates.\n\nNote: this is an early release.\n\n## Roadmap\n\n1. Template directories ✓ (0.0.1)\n2. Placeholder variables ✓ (0.0.2)\n3. Dynamic variables ✓ (0.0.3)\n4. Security checks (e.g. don't write files outside of directory, -i option, etc)\n5. Filters (e.g. lowercase, default value, etc)\n6. Per-template config files\n7. Commands to remove or create an empty template\n8. Download templates from external sources (zips, git repos, etc)\n\n## Install\n\n    gem install yop\n\n## Usage\n\n    yop \u003ctemplate\u003e \u003cdirectory\u003e\n\nWhere `\u003ctemplate\u003e` is a local template and `\u003cdirectory\u003e` is your project’s\ndirectory. It’ll create it if it doesn’t exist, then recursively apply the\ntemplate on it. Any existing file will be overriden.\n\nYou can list existing existing templates with `--templates`:\n\n    yop --templates\n\n\n## Templates\n\nA template is just a directory located under `~/.yop/templates/`. It can\ncontain any files and directories you want. It supports placeholder variables,\nwhich will be replaced by a dynamic value later.\n\n### Writing a Template\n\nLet’s say you write a lot of Python libraries, and always use the same\ndirectory tree. It’d be great to store this tree somewhere on your system and\nbe able to use it for each project. Yop is here for that.\n\nStart by creating a new directory under `~/.yop/templates/`:\n\n    cd ~/.yop/templates \u0026\u0026 mkdir python-lib \u0026\u0026 cd python-lib\n\nCongratulations, you created your first template! It’s empty, but Yop can\nalready use it:\n\n    $ yop --templates\n    * python-lib\n\nLet’s add a generic README to the template. You can add placeholder variables\nwith `{(NAME)}` :\n\n    $ cat README.md\n    # {(LIB_NAME)}\n\n    ``{(LIB_NAME)}`` is a Python library written by {(AUTHOR_NAME)}.\n\nYou can also use placeholders in paths:\n\n    $ mkdir '{(MODULE_NAME)}'\n    $ touch '{(MODULE_NAME)}'/__init__.py\n\nOnce you’re satisfied with your template, you can try it:\n\n    $ yop python-lib my-directory\n\nYop will create `my-directory` and start copy `~/.yop/template/python-lib`’s\ncontent in it. It’ll ask you each time it encounters a placeholder it doesn’t\nknow:\n\n    $ yop python-lib my-directory\n    Applying template 'python-lib' on my-directory...\n    MODULE_NAME = \u003center your module name, e.g. \"mylib\"\u003e\n    LIB_NAME = \u003center your library name, e.g. \"My Library\"\u003e\n    AUTHOR_NAME = \u003center your name, e.g. \"Mike\"\u003e\n    Done!\n\n\n    $ tree my-directory/\n    my-directory/\n    ├── mylib\n    │   └── __init__.py\n    └── README.md\n\n    1 directory, 2 files\n\n\n    $ cat my-directory/README.md\n    # My Library\n\n    ``My Library`` is a Python library written by Mike.\n\n\nYou can pre-populate fixed variables like your name or your email in\n`~/.yop/config.yml`, under `:vars`:\n\n```yaml\n:vars:\n  :AUTHOR_NAME: Mike\n  :AUTHOR_EMAIL: mike@example.com\n```\n\nVariables can be either strings or symbols. They must be upper-cased and start\nwith a letter. They can contain numbers and underscores.\n\nSome dynamic variables can be provided by Yop. For now, it only includes the\ncurrent year. Dynamic variables start with a `!`.\n\n* `{(!CURRENT_YEAR)}` gives `2015` (if the current year is 2015)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fyop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfontaine%2Fyop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fyop/lists"}