Skip to content

Commit

Permalink
treat email address as optional in copyright notices
Browse files Browse the repository at this point in the history
add documentation for how copyright notices are parsed
  • Loading branch information
sunaku committed Jan 19, 2009
1 parent 61d8803 commit 01f942d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/inochi/inochi.rb
Expand Up @@ -200,6 +200,14 @@ def main project_symbol, *trollop_args, &trollop_config
# the project license file. NOTE that the first copyright
# notice must correspond to the primary project maintainer.
#
# Copyright notices must be in the following form:
#
# Copyright YEAR HOLDER <EMAIL>
#
# Where HOLDER is the name of the copyright holder, YEAR is the year
# when the copyright holder first began working on the project, and
# EMAIL is (optional) the email address of the copyright holder.
#
# @param [Symbol] project_symbol
# Name of the Ruby constant which serves
# as a namespace for the entire project.
Expand Down Expand Up @@ -269,7 +277,10 @@ def rake project_symbol, options = {}, &gem_config

# add AUTHORS constant to the project module
license = File.read(options[:license_file])
copyright_holders = license.scan %r{Copyright.*\d+\s+(.*)(?:\s+<(.*?)>)}

copyright_holders =
license.scan(/Copyright.*?\d+\s+(.*)/).flatten.
map {|s| (s =~ /\s*<(.*?)>/) ? [$`, $1] : [s, ''] }

project_module.const_set :AUTHORS, copyright_holders

Expand Down

0 comments on commit 01f942d

Please sign in to comment.