Project

mk.rb

0.0
The project is in a healthy, maintained state
A CLI tool to create new projects from templates stored in ~/templates.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.0
~> 13.0
~> 1.21
~> 0.9
 Project Readme

mk

A CLI tool to create new projects from templates.

Install

gem install mk.rb

Usage

mk <template_name> <project_name>

This will:

  1. Copy the template to ./<project_name>
  2. Replace ExampleGem with your project's constant name (e.g., MyProject)
  3. Replace examplegem with your project name (e.g., my_project)
  4. Rename any files containing these placeholders

Example

mk ruby my_awesome_gem

Creates a new directory my_awesome_gem from the ruby template with all placeholders replaced.

Templates

Templates are searched in this order:

  1. ~/templates/<template_name> - Your local templates (takes priority)
  2. Bundled templates included with the gem

To override a bundled template, create one with the same name in ~/templates/.

Creating Templates

Templates are regular directories containing your project boilerplate. Use these placeholders:

  • ExampleGem - Replaced with the constant name (e.g., MyAwesomeGem)
  • examplegem - Replaced with the project name (e.g., my_awesome_gem)

Placeholders work in both file contents and file/directory names.

Example

mk ruby my_gem

Template file ~/templates/ruby/lib/examplegem.rb:

class ExampleGem
  VERSION = "0.1.0"
end

Output file my_gem/lib/my_gem.rb:

class MyGem
  VERSION = "0.1.0"
end

Contributing

Bug reports and pull requests are welcome on GitHub.

Development

After checking out the repo:

bin/setup
bundle exec rake test

Generate documentation:

bundle exec yard doc
bundle exec yard server  # Browse at http://localhost:8808

License

The gem is available as open source under the terms of the MIT License.