spoom 1.7.10 → 1.7.11
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/README.md +1 -1
- data/lib/spoom/context/exec.rb +14 -2
- data/lib/spoom/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcd8a922c433ab7b03fd7d6a419205e983467d5437eed8a078e57835f2168eec
|
|
4
|
+
data.tar.gz: 2a74d166079aa6c1f7a2f95dca5de050f6d40b4a49eb43e2eaa7059df1275e7a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b735c17851bebe3875bc1023e799060146de1965b5d3dca786e2868b68d5d27ff0e0e13324c2c6762581eb176d036b078d7168378e0f7b1637e69084e5e9a2ab
|
|
7
|
+
data.tar.gz: 9e4730cd210bdef36bed6f610e7b56815fd7d6cad3bf791c8b628f2c5db08e29111e9e7d6a414af8af3612d739d8431ea7461b1205fff6d339f05b4116cc3560
|
data/README.md
CHANGED
|
@@ -375,7 +375,7 @@ $ spoom deadcode remove path/to/file.rb:42:18-47:23
|
|
|
375
375
|
|
|
376
376
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Don't forget to run `bin/sanity` before pushing your changes.
|
|
377
377
|
|
|
378
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
378
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
379
379
|
|
|
380
380
|
## Contributing
|
|
381
381
|
|
data/lib/spoom/context/exec.rb
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# typed: strict
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
+
require "shellwords"
|
|
5
|
+
|
|
4
6
|
module Spoom
|
|
5
7
|
class ExecResult < T::Struct
|
|
6
8
|
const :out, String
|
|
@@ -30,11 +32,21 @@ module Spoom
|
|
|
30
32
|
Bundler.with_unbundled_env do
|
|
31
33
|
opts = { chdir: absolute_path } #: Hash[Symbol, untyped]
|
|
32
34
|
|
|
35
|
+
# When Ruby is wrapped in another dev environment (e.g. Nix), that environment might set
|
|
36
|
+
# env variables that cause Sorbet (or other tools) to link to incorrect versions of
|
|
37
|
+
# dependencies.
|
|
38
|
+
#
|
|
39
|
+
# In the case of Sorbet, this can lead to corrupted JSON output.
|
|
40
|
+
#
|
|
41
|
+
# Executing the command directly through the shell bypasses any Ruby wrappers and
|
|
42
|
+
# ensures that we are using the versions of tools that are default on the system.
|
|
43
|
+
command_with_shell = "/bin/sh -c #{command.shellescape}"
|
|
44
|
+
|
|
33
45
|
if capture_err
|
|
34
|
-
out, err, status = Open3.capture3(
|
|
46
|
+
out, err, status = Open3.capture3(command_with_shell, opts)
|
|
35
47
|
ExecResult.new(out: out, err: err, status: T.must(status.success?), exit_code: T.must(status.exitstatus))
|
|
36
48
|
else
|
|
37
|
-
out, status = Open3.capture2(
|
|
49
|
+
out, status = Open3.capture2(command_with_shell, opts)
|
|
38
50
|
ExecResult.new(out: out, err: nil, status: T.must(status.success?), exit_code: T.must(status.exitstatus))
|
|
39
51
|
end
|
|
40
52
|
end
|
data/lib/spoom/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spoom
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexandre Terrasa
|
|
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
275
275
|
- !ruby/object:Gem::Version
|
|
276
276
|
version: '0'
|
|
277
277
|
requirements: []
|
|
278
|
-
rubygems_version: 3.7
|
|
278
|
+
rubygems_version: 3.6.7
|
|
279
279
|
specification_version: 4
|
|
280
280
|
summary: Useful tools for Sorbet enthusiasts.
|
|
281
281
|
test_files: []
|