copyright-header 1.0.19 → 1.0.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86579d97ed6939bdd76b21106c3d7e6817dc991c
4
- data.tar.gz: 3d132331d64df527a04634d5ccdc453408040986
3
+ metadata.gz: b0ace4d67de56456beed033ec3836b7709c0beb3
4
+ data.tar.gz: 8df770cacdc38b799c4a7f5231844a8f7253e140
5
5
  SHA512:
6
- metadata.gz: 3a04d27fa2a14cb007f14426980a76de835a862314f8b9c5babd23321fc83bc56ced7b05197daa3b86ad376a83dd2007de0cdfde8eee23707e1624c59c6cf6fb
7
- data.tar.gz: bd9050dee1f25ef32ef7791496fed538d5cc05d61291332c07022766d50a277b5fe94f7ec21f6d1054fffb8820a83da5eb01d4923a6dbad02beccd2dbdc256fb
6
+ metadata.gz: f604381db7c850be272543b5d8c412b01208abb3243303cedb6d3a82b6ff1758a4555aaa48835dbe11feb58a9ea10beebe05951a646cb08bffbe45d6da4f77b3
7
+ data.tar.gz: 94e757d6f666d779c121109c1cb590a0d06d2b05c4fa280eaf5b987326e6209a342abcb9b1696d6f09148c3cfcaa16ed2f519e9e065179d76cf9da2836422b30
@@ -0,0 +1,19 @@
1
+ FROM ubuntu:16.04
2
+
3
+ RUN apt-get update && \
4
+ apt-get -y install ruby ruby-dev git make build-essential libicu-dev zlib1g-dev cmake pkg-config
5
+
6
+ ADD . /tmp/copyright-header/
7
+ ADD .git /tmp/copyright-header/.git
8
+
9
+ WORKDIR /tmp/copyright-header/
10
+
11
+ RUN gem build copyright-header.gemspec && \
12
+ gem install copyright-header-*.gem && \
13
+ rm -rf /tmp/copyright-header
14
+
15
+ VOLUME ["/usr/src"]
16
+
17
+ WORKDIR /usr/src
18
+
19
+ ENTRYPOINT ["/usr/local/bin/copyright-header"]
@@ -0,0 +1,35 @@
1
+ COPYRIGHT_CMD ?= copyright-header
2
+ #COPYRIGHT_CMD ?= docker run --rm --volume `pwd`:$(COPYRIGHT_OUTPUT_DIR) osterman/copyright-header
3
+ COPYRIGHT_LICENSE ?= GPL3
4
+ COPYRIGHT_HOLDER ?= Erik Osterman <e@osterman.com>
5
+ COPYRIGHT_YEAR ?= 2012-2016
6
+ COPYRIGHT_SOFTWARE ?= Copyright Header
7
+ COPYRIGHT_SOFTWARE_DESCRIPTION ?= A utility to manipulate copyright headers on source code files
8
+ COPYRIGHT_OUTPUT_DIR ?= /usr/src
9
+ COPYRIGHT_WORD_WRAP ?= 100
10
+
11
+ remove-copyright:
12
+ $(COPYRIGHT_CMD) \
13
+ --license $(COPYRIGHT_LICENSE) \
14
+ --remove-path lib/:bin/ \
15
+ --guess-extension \
16
+ --copyright-holder '$(COPYRIGHT_HOLDER)' \
17
+ --copyright-software '$(COPYRIGHT_SOFTWARE)' \
18
+ --copyright-software-description '$(COPYRIGHT_SOFTWARE_DESCRIPTION)' \
19
+ --copyright-year $(COPYRIGHT_YEAR) \
20
+ --word-wrap $(COPYRIGHT_WORD_WRAP) \
21
+ --output-dir $(COPYRIGHT_OUTPUT_DIR)
22
+
23
+ add-copyright:
24
+ $(COPYRIGHT_CMD) \
25
+ --license $(COPYRIGHT_LICENSE) \
26
+ --add-path lib/:bin/ \
27
+ --guess-extension \
28
+ --copyright-holder '$(COPYRIGHT_HOLDER)' \
29
+ --copyright-software '$(COPYRIGHT_SOFTWARE)' \
30
+ --copyright-software-description '$(COPYRIGHT_SOFTWARE_DESCRIPTION)' \
31
+ --copyright-year $(COPYRIGHT_YEAR) \
32
+ --word-wrap $(COPYRIGHT_WORD_WRAP) \
33
+ --output-dir $(COPYRIGHT_OUTPUT_DIR)
34
+
35
+
@@ -1,24 +1,23 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
3
  # Copyright Header - A utility to manipulate copyright headers on source code files
