bashcov 1.5.1 → 1.6.0

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: 5468df56b61ce80a148c536754f93226d5f3b43e
4
- data.tar.gz: 0323752d3a8bfe115de70974bbbec4aac3ba340c
3
+ metadata.gz: 69ae560709ca922d5768a2755b4c9f9fa0de60d9
4
+ data.tar.gz: c0ccca240348b0736dca3357af5412c98159466a
5
5
  SHA512:
6
- metadata.gz: 8cfff2a41c1f5011576f6085c335f9d026c8b97bb117acbefdcbc091e588fa2f054caf126f82b6f703e3183db49bc071a1d5bcad2ed7541191374654e088b2cd
7
- data.tar.gz: 6f939565eb8a772d1b111a7b57df659de664ee0ceacbc6afcb4cb97f823cc460e86bbed511f15b1202e30242b6ada20ecda549a53b52de828d15937b98bc7d1f
6
+ metadata.gz: 7032cb66094fa7f79ae7916eb93dc58e814d5e46cac8fce6a0006ec8370c9f18a8aba2de2a9f642e5c984e3a992e28e98cd59664a8d5828afa45bf33c5f6f5bf
7
+ data.tar.gz: 2ed6423accb917c077797224efe9644668349be5adb05ccd32b37413b8904bc1a560b566c871cde50331017bcd557ffdb6e75309822bd0cd58481ae0a6666f91
data/CHANGELOG.md CHANGED
@@ -1,7 +1,12 @@
1
- ## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.5.1...master))
1
+ ## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.6.0...master))
2
2
 
3
3
  * TBD
4
4
 
5
+ ## v1.6.0, 2017-10-24 ([changes](https://github.com/infertux/bashcov/compare/v1.5.1...v1.6.0))
6
+
7
+ * [BUGFIX] Don't crash when files contain invalid UTF-8 characters (#27)
8
+ * [FEATURE] Upgrade SimpleCov dependency to 0.15
9
+
5
10
  ## v1.5.1, 2017-03-10 ([changes](https://github.com/infertux/bashcov/compare/v1.5.0...v1.5.1))
6
11
 
