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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82dc04cf069a738410f097150bff4d94af38dc6f7eefca31c368596eaf138da0
4
- data.tar.gz: ea4046ff175a5c05eb85dc8cc22b6cb88f294d63b378b88a790f6bd4d92bfaff
3
+ metadata.gz: dcd8a922c433ab7b03fd7d6a419205e983467d5437eed8a078e57835f2168eec
4
+ data.tar.gz: 2a74d166079aa6c1f7a2f95dca5de050f6d40b4a49eb43e2eaa7059df1275e7a
5
5
  SHA512:
6
- metadata.gz: a6c72f54e3398d0d599b92d5c266bdea3db2ee78b10151bf9a5644f2679d0778ecef4cfce105bb8dd284947e6c737ff194599c2e72ab7894dd0122466034c553
7
- data.tar.gz: ed0df1194a93939bbb4117efbc3218d9f18d079cd2dd6b704579ba8e4c78f6f5f8a58b02072dc99bd19870eeaed0bc449ee70ea5c965e152685239b801d97c99
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`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
378
+ To install this gem onto your local machine, run `bundle exec rake install`.
379
379
 
380
380
  ## Contributing
381
381
 
@@ -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(command, opts)
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(command, opts)
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
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Spoom
5
- VERSION = "1.7.10"
5
+ VERSION = "1.7.11"
6
6
  end
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.10
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.2
278
+ rubygems_version: 3.6.7
279
279
  specification_version: 4
280
280
  summary: Useful tools for Sorbet enthusiasts.
281
281
  test_files: []