bashcov 3.0.3 → 3.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e093e8ccb4452695d43f5ffed178b51f7234288858e5a3534fb5aab92f6aba35
4
- data.tar.gz: 4f53989ea9d994c75df3ce5bf0b518902fa77f833995515123f85581ab57473f
3
+ metadata.gz: 990b9c0f5d06fd5c3723feec6685802a6f2eba9fc7b9f79b1b053b686698ef60
4
+ data.tar.gz: 165df7619caabdf60f8260dc77f8a50d07c73c74eb795d5ff5cee86bdc053214
5
5
  SHA512:
6
- metadata.gz: 73f0e0d86193102a73999020b4027253e3642ed935fb4b3a42c594b79fa86553c908e4bfb8c3b904197a6e52ff2a7925ffe5fbbf56c63c882ce35dae289fd611
7
- data.tar.gz: c82225c38c2287a914623cd732d0c5e612dfc2f864b028d340246727fbf03755bd26bfcd3f212a361a22fa369ca5f70e9a637b34bf67c7ba45b98cf71943a4ff
6
+ metadata.gz: bfa1c1f08b8980a1c967c550e786ae3cfc2074f80a6f6644c01a654eea3fea482dcf3a75f2a8ff04664e24379b0cbf0514ebb0cd5e40c7616106e9ae1e2d3e71
7
+ data.tar.gz: af2e936ba1684b5cc70f270b94f89c8020dcb9deb86605d71872f7316b6aeb30833ba5cc80aa9f6980a66fddc9a3cce75fcacc4cbab6ff2292ab598a8401d7f8
data/CHANGELOG.md CHANGED
@@ -1,7 +1,20 @@
1
- ## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v3.0.3...master))
1
+ ## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v3.1.1...master))
2
2
 
3
3
  * TBD
4
4
 
5
+ ## v3.1.1, 2023-09-28 ([changes](https://github.com/infertux/bashcov/compare/v3.1.0...v3.1.1))
6
+
7
+ * [BUGFIX] Make sure StringIO is loaded when `--mute` is used
8
+
9
+ ## v3.1.0, 2023-09-28 ([changes](https://github.com/infertux/bashcov/compare/v3.0.3...v3.1.0))
10
+
11
+ * [FEATURE] Better diagnostics for runner result specs
12
+ * [BUGFIX] Use `/usr/bin/env bash`
13
+ * [FEATURE] Initialize GitHub Actions workflow
14
+ * [MISC] Make `Detective#shellscript_syntax?` private
15
+ * [BUGFIX] Handle binary data
16
+ * [BUGFIX] Fix Rubocop violations
17
+
5
18
  ## v3.0.3, 2023-07-14 ([changes](https://github.com/infertux/bashcov/compare/v3.0.2...v3.0.3))
6
19
 
7
20
  * [BUGFIX] Improve shebang detection (#74)
data/bin/bashcov CHANGED
@@ -32,7 +32,11 @@ SimpleCov.at_exit do
32
32
  # XXX: suppress output from https://github.com/colszowka/simplecov-html/blob/9ec41504ab139fabfaddfc786dfdab5d6aca0bab/lib/simplecov-html.rb#L25
33
33
  # See https://github.com/infertux/bashcov/issues/53
34
34
  original_stdout = $stdout
35
- $stdout = StringIO.new if Bashcov.mute
35
+
36
+ if Bashcov.mute
37
+ require "stringio"
38
+ $stdout = StringIO.new
39
+ end
36
40
 
37
41
  result.format!
38
42
  ensure
@@ -58,13 +58,19 @@ module Bashcov
58
58
  def shellscript_shebang_line?(shebang)
59
59
  scanner = StringScanner.new(shebang)
60
60
 
61
- return false if scanner.scan(/#!\s*/).nil?
61
+ begin
62
+ return false if scanner.scan(/#!\s*/).nil?
62
63
 
63
- shell = scanner.scan(/\S+/)
64
+ shell = scanner.scan(/\S+/)
64
65
 
65
- return false if shell.nil?
66
+ return false if shell.nil?
66
67
 
67
- args = scanner.skip(/\s+/).nil? ? [] : scanner.rest.split(/\s+/)
68
+ args = scanner.skip(/\s+/).nil? ? [] : scanner.rest.split(/\s+/)
69
+ rescue ArgumentError
70
+ # Handle "invalid byte sequence in UTF-8" from `StringScanner`. Can
71
+ # happen when trying to read binary data (e.g. .pngs).
72
+ return false
73
+ end
68
74
 
69
75
  shell_basename = File.basename(shell)
70
76
 
@@ -80,6 +86,8 @@ module Bashcov
80
86
  SHELLSCRIPT_EXTENSIONS.include? File.extname(filename)
81
87
  end
82
88
 
89
+ private
90
+
83
91
  # @param [String,Pathname] filename the name of the file to be checked
84
92
  # @return [Boolean] whether +filename+'s text matches valid shell syntax
85
93
  # @note assumes that +filename+ is readable and refers to a regular file
@@ -3,5 +3,5 @@
3
3
  # :nodoc:
4
4
  module Bashcov
5
5
  # Current Bashcov version
6
- VERSION = "3.0.3"
6
+ VERSION = "3.1.1"
7
7
  end
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: 3.0.3
4
+ version: 3.1.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: 2023-07-14 00:00:00.000000000 Z
11
+ date: 2023-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  requirements: []
208
- rubygems_version: 3.4.10
208
+ rubygems_version: 3.4.20
209
209
  signing_key:
210
210
  specification_version: 4
211
211
  summary: Code coverage tool for Bash