Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Adds copyright headers to all the source files in a directory

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .idea
Octocat-spinner-32 lib
Octocat-spinner-32 sample
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 CHANGES.md
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 mmcopyrights.gemspec
README.rdoc

MM Copyrights

Add copyrights to your source files.

Copyrights (I know this is a bit recursive)

Copyright © 2012 Micah Martin. MM Copyrights and all included source files are distributed under terms of the MIT License.

Install

gem sources -a gems.github.com sudo gem install slagyr-mmcopyrights

Example

require 'mmcopyrights' MM::Copyrights.process(“lib”, “rb”, “#-”, “©2009 Micah MartinnAll rights reserved”)

Usage

MM::Copyrights.process(SOURCE_DIRECTORY, FILE_EXTENSION, COMMENT_PREFIX, COPYRIGHT_TEXT)

  • SOURCE_DIRECTORY - A directory where you keep source files

  • FILE_EXTENSION - To identify which files to process. A values of “rb” will process all files ending in “.rb”.

  • COMMENT_PREFIX - Be sure to use a unique comment prefix like “#-” for Ruby and “//-” for C, Java, C#, etc. This is used to identify existing copyright headers to remove or update them.

  • COPYRIGHT_TEXT - The content of your copyright message (without comment prefix)

Description

Running MM::Copyrights.process will add the COPYRIGHT_TEXT to all of the matching files in the SOURCE_DIRECTORY. Processing the files multiple times is harmless.

You can change the COPYRIGHT_TEXT and process files again. The old copyright headers will be replaces with the new content.

Something went wrong with that request. Please try again.