giteaucrat 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/giteaucrat/file.rb +4 -2
- data/lib/giteaucrat/runner.rb +2 -2
- data/lib/giteaucrat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWQ5ZjA3Yzk3OGU1OTIwNWU3NmYyMjkyYzJmNGFjYzk0NTY4MGU1ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDlhZWYxZDU2ZjIxMmY3MWIzZTA2NDk2ZjVmMWFmNDY1Y2M1NTFkYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDJkMjJmZDIwNzIyODE4ZTYxNWQ3YzQ3MGYxMDE3NmMxNzJmMzlkNjFjMjk4
|
10
|
+
MzVlNjRkNjY1ZDdkNGExOWRlMWQ0YWIxYWEwZjk2ZGIxYzZlMjljY2U4NDU1
|
11
|
+
ZDYwY2E2MGZkNWI4M2MzZGM0Mjc3ODE1NzdlMTZmYjc0MmNkM2I=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDAxMGFiNGY1NzdlNzZiMjAyZDMyNWY2MzFlMmY0NjZhYWUxZjUxZWVkYzI4
|
14
|
+
YWMzNzlhYTZkNjE5YmM3MmU4Y2E4OWRmZTEwOTYyZmFkYjE3YTJiNzkxMDU2
|
15
|
+
ZTRmYmYxMDRkZGY4OTM5MDM5NWFiMTc4ZGRmOWNmYWY3MGRkZGU=
|
data/lib/giteaucrat/file.rb
CHANGED
@@ -41,10 +41,12 @@ module Giteaucrat
|
|
41
41
|
last = Regexp.escape(last)
|
42
42
|
contents = ::File.read(name)
|
43
43
|
ruler = "(#{first}(#{middle})*#{last}\n)"
|
44
|
-
coding = "(#{first}\s*.*coding:\s*utf-8\s*\n+)?"
|
44
|
+
coding = "\\A(#{first}\s*.*coding:\s*utf-8\s*\n+)?"
|
45
45
|
header = /#{coding}#{ruler}(#{first}.*#{last}\n)*\2\n*/m
|
46
46
|
if repo.include_encoding?
|
47
|
-
contents.sub!(header,
|
47
|
+
contents.sub!(header, '')
|
48
|
+
contents.sub!(/#{coding}/, '')
|
49
|
+
contents = "#{copyright}\n\n#{contents}"
|
48
50
|
else
|
49
51
|
contents.sub!(/(#{coding})/, "\1#{copyright}\n\n")
|
50
52
|
end
|
data/lib/giteaucrat/runner.rb
CHANGED
@@ -57,7 +57,7 @@ module Giteaucrat
|
|
57
57
|
|
58
58
|
def copyrights
|
59
59
|
repo.write_copyrights!
|
60
|
-
repo.commit("#{defaults[:commit_keyword]}: Update copyrights in source code") if options[:commit]
|
60
|
+
repo.commit!("#{defaults[:commit_keyword]}: Update copyrights in source code") if options[:commit]
|
61
61
|
FileUtils.mkdir_p(::File.join(path, 'tmp'))
|
62
62
|
::File.write(::File.join(path, 'tmp', 'giteaucrat_authors.yml'), Author.to_yaml)
|
63
63
|
end
|
@@ -79,7 +79,7 @@ module Giteaucrat
|
|
79
79
|
end
|
80
80
|
|
81
81
|
config = options.inject({}) do |config, (key, value)|
|
82
|
-
config[key] = value unless %w(config git path timeout).include?(key); config
|
82
|
+
config[key] = value unless %w(config git path timeout commit).include?(key); config
|
83
83
|
end.to_yaml
|
84
84
|
|
85
85
|
unless ::File.file?(options[:config])
|
data/lib/giteaucrat/version.rb
CHANGED