bashcov 1.4.0 → 1.4.1
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 +4 -4
- data/CHANGELOG.md +8 -4
- data/lib/bashcov/lexer.rb +10 -5
- data/lib/bashcov/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 846ded19c1d2718bb704f9d34c0485a54d5c351f
|
4
|
+
data.tar.gz: 7d7df456bc41ca13253315e104d233879483b9da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85f015eb2308cfe698de95a59ce6f4decc37f81ba78a4de40fc617d7c0f156d9074f6072fd0b5cf8dac327c90f3660aa0c9cedc4a1475753211fe853d23e8a55
|
7
|
+
data.tar.gz: 9bded014137b9d94f5583b4921a77b22530c7f65a8e492b2fe0c8f922c265e2d4aac5c2bbbbe2ba03b92628b097558f65914fb2cf5a6177fde2fbe9d78122cca
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.4.
|
1
|
+
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.4.1...master))
|
2
2
|
|
3
3
|
* TBD
|
4
4
|
|
5
|
+
## v1.4.1, 2016-10-11 ([changes](https://github.com/infertux/bashcov/compare/v1.4.0...v1.4.1))
|
6
|
+
|
7
|
+
* [BUGFIX] Fix incorrect coverage for some multiline strings (#22)
|
8
|
+
|
5
9
|
## v1.4.0, 2016-10-08 ([changes](https://github.com/infertux/bashcov/compare/v1.3.1...v1.4.0))
|
6
10
|
|
7
11
|
* [BUGFIX] Fix incorrect coverage for case statements (#21)
|
@@ -30,7 +34,7 @@
|
|
30
34
|
|
31
35
|
## v1.2.1, 2015-05-05 ([changes](https://github.com/infertux/bashcov/compare/v1.2.0...v1.2.1))
|
32
36
|
|
33
|
-
* [BUGFIX]
|
37
|
+
* [BUGFIX] Preserve original exit status when exiting Bashcov
|
34
38
|
|
35
39
|
## v1.2.0, 2015-05-04 ([changes](https://github.com/infertux/bashcov/compare/v1.1.0...v1.2.0))
|
36
40
|
|
@@ -44,8 +48,8 @@
|
|
44
48
|
|
45
49
|
## v1.0.1, 2013-03-21 ([changes](https://github.com/infertux/bashcov/compare/v1.0.0...v1.0.1))
|
46
50
|
|
47
|
-
* [BUGFIX]
|
48
|
-
* [BUGFIX]
|
51
|
+
* [BUGFIX] Allow to add SimpleCov filters
|
52
|
+
* [BUGFIX] Lines containing only `elif` should be ignored
|
49
53
|
|
50
54
|
## v1.0.0, 2013-03-16 ([changes](https://github.com/infertux/bashcov/compare/v0.0.9...v1.0.0))
|
51
55
|
|
data/lib/bashcov/lexer.rb
CHANGED
@@ -34,7 +34,8 @@ module Bashcov
|
|
34
34
|
|
35
35
|
lines.each_with_index do |line, lineno|
|
36
36
|
mark_multiline(lines, lineno, /\A[^\n]+<<-?'?(\w+)'?\s*$.*\1/m) # heredoc
|
37
|
-
mark_multiline(lines, lineno, /\A[^\n]+\\$(\s*['"][^'"]*['"]\s*\\$){1,}\s*['"][^'"]*['"]\s*$/) # multiline string
|
37
|
+
mark_multiline(lines, lineno, /\A[^\n]+\\$(\s*['"][^'"]*['"]\s*\\$){1,}\s*['"][^'"]*['"]\s*$/) # multiline string concatenated with backslashes
|
38
|
+
mark_multiline(lines, lineno, /\A[^\n]+\s+(['"])[^'"]*\1/m, forward: false) # multiline string concatenated with newlines
|
38
39
|
|
39
40
|
mark_line(line, lineno)
|
40
41
|
end
|
@@ -42,14 +43,18 @@ module Bashcov
|
|
42
43
|
|
43
44
|
private
|
44
45
|
|
45
|
-
def mark_multiline(lines, lineno, regexp)
|
46
|
+
def mark_multiline(lines, lineno, regexp, forward: true)
|
46
47
|
seek_forward = lines[lineno..-1].join
|
47
48
|
return unless (multiline_match = seek_forward.match(regexp))
|
48
49
|
|
49
50
|
length = multiline_match.to_s.count($/)
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
first, last = lineno + 1, lineno + length
|
52
|
+
range = (forward ? first.upto(last) : (last - 1).downto(first - 1))
|
53
|
+
reference_lineno = (forward ? first - 1 : last)
|
54
|
+
|
55
|
+
range.each do |sub_lineno|
|
56
|
+
# mark related lines with the same coverage as the reference line
|
57
|
+
@coverage[sub_lineno] = @coverage[reference_lineno]
|
53
58
|
end
|
54
59
|
end
|
55
60
|
|
data/lib/bashcov/version.rb
CHANGED
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.
|
4
|
+
version: 1.4.1
|
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: 2016-10-
|
11
|
+
date: 2016-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|