4
- # Copyright (C) 2012 Erik Osterman <e@osterman.com>
5
- #
4
+ # Copyright (C) 2012-2016 Erik Osterman <e@osterman.com>
5
+ #
6
6
  # This file is part of Copyright Header.
7
- #
7
+ #
8
8
  # Copyright Header is free software: you can redistribute it and/or modify
9
9
  # it under the terms of the GNU General Public License as published by
10
10
  # the Free Software Foundation, either version 3 of the License, or
11
11
  # (at your option) any later version.
12
- #
12
+ #
13
13
  # Copyright Header is distributed in the hope that it will be useful,
14
14
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
16
  # GNU General Public License for more details.
17
- #
17
+ #
18
18
  # You should have received a copy of the GNU General Public License
19
19
  # along with Copyright Header. If not, see <http://www.gnu.org/licenses/>.
20
20
  #
21
-
22
21
  $:.unshift(File.expand_path('.')) # Ruby 1.9 doesn't have . in the load path...
23
22
  $:.push(File.expand_path('lib/'))
24
23
 
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.version = CopyrightHeader::VERSION
9
9
  s.authors = ["Erik Osterman"]
10
10
  s.email = ["e@osterman.com"]
11
- s.licenses = ["GPL-3"]
11
+ s.licenses = ["GPL-3.0"]
12
12
  s.homepage = "https://github.com/osterman/copyright-header"
13
13
  s.summary = %q{A utility to insert copyright headers into various types of source code files}
14
14
  s.description = %q{A utility which is able to recursively insert and remove copyright headers from source code files based on file extensions.}
@@ -1,19 +1,19 @@
1
1
  #
2
2
  # Copyright Header - A utility to manipulate copyright headers on source code files
3
- # Copyright (C) 2012 Erik Osterman <e@osterman.com>
4
- #
3
+ # Copyright (C) 2012-2016 Erik Osterman <e@osterman.com>
4
+ #
5
5
  # This file is part of Copyright Header.
6
- #
6
+ #
7
7
  # Copyright Header is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU General Public License as published by
9
9
  # the Free Software Foundation, either version 3 of the License, or
10
10
  # (at your option) any later version.
11
- #
11
+ #
12
12
  # Copyright Header is distributed in the hope that it will be useful,
13
13
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
15
  # GNU General Public License for more details.
16
- #
16
+ #
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with Copyright Header. If not, see <http://www.gnu.org/licenses/>.
19
19
  #
@@ -1,19 +1,19 @@
1
1
  #
2
2
  # Copyright Header - A utility to manipulate copyright headers on source code files
3
- # Copyright (C) 2012 Erik Osterman <e@osterman.com>
4
- #
3
+ # Copyright (C) 2012-2016 Erik Osterman <e@osterman.com>
4
+ #
5
5
  # This file is part of Copyright Header.
6
- #
6
+ #
7
7
  # Copyright Header is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU General Public License as published by
9
9
  # the Free Software Foundation, either version 3 of the License, or
10
10
  # (at your option) any later version.
11
- #
11
+ #
12
12
  # Copyright Header is distributed in the hope that it will be useful,
