
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
Copyright Header is a utility to manipulate licenses on source code.
--license-file argument/[Cc]opyright|[Lc]icense/ in the first N lines\n") characters.Install Copyright Header from RubyForge:
gem install copyright-header
Full list of supported arguments:
Usage: copyright-header options [file]
-n, --dry-run Output the parsed files to STDOUT
-o, --output-dir DIR Use DIR as output directory
--license-file FILE Use FILE as header (instead of using --license argument)
--license [AGPL3|ASL2|BSD-2-CLAUSE|BSD-3-CLAUSE|BSD-4-CLAUSE|GPL3|MIT]
Use LICENSE as header
--copyright-software NAME The common name for this piece of software (e.g. "Copyright Header")
--copyright-software-description DESC
The detailed description for this piece of software (e.g. "A utility to manipulate copyright headers on source code files")
--copyright-holder NAME The legal owner of the copyright for the software. (e.g. "Erik Osterman <e@osterman.com>"). Repeat argument for multiple names.
--copyright-year YEAR The years for which the copyright exists (e.g. "2012-2017"). Repeat argument for multiple years.
-w, --word-wrap LEN Maximum number of characters per line for license (default: 80)
-a, --add-path PATH Recursively insert header in all files found in path (allows multiple paths separated by platform path-separator ":")
-r, --remove-path PATH Recursively remove header in all files found in path (allows multiple paths separated by platform path-separator ":")
-g, --guess-extension Use the GitHub Linguist gem to guess the extension of the source code when no extension can be determined (experimental).
-c, --syntax FILE Syntax configuration file
-V, --version Display version information
-h, --help Display this screen
Discover available parameters by passing the --help argument
copyright-header --help
Add a GPL3 License header to a file:
copyright-header --add-path /tmp/test.rb \
--license GPL3 \
--copyright-holder 'Joe Shmoe' \
--copyright-software 'Example Software' \
--copyright-software-description "This is the description of the software." \
--copyright-year 2012-2017 \
--output-dir /tmp \
--dry-run
Remove the header created in the previous step (without --dry-run argument):
copyright-header --remove-path /tmp/test.rb \
--license GPL3 \
--copyright-holder 'Joe Shmoe' \
--copyright-software 'Example Software' \
--copyright-software-description 'This is the description of the software.' \
--copyright-year 2012-2017 \
--output-dir /tmp \
--dry-run
Command used to generate copyright headers for this script:
copyright-header --license GPL3 \
--add-path lib/:bin/ \
--guess-extension \
--copyright-holder 'Erik Osterman <e@osterman.com>' \
--copyright-software 'Copyright Header' \
--copyright-software-description "A utility to manipulate copyright headers on source code files" \
--copyright-year 2012-2017 \
--word-wrap 100 \
--output-dir ./
Paths can be either files or directories. It will recursively traverse the directory tree ignoring all dot files.
You can specify an alternative syntax configuration file using the --syntax argument.
The above example can be performed as rake task inside a Rakefile:
task :headers do
require 'rubygems'
require 'copyright_header'
args = {
:license => 'GPL3',
:copyright_software => 'Copyright Header',
:copyright_software_description => "A utility to manipulate copyright headers on source code files",
:copyright_holders => ['Erik Osterman <e@osterman.com>'],
:copyright_years => ['2012-2017'],
:add_path => 'lib',
:output_dir => '.'
}
command_line = CopyrightHeader::CommandLine.new( args )
command_line.execute
end
docker run --rm --volume `pwd`:/usr/src/ osterman/copyright-header:latest \
--license GPL3 \
--add-path . \
--guess-extension \
--copyright-holder 'Erik Osteman <e@osterman.com>' \
--copyright-software 'Copyright Header' \
--copyright-software-description 'A utility to manipulate copyright headers on source code files' \
--copyright-year 2012-2017 \
--word-wrap 100 \
--output-dir /usr/src/
Here is how we typically use it in our Makefile.
Check out the Cloud Posse build-harness for other neat tricks.
https://github.com/osterman/copyright-header/graphs/contributors
git checkout -b my-new-feature)git commit -am 'Added some feature')git push origin my-new-feature)Author: Erik Osterman
E-mail: e@osterman.com
Homepage: http://www.osterman.com/
FAQs
Unknown package
We found that copyright-header demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.