git-newline-at-eof 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/git-newline-at-eof +1 -1
- data/git-newline-at-eof.gemspec +1 -1
- data/lib/git-newline-at-eof.rb +11 -0
- data/lib/git-newline-at-eof/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd5dd7c517be2933e1143a21879be905a6ad65b7
|
4
|
+
data.tar.gz: a76a8975224580b3c2ebd781314319e33dc4e210
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0d316358ffb6199da8e0d1304476494bb2b0a1e5490b663ae66fa8327102305b0242f2af91b9a09b47b4eddfd7296379d06946679b8f4763b95806fc0b51efd
|
7
|
+
data.tar.gz: 5973ba66b1a17fb4faf87478b5b066cb0525f6e0cca9cbd87f6c646794cc5ef4ce3a78afb495b7a1776ab7548814f71060eea4995933fc676518a8d88e003103
|
data/exe/git-newline-at-eof
CHANGED
data/git-newline-at-eof.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ['aycabta@gmail.com']
|
11
11
|
|
12
12
|
spec.summary = %q{Check and fix newline at end of file in Git respository.}
|
13
|
-
spec.description = %
|
13
|
+
spec.description = %Q{Check and fix newline at end of file in Git respository.\n}
|
14
14
|
spec.homepage = 'https://github.com/aycabta/git-newline-at-eof'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
data/lib/git-newline-at-eof.rb
CHANGED
@@ -80,11 +80,13 @@ module GitNewlineAtEof
|
|
80
80
|
def run
|
81
81
|
unless @options[:opted]
|
82
82
|
puts @opt.help
|
83
|
+
0
|
83
84
|
end
|
84
85
|
if @options[:check_all]
|
85
86
|
check_all
|
86
87
|
elsif @options[:treat_all]
|
87
88
|
treat_all
|
89
|
+
0
|
88
90
|
else
|
89
91
|
if @options[:feed_last_line]
|
90
92
|
feed_last_line_all
|
@@ -92,18 +94,27 @@ module GitNewlineAtEof
|
|
92
94
|
if @options[:discard_last_newline]
|
93
95
|
discard_last_newline_all
|
94
96
|
end
|
97
|
+
0
|
95
98
|
end
|
96
99
|
end
|
97
100
|
|
98
101
|
def check_all
|
102
|
+
exist_warning = false
|
99
103
|
@files.each do |f|
|
100
104
|
if no_newline?(f[:last_newlines_num])
|
105
|
+
exist_warning = true
|
101
106
|
puts "#{f[:filename]}: no newline at end of file"
|
102
107
|
elsif discarded_newline?(f[:last_newlines_num])
|
108
|
+
exist_warning = true
|
103
109
|
discarded_num = f[:last_newlines_num] - 1
|
104
110
|
puts "#{f[:filename]}: discarded #{discarded_num} newline#{discarded_num > 1 ? 's' : ''} at end of file"
|
105
111
|
end
|
106
112
|
end
|
113
|
+
if exist_warning
|
114
|
+
1
|
115
|
+
else
|
116
|
+
0
|
117
|
+
end
|
107
118
|
end
|
108
119
|
|
109
120
|
def treat_all
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-newline-at-eof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Ass
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,9 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description: Check and fix newline at end of file in Git respository.
|
55
|
+
description: 'Check and fix newline at end of file in Git respository.
|
56
|
+
|
57
|
+
'
|
56
58
|
email:
|
57
59
|
- aycabta@gmail.com
|
58
60
|
executables:
|
@@ -93,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
95
|
version: '0'
|
94
96
|
requirements: []
|
95
97
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.5.2
|
97
99
|
signing_key:
|
98
100
|
specification_version: 4
|
99
101
|
summary: Check and fix newline at end of file in Git respository.
|