bashcov 3.1.2 → 3.2.0

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.
data/lib/bashcov.rb CHANGED
@@ -3,7 +3,6 @@
3
3
  require "optparse"
4
4
  require "pathname"
5
5
 
6
- require "bashcov/runner"
7
6
  require "bashcov/version"
8
7
 
9
8
  # Bashcov default module
@@ -69,17 +68,20 @@ module Bashcov
69
68
  end
70
69
 
71
70
  def bash_path
72
- # First attempt to use the value from `options`, but ignore all exceptions.
73
- # This is used early for the `BASH_VERSION` definition, so first use will likely error.
71
+ # first attempt to use the value from `options`, but ignore all exceptions
72
+ # this is used early for the `BASH_VERSION` definition, so first use will likely error
74
73
  begin
75
74
  return @options.bash_path if @options.bash_path
76
75
  rescue NoMethodError; end # rubocop:disable Lint/SuppressedException
77
76
 
78
- # Support the same `BASHCOV_BASH_PATH` environment variable used in the spec tests.
77
+ # support the same `BASHCOV_BASH_PATH` environment variable used in the spec tests
79
78
  return ENV.fetch("BASHCOV_BASH_PATH", nil) unless ENV.fetch("BASHCOV_BASH_PATH", "").empty?
80
79
 
81
- # Fall back to standard Bash location.
82
- "/bin/bash"
80
+ # fall back to standard Bash location, if available
81
+ return "/bin/bash" if File.executable?("/bin/bash")
82
+
83
+ # otherwise, try to execute a Bash from `PATH`
84
+ "bash"
83
85
  end
84
86
 
85
87
  def bash_version
@@ -109,7 +111,7 @@ module Bashcov
109
111
  private
110
112
 
111
113
  def help
112
- <<-HELP.gsub(/^ +/, "").gsub("\t", " " * 4)
114
+ <<~HELP.gsub("\t", " " * 4)
113
115
  Usage: #{program_name} [options] [--] <command> [options]
114
116
  Examples:
115
117
  \t#{program_name} ./script.sh
@@ -138,8 +140,9 @@ module Bashcov
138
140
 
139
141
  options.bash_path = p
140
142
 
141
- # Redefine `BASH_VERSION` constant with upated `bash_path`.
142
- # This is hacky, but a lot of code references that constant and this should only have to be done once.
143
+ # redefine `BASH_VERSION` constant with updated `bash_path`, this is
144
+ # hacky, but a lot of code references that constant and this should
145
+ # only have to be done once
143
146
  send(:remove_const, "BASH_VERSION")
144
147
  const_set("BASH_VERSION", bash_version.freeze)
145
148
  end
data/shell.nix ADDED
@@ -0,0 +1 @@
1
+ (import ./compat.nix).shellNix
data/test.sh CHANGED
@@ -1,4 +1,4 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env bash
2
2
 
3
3
  set -euo pipefail
4
4
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cédric Félizard
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-03-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: simplecov
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 0.22.0
18
+ version: '0.21'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 0.22.0
25
+ version: '0.21'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: aruba
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +65,20 @@ dependencies:
66
65
  - - ">="
67
66
  - !ruby/object:Gem::Version
68
67
  version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: ffi
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: 1.16.0
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 1.16.0
69
82
  - !ruby/object:Gem::Dependency
70
83
  name: rake
71
84
  requirement: !ruby/object:Gem::Requirement
@@ -165,13 +178,21 @@ files:
165
178
  - CHANGELOG.md
166
179
  - CONTRIBUTING.md
167
180
  - Gemfile
181
+ - Gemfile.nix.lock
168
182
  - Guardfile
183
+ - HACKING.md
184
+ - INSTALL.md
169
185
  - LICENSE.txt
170
186
  - README.md
171
187
  - Rakefile
172
188
  - TESTING.md
173
189
  - USAGE.md
174
190
  - bin/bashcov
191
+ - compat.nix
192
+ - default.nix
193
+ - flake.lock
194
+ - flake.nix
195
+ - gemset.nix
175
196
  - lib/bashcov.rb
176
197
  - lib/bashcov/detective.rb
177
198
  - lib/bashcov/errors.rb
@@ -181,6 +202,7 @@ files:
181
202
  - lib/bashcov/runner.rb
182
203
  - lib/bashcov/version.rb
183
204
  - lib/bashcov/xtrace.rb
205
+ - shell.nix
184
206
  - test.sh
185
207
  homepage: https://github.com/infertux/bashcov
186
208
  licenses:
@@ -190,7 +212,6 @@ metadata:
190
212
  source_code_uri: https://github.com/infertux/bashcov
191
213
  changelog_uri: https://github.com/infertux/bashcov/blob/master/CHANGELOG.md
192
214
  rubygems_mfa_required: 'true'
193
- post_install_message:
194
215
  rdoc_options: []
195
216
  require_paths:
196
217
  - lib
@@ -205,8 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
226
  - !ruby/object:Gem::Version
206
227
  version: '0'
207
228
  requirements: []
208
- rubygems_version: 3.5.6
209
- signing_key:
229
+ rubygems_version: 3.6.7
210
230
  specification_version: 4
211
231
  summary: Code coverage tool for Bash
212
232
  test_files: []