13
13
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
15
  # GNU General Public License for more details.
16
- #
16
+ #
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with Copyright Header. If not, see <http://www.gnu.org/licenses/>.
19
19
  #
@@ -141,4 +141,4 @@ module CopyrightHeader
141
141
  @parser.execute
142
142
  end
143
143
  end
144
- end
144
+ end
@@ -1,19 +1,19 @@
1
1
  #
2
2
  # Copyright Header - A utility to manipulate copyright headers on source code files
3
- # Copyright (C) 2012 Erik Osterman <e@osterman.com>
4
- #
3
+ # Copyright (C) 2012-2016 Erik Osterman <e@osterman.com>
4
+ #
5
5
  # This file is part of Copyright Header.
6
- #
6
+ #
7
7
  # Copyright Header is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU General Public License as published by
9
9
  # the Free Software Foundation, either version 3 of the License, or
10
10
  # (at your option) any later version.
11
- #
11
+ #
12
12
  # Copyright Header is distributed in the hope that it will be useful,
13
13
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
15
  # GNU General Public License for more details.
16
- #
16
+ #
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with Copyright Header. If not, see <http://www.gnu.org/licenses/>.
19
19
  #
@@ -118,7 +118,10 @@ module CopyrightHeader
118
118
  def remove(license)
119
119
  if has_copyright?
120
120
  text = self.format(license)
121
- @contents.gsub!(/#{Regexp.escape(text)}/, '')
121
+ # Due to editors messing with whitespace, we'll make this more of a fuzzy match and use \s to match whitespace
122
+ pattern = Regexp.escape(text).gsub(/\\[ n]/, '\s*').gsub(/\\s*$/, '\s')
123
+ exp = Regexp.new(pattern)
124
+ @contents.gsub!(exp, '')
122
125
  @contents
123
126
  else
124
127
  STDERR.puts "SKIP #{@file}; copyright not detected"
@@ -261,4 +264,4 @@ module CopyrightHeader
261
264
  end
262
265
  end
263
266
  end
264
- end
267
+ end
@@ -1,22 +1,22 @@
1
1
  #
2
2
  # Copyright Header - A utility to manipulate copyright headers on source code files
3
- # Copyright (C) 2012 Erik Osterman <e@osterman.com>
4
- #
3
+ # Copyright (C) 2012-2016 Erik Osterman <e@osterman.com>
4
+ #
5
5
  # This file is part of Copyright Header.
6
- #
6
+ #
7
7
  # Copyright Header is free software: you can redistribute it and/or modify
8
8
  # it under the terms of the GNU General Public License as published by
9
9
  # the Free Software Foundation, either version 3 of the License, or
10
10
  # (at your option) any later version.
11
- #
11
+ #
12
12
  # Copyright Header is distributed in the hope that it will be useful,
13
13
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
15
  # GNU General Public License for more details.
16
- #
16
+ #
17
17
  # You should have received a copy of the GNU General Public License
18
18
  # along with Copyright Header. If not, see <http://www.gnu.org/licenses/>.
19
19
  #
20
20
  module CopyrightHeader
21
- VERSION = "1.0.19"
21
+ VERSION = "1.0.20"
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copyright-header
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.19
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Osterman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-31 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-linguist
@@ -39,8 +39,10 @@ extra_rdoc_files:
39
39
  files:
40
40
  - ".gitignore"
41
41
  - AUTHORS
42
+ - Dockerfile
42
43
  - Gemfile
43
44
  - LICENSE
45
+ - Makefile
44
46
  - README.md
45
47
  - Rakefile
46
48
  - bin/copyright-header
@@ -60,7 +62,7 @@ files:
60
62
  - licenses/MIT.erb
61
63
  homepage: https://github.com/osterman/copyright-header
62
64
  licenses:
63
- - GPL-3
65
+ - GPL-3.0
64
66
  metadata: {}
65
67
  post_install_message:
66
68
  rdoc_options: []