Code Monkey home page Code Monkey logo

peacock's Introduction

Peacock

Peacock is a small tool to easily manage your .gitignore written in ruby.

It lets you extract files and directories from .gitignore files as well as inserting new files to .gitignore

Installation

Install by executing:

$ gem install peacock

Usage

Usage:

peacock [options] [files/directories]

Options:

-h, [--help]        # show this text
-r, [--root]        # use root .gitignore
-s, [--silent]      # suppress output
-e, [--extract]     # extract file from .gitignore

Example

$ git status
...
Untracked files:
    these
    are
    some
    files

$ peacock are some
added are to .gitignore
added some to .gitignore

$ git status
...
Untracked files:
    these
    files

$ peacock -e are
removed are from .gitignore

$ git status
...
Untracked files:
    these
    are
    files

TODO

Issues are used for TODOs

Contributing

  1. Fork it ( https://github.com/bakku/peacock/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

peacock's People

Contributors

bakku avatar

Watchers

James Cloos avatar  avatar

peacock's Issues

Restructure CLI

The peacock cli is old fashioned.
The following changes should be made:

commands should be executed as follows
peacock ignore
peacock extract
peacock clean

  • the first two commands will expect files after the command
  • root git ignore should be removed and only local git ignore is available

Make options combinable

Options are not combinable yet.

e.g. using

peacock -ev script.rb

does not work yet.

Either peacock switches to a 3rd-party CI library for ruby or it's own CI class/module will have to be extended

New option: Cleanup

There should be an option for cleaning up a .gitignore file.

The behaviour should be as follows:

  • -c/--cleanup should be used
  • there should be an optional argument expected with the .gitignore file
  • if no .gitignore file was passed then peacock will just search recursively upwards until it finds one
  • relatively from the .gitignore file which peacock uses here, it should check if the file or directory in the .gitignore exists, if not then peacock should delete that entry

Remove Peacock Commiting

After publishing the gem I encountered feedback which responded to me to remove the auto-commiting behaviour of peacock.

This shall be done now

Peacock should just manage the gitignore file but not commit to the repository

Stable Test Environment

Currently the tests are horrible. A more stable test environment is needed.

Rethink the tests and find a way. Also maybe rcov should be used here.

New option: Comments when inserting a new entry

Often we see in the gitignore file entries as follows:

# Ignore all logfiles and tempfiles.
/log/*.log

Adding a comment should be possible with peacock

Maybe the following syntax might be used

peacock file.txt "# secret text file"

which should result to

# secret text file
file.txt

The comment can be passed as the last argument which should be a string starting with an hashtag

If more than one file/directory was passed then the result should be as follows:

peacock file1.txt file2.txt file3.txt "# some unnecessary stuff"

Result:

# some unnecessary stuff
file1.txt
file2.txt
file3.txt

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.