Giter Club home page Giter Club logo

kanagata's Introduction

Kanagata

Kanagata is a file generator based on ERB template files.

Installation

Add this line to your application's Gemfile:

gem 'kanagata'

And then execute:

$ bundle

Or install it yourself as:

$ gem install kanagata

Usage

$ kanagata -h
Commands:
  kanagata destroy [RECIPE_NAME]   # Destroy files based on recipe and template files
  kanagata generate [RECIPE_NAME]  # Generate files based on recipe and template files
  kanagata help [COMMAND]          # Describe available commands or one specific command
  kanagata init                    # Generate sample recipe and template files

e.g. .gitconfig

You can prepare a recipe file with the following command to set up your gitconfig file:

$ cat <<EOF>>.kanagata
gitconfig:
  templates:
    - path: ~/.gitconfig
EOF

Next, you can make a template file with the following command:

$ mkdir kanagata
$ cat <<EOF>>kanagata/.kanagata.erb
[user]
  name  = <%= name %>
  email = <%= email %>
[alias]
  ci = commit -v
  co = checkout
  st = status
  di = diff
  br = branch
  df = diff
[color]
  diff        = auto
  status      = auto
  branch      = auto
  interactive = auto
EOF

Your gitconfig file is generated at your $HOME dir after running the following command.

$ kanagata generate gitconfig name:'YOUR NAME' email:[email protected]

If you want to delete kanagata generated files, you can just run kanagata destroy gitconfig command.

To make your original kanagata recipe and template files

You can make sample files with the following command:

$ kanagata init [YOUR_RECIPE_NAME]

kanagata init command generates one directory and two files.

  • `kanagata' directory is template file directory, so you can store template files in this directory.
  • .kanagata file is a recipe file.
  • kanagata/sample.yml.erb file is a sample template file.

Development

After checking out the repository, run bundle install to install dependencies. Then, run rspec to run the tests.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/masa0x80/kanagata/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

kanagata's People

Contributors

masa0x80 avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.