Thanks to visit codestin.com
Credit goes to github.com

Skip to content

n-at-han-k/mk.rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •