git-newline-at-eof 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 52dbec81b82c6356e2c62eaa606a85246c76cc7f
4
- data.tar.gz: bcadbad61f03381f7733f3292fd1836b11ee0688
3
+ metadata.gz: dd5dd7c517be2933e1143a21879be905a6ad65b7
4
+ data.tar.gz: a76a8975224580b3c2ebd781314319e33dc4e210
5
5
  SHA512:
6
- metadata.gz: 12563f3d33eef269da7a5bd6beae3b488b43054c0f180195f2ea6ed14fbb8a55db85f842fb6743f1d0f76ddeb77e3d0d792dbd6b050b5ba6b48f65aeb96165a9
7
- data.tar.gz: 28bc68fa388e4218add3496e2815292b3667ebea6998e00ef57786f5bb21921ddde76decdff33d2ed65bcfb4bb84819eb91433bb813854eff38e08885b0e8b13
6
+ metadata.gz: c0d316358ffb6199da8e0d1304476494bb2b0a1e5490b663ae66fa8327102305b0242f2af91b9a09b47b4eddfd7296379d06946679b8f4763b95806fc0b51efd
7
+ data.tar.gz: 5973ba66b1a17fb4faf87478b5b066cb0525f6e0cca9cbd87f6c646794cc5ef4ce3a78afb495b7a1776ab7548814f71060eea4995933fc676518a8d88e003103
@@ -4,4 +4,4 @@ $: << File.expand_path('../../lib/', __FILE__)
4
4
 
5
5
  require 'git-newline-at-eof'
6
6
 
7
- GitNewlineAtEof::Application.new(ARGV).run
7
+ exit(GitNewlineAtEof::Application.new(ARGV).run)
@@ -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 = %q{Check and fix newline at end of file in Git respository.}
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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module GitNewlineAtEof
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
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.3
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-17 00:00:00.000000000 Z
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.6.8
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.