7
12
  * [BUGFIX] Fix incorrect coverage for some multiline strings (#26)
data/Rakefile CHANGED
@@ -10,4 +10,4 @@ end
10
10
  require "rubocop/rake_task"
11
11
  RuboCop::RakeTask.new
12
12
 
13
- task default: [:rubocop, :spec]
13
+ task default: %i[rubocop spec]
data/bashcov.gemspec CHANGED
@@ -21,16 +21,14 @@ Gem::Specification.new do |gem|
21
21
  gem.executables = gem.files.grep(%r{\Abin/}).map { |f| File.basename(f) }
22
22
  gem.require_paths = ["lib"]
23
23
 
24
- gem.required_ruby_version = ">= 2.2.6"
24
+ gem.required_ruby_version = ">= 2.2.7"
25
25
 
26
- gem.add_dependency "simplecov", "~> 0.11"
26
+ gem.add_dependency "simplecov", "~> 0.15"
27
27
 
28
+ gem.add_development_dependency "coveralls"
29
+ gem.add_development_dependency "mutant-rspec"
28
30
  gem.add_development_dependency "rake"
29
31
  gem.add_development_dependency "rspec"
30
- gem.add_development_dependency "mutant-rspec"
31
- # TODO: forcing version for Ruby 2.4 compat, remove when mutant Gem is fixed
32
- gem.add_development_dependency "regexp_parser", ">= 0.4.2"
33
32
  gem.add_development_dependency "rubocop"
34
33
  gem.add_development_dependency "yard"
35
- gem.add_development_dependency "coveralls"
36
34
  end
data/lib/bashcov.rb CHANGED
@@ -14,7 +14,7 @@ module Bashcov
14
14
 
15
15
  # A +Struct+ to store Bashcov configuration
16
16
  Options = Struct.new(
17
- *%i(skip_uncovered mute bash_path root_directory command)
17
+ *%i[skip_uncovered mute bash_path root_directory command]
18
18
  )
19
19
 
20
20
  class << self
@@ -19,7 +19,7 @@ module Bashcov
19
19
  return enum_for(__method__, delimiter) unless block_given?
20
20
 
21
21
  read.each_line(delimiter) do |line|
22
- yield line.chomp(delimiter)
22
+ yield line.chomp(delimiter).encode("utf-8", invalid: :replace)
23
23
  end
24
24
  end
25
25
 
data/lib/bashcov/lexer.rb CHANGED
@@ -7,13 +7,13 @@ module Bashcov
7
7
  # coverage
8
8
  class Lexer
9
9
  # Lines starting with one of these tokens are irrelevant for coverage
10
- IGNORE_START_WITH = %w(# function).freeze
10
+ IGNORE_START_WITH = %w[# function].freeze
11
11
 
12
12
  # Lines ending with one of these tokens are irrelevant for coverage
13
- IGNORE_END_WITH = %w|(|.freeze
13
+ IGNORE_END_WITH = %w[(].freeze
14
14
 
15
15
  # Lines containing only one of these keywords are irrelevant for coverage
16
- IGNORE_IS = %w(esac if then else elif fi while do done { } ;;).freeze
16
+ IGNORE_IS = %w[esac if then else elif fi while do done { } ;;].freeze
17
17
 
18
18
  # @param [String] filename File to analyze
19
19
  # @param [Hash] coverage Coverage with executed lines marked
@@ -30,7 +30,7 @@ module Bashcov
30
30
  # Process and complete initial coverage.
31
31
  # @return [void]
32
32
  def complete_coverage
33
- lines = File.read(@filename).lines
33
+ lines = IO.read(@filename).encode("utf-8", invalid: :replace).lines
34
34
 
35
35
  lines.each_with_index do |line, lineno|
36
36
  # heredoc
@@ -46,7 +46,7 @@ module Bashcov
46
46
  )
47
47
 
48
48
  # multiline string concatenated with newlines
49
- %w(' ").each do |char|
49
+ %w[' "].each do |char|
50
50
  mark_multiline(
51
51
  lines, lineno,
52
52
  /\A[^\n]+[\s=]+#{char}[^#{char}]*#{char}/m,
@@ -3,5 +3,5 @@
3
3
  # :nodoc:
4
4
  module Bashcov
5
5
  # Current Bashcov version
6
- VERSION = "1.5.1".freeze
6
+ VERSION = "1.6.0".freeze
7
7
  end
@@ -19,7 +19,7 @@ module Bashcov
19
19
 
20
20
  # [Array<String>] A collection of Bash internal variables to expand in the
21
21
  # {PS4}
22
- FIELDS = %w(${LINENO-} ${BASH_SOURCE-} ${PWD-} ${OLDPWD-}).freeze
22
+ FIELDS = %w[${LINENO-} ${BASH_SOURCE-} ${PWD-} ${OLDPWD-}].freeze
23
23
 
24
24
  class << self
25
25
  attr_writer :delimiter, :ps4
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cédric Félizard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-10 00:00:00.000000000 Z
11
+ date: 2017-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -16,16 +16,16 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.11'
19
+ version: '0.15'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.11'
26
+ version: '0.15'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: coveralls
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: mutant-rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: mutant-rspec
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,21 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: regexp_parser
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: 0.4.2
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 0.4.2
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop
70
+ name: rspec
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - ">="
@@ -95,7 +81,7 @@ dependencies:
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
- name: yard
84
+ name: rubocop
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - ">="
@@ -109,7 +95,7 @@ dependencies:
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
97
  - !ruby/object:Gem::Dependency
112
- name: coveralls
98
+ name: yard
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - ">="
@@ -160,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
146
  requirements:
161
147
  - - ">="
162
148
  - !ruby/object:Gem::Version
163
- version: 2.2.6
149
+ version: 2.2.7
164
150
  required_rubygems_version: !ruby/object:Gem::Requirement
165
151
  requirements:
166
152
  - - ">="
@@ -168,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
154
  version: '0'
169
155
  requirements: []
170
156
  rubyforge_project:
171
- rubygems_version: 2.6.8
157
+ rubygems_version: 2.6.13
172
158
  signing_key:
173
159
  specification_version: 4
174
160
  summary: Code coverage tool for Bash