public
Description: Adds copyright headers to all the source files in a directory
Homepage:
Clone URL: git://github.com/slagyr/mmcopyrights.git
name age message
file .gitignore Tue Mar 10 21:17:43 -0700 2009 getting gemspec right this time [slagyr]
file README.rdoc Thu Mar 12 19:30:40 -0700 2009 added copyrights [slagyr]
file Rakefile Fri Mar 13 04:21:15 -0700 2009 To simplify, rake does not need explicit array ... [kleb]
file VERSION.yml Tue Mar 10 21:17:43 -0700 2009 getting gemspec right this time [slagyr]
directory lib/ Fri Mar 13 02:20:08 -0700 2009 To clean up control couple reported by Reek. [kleb]
file mmcopyrights.gemspec Tue Mar 10 21:17:43 -0700 2009 getting gemspec right this time [slagyr]
directory sample/ Tue Mar 10 20:07:54 -0700 2009 initial code push [slagyr]
directory spec/ Fri Mar 13 01:38:03 -0700 2009 Typo. [kleb]
README.rdoc

MM Copyrights

Add copyrights to your source files.

Copyrights (I know this is a bit recursive)

Copyright © 2009 Micah Martin. MM Copyrights and all included source files are distributed under terms of the GNU LGPL.

Install

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

Example

        require 'mmcopyrights'
        MM::Copyrights.process("lib", "rb", "#-", "©2009 Micah Martin\nAll 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.