bashcov 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/Guardfile +1 -1
- data/LICENSE.txt +1 -1
- data/bashcov.gemspec +8 -5
- data/lib/bashcov/lexer.rb +22 -5
- data/lib/bashcov/runner.rb +1 -1
- data/lib/bashcov/version.rb +1 -1
- data/lib/bashcov.rb +2 -2
- metadata +8 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe65b22751f9abd147d520a9c5a86b4d238c62c7
|
4
|
+
data.tar.gz: f4973b9bdccdac58cea260f8508c049245fe1e3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2d1fa149b244242bf16b69cd589682be79b8f02f60a3b70273dea1699ae778040c73c905a6fad3e41b718fe5a33690214894c798ac15c72ca231a3844830290
|
7
|
+
data.tar.gz: ab1f4721a06e67efb2147072dce2e328652eb3ef1f9e79be9e4aba3671792584406e9355c92f67a30d1a8f8873ffd1e3a468b469d6a158225ac3a55ab84e5d89
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.
|
1
|
+
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.5.0...master))
|
2
2
|
|
3
3
|
* TBD
|
4
4
|
|
5
|
+
## v1.5.0, 2017-02-08 ([changes](https://github.com/infertux/bashcov/compare/v1.4.1...v1.5.0))
|
6
|
+
|
7
|
+
* [BUGFIX] Fix incorrect coverage for some multiline strings (#23)
|
8
|
+
* [FEATURE] Add support for Ruby 2.4
|
9
|
+
|
5
10
|
## v1.4.1, 2016-10-11 ([changes](https://github.com/infertux/bashcov/compare/v1.4.0...v1.4.1))
|
6
11
|
|
7
12
|
* [BUGFIX] Fix incorrect coverage for some multiline strings (#22)
|
data/Guardfile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# More info at https://github.com/guard/guard#readme
|
4
4
|
|
5
|
-
guard "rspec", cli: "--tag ~
|
5
|
+
guard "rspec", cli: "--tag ~slow" do
|
6
6
|
watch(%r{^spec/.+_spec\.rb$})
|
7
7
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
8
8
|
watch(%r{^lib/(.+)/(.+)\.rb$}) { |m| "spec/#{m[1]}/#{m[2]}_spec.rb" }
|
data/LICENSE.txt
CHANGED
data/bashcov.gemspec
CHANGED
@@ -14,19 +14,22 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.homepage = "https://github.com/infertux/bashcov"
|
15
15
|
gem.license = "MIT"
|
16
16
|
|
17
|
-
gem.files = `git ls-files -z`.split("\x0").reject
|
17
|
+
gem.files = `git ls-files -z`.split("\x0").reject do |file|
|
18
|
+
file.start_with?(".") || file.match(%r{\A(test|spec|features)/})
|
19
|
+
end
|
20
|
+
|
18
21
|
gem.executables = gem.files.grep(%r{\Abin/}).map { |f| File.basename(f) }
|
19
22
|
gem.require_paths = ["lib"]
|
20
23
|
|
21
|
-
gem.required_ruby_version = ">= 2.2.
|
24
|
+
gem.required_ruby_version = ">= 2.2.6"
|
22
25
|
|
23
26
|
gem.add_dependency "simplecov", "~> 0.11"
|
24
27
|
|
25
28
|
gem.add_development_dependency "rake"
|
26
29
|
gem.add_development_dependency "rspec"
|
27
|
-
gem.add_development_dependency "
|
28
|
-
|
29
|
-
gem.add_development_dependency "
|
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"
|
30
33
|
gem.add_development_dependency "rubocop"
|
31
34
|
gem.add_development_dependency "yard"
|
32
35
|
gem.add_development_dependency "coveralls"
|
data/lib/bashcov/lexer.rb
CHANGED
@@ -33,9 +33,26 @@ module Bashcov
|
|
33
33
|
lines = File.read(@filename).lines
|
34
34
|
|
35
35
|
lines.each_with_index do |line, lineno|
|
36
|
-
|
37
|
-
mark_multiline(
|
38
|
-
|
36
|
+
# heredoc
|
37
|
+
mark_multiline(
|
38
|
+
lines, lineno,
|
39
|
+
/\A[^\n]+<<-?'?(\w+)'?\s*$.*\1/m
|
40
|
+
)
|
41
|
+
|
42
|
+
# multiline string concatenated with backslashes
|
43
|
+
mark_multiline(
|
44
|
+
lines, lineno,
|
45
|
+
/\A[^\n]+\\$(\s*['"][^'"]*['"]\s*\\$){1,}\s*['"][^'"]*['"]\s*$/
|
46
|
+
)
|
47
|
+
|
48
|
+
# multiline string concatenated with newlines
|
49
|
+
%w(' ").each do |char|
|
50
|
+
mark_multiline(
|
51
|
+
lines, lineno,
|
52
|
+
/\A[^\n]+\s+#{char}[^#{char}]*#{char}/m,
|
53
|
+
forward: false
|
54
|
+
)
|
55
|
+
end
|
39
56
|
|
40
57
|
mark_line(line, lineno)
|
41
58
|
end
|
@@ -54,7 +71,7 @@ module Bashcov
|
|
54
71
|
|
55
72
|
range.each do |sub_lineno|
|
56
73
|
# mark related lines with the same coverage as the reference line
|
57
|
-
@coverage[sub_lineno]
|
74
|
+
@coverage[sub_lineno] ||= @coverage[reference_lineno]
|
58
75
|
end
|
59
76
|
end
|
60
77
|
|
@@ -64,7 +81,7 @@ module Bashcov
|
|
64
81
|
@coverage[lineno] = Bashcov::Line::UNCOVERED if relevant?(line)
|
65
82
|
end
|
66
83
|
|
67
|
-
def relevant?(line)
|
84
|
+
def relevant?(line) # rubocop:disable Metrics/CyclomaticComplexity
|
68
85
|
line.sub!(/ #.*\Z/, "") # remove comments
|
69
86
|
line.strip!
|
70
87
|
|
data/lib/bashcov/runner.rb
CHANGED
@@ -16,7 +16,7 @@ module Bashcov
|
|
16
16
|
# Runs the command with appropriate xtrace settings.
|
17
17
|
# @note Binds Bashcov +stdin+ to the program being executed.
|
18
18
|
# @return [Process::Status] Status of the executed command
|
19
|
-
def run
|
19
|
+
def run # rubocop:disable Metrics/MethodLength
|
20
20
|
# Clear out previous run
|
21
21
|
@result = nil
|
22
22
|
|
data/lib/bashcov/version.rb
CHANGED
data/lib/bashcov.rb
CHANGED
@@ -85,8 +85,8 @@ module Bashcov
|
|
85
85
|
HELP
|
86
86
|
end
|
87
87
|
|
88
|
-
def option_parser
|
89
|
-
OptionParser.new do |opts|
|
88
|
+
def option_parser # rubocop:disable Metrics/MethodLength
|
89
|
+
OptionParser.new do |opts| # rubocop:disable Metrics/BlockLength
|
90
90
|
opts.program_name = program_name
|
91
91
|
opts.version = Bashcov::VERSION
|
92
92
|
opts.banner = help
|
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.
|
4
|
+
version: 1.5.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:
|
11
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: mutant-rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,33 +67,19 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: regexp_parser
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.4.2
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: cane
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
82
|
+
version: 0.4.2
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: rubocop
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
174
160
|
requirements:
|
175
161
|
- - ">="
|
176
162
|
- !ruby/object:Gem::Version
|
177
|
-
version: 2.2.
|
163
|
+
version: 2.2.6
|
178
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
165
|
requirements:
|
180
166
|
- - ">="
|
@@ -182,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
168
|
version: '0'
|
183
169
|
requirements: []
|
184
170
|
rubyforge_project:
|
185
|
-
rubygems_version: 2.
|
171
|
+
rubygems_version: 2.6.8
|
186
172
|
signing_key:
|
187
173
|
specification_version: 4
|
188
174
|
summary: Code coverage tool for Bash
|