Permalink
Browse files

Merge branch 'master' of github.com:osterman/copyright-header

  • Loading branch information...
osterman committed Oct 16, 2012
2 parents 121adf6 + 804b02a commit 214bbbc411a075bd4c22b0038d464e992c2f56ff
Showing with 10 additions and 2 deletions.
  1. +8 −0 contrib/syntax.yml
  2. +1 −1 copyright-header.gemspec
  3. +1 −1 lib/copyright_header/parser.rb
View
@@ -6,6 +6,14 @@ ruby:
close: '#\n'
prefix: '# '
+python:
+ ext: ['.py']
+ after: ['^#!', '^#.*coding']
+ comment:
+ open: '\n'
+ close: '\n'
+ prefix: '# '
+
html:
ext: ['.html', '.htm', '.xhtml', '.xml']
comment:
View
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.version = CopyrightHeader::VERSION
s.authors = ["Erik Osterman"]
s.email = ["e@osterman.com"]
- s.license = ['GPL-3']
+ s.licenses = ["GPL-3"]
s.homepage = "https://github.com/osterman/copyright-header"
s.summary = %q{A utility to insert copyright headers into various types of source code files}
s.description = %q{A utility which is able to recursively insert and remove copyright headers from source code files based on file extensions.}
@@ -53,7 +53,7 @@ def format(comment_open = nil, comment_close = nil, comment_prefix = nil)
comment_open ||= ''
comment_close ||= ''
comment_prefix ||= ''
- license = comment_open + @lines.map { |line| comment_prefix + line }.join() + comment_close
+ license = comment_open + @lines.map { |line| (comment_prefix + line).gsub(/\s+\n$/, "\n") }.join() + comment_close
license.gsub!(/\\n/, "\n")
license
end

0 comments on commit 214bbbc

Please sign in to comment.