terrapin 1.1.0 → 1.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: 066c74dc23f8fa6c2327eb3fec6f31b8169bc240164716937b96acd3796e7df6
4
- data.tar.gz: 25bf6daf469817cb75d15c17b83880faaeb0289f054a876f53a411532c4026f2
3
+ metadata.gz: de8290a9a7c02f78729afc093bc4f91ded448cde41dfa85d3d7c57ce0acb1aa8
4
+ data.tar.gz: ebdcaed25d509d37f0652f3a3a8ed4f195d574a2ccf2e7ac57e541da4585b243
5
5
  SHA512:
6
- metadata.gz: 7c5324dc84dbff0c5487cc74bc94053f4551038586a7a36b8b4cfcb87f1947a318b271ec83e23f3396d2f038ea30243b35fcd5211c79172c2d90c708855e8439
7
- data.tar.gz: 9236fe888b471278554bbbba8e89bfd26ae943e87698b8e647247bd153a6ab6195a38ff52b6407d1859e7c02fd050166b42deb9dd308ff50ef65fb4df70bd5d1
6
+ metadata.gz: 8abf06d0433f3955d508291e81e44d5a9300a4bbddbb804ee40e959152a2bea72eaf0454a673fc427aba84aa5a747e90afacb0efa7ccf64aa159adec8e87647e
7
+ data.tar.gz: d4b1e42addf7855b8b38656aa7ad36f149041e2a1b8595fcad71fc5624178e6fde1b9472dd618a95a4766ebe781f0e44ba00f572ad72423216379dd2e83304a1
data/NEWS.md CHANGED
@@ -1,3 +1,8 @@
1
+ New for 1.1.1:
2
+
3
+ * Fix specs flaking due to leaky path and runner
4
+ * Use String.new to create a mutable string
5
+
1
6
  New for 1.1.0:
2
7
 
3
8
  * Remove Travis CI configuration
data/README.md CHANGED
@@ -229,5 +229,4 @@ We are [available for hire][hire].
229
229
  [community]: https://thoughtbot.com/community?utm_source=github
230
230
  [hire]: https://thoughtbot.com/hire-us?utm_source=github
231
231
 
232
-
233
232
  <!-- END /templates/footer.md -->
@@ -47,8 +47,8 @@ module Terrapin
47
47
  end
48
48
 
49
49
  def read_streams(output, error)
50
- @stdout_output = ""
51
- @stderr_output = ""
50
+ @stdout_output = String.new
51
+ @stderr_output = String.new
52
52
  read_fds = [output, error]
53
53
  while !read_fds.empty?
54
54
  to_read, = IO.select(read_fds)
@@ -1,4 +1,4 @@
1
1
  # coding: UTF-8
2
2
  module Terrapin
3
- VERSION = "1.1.0".freeze
3
+ VERSION = "1.1.1".freeze
4
4
  end
data/spec/spec_helper.rb CHANGED
@@ -14,6 +14,11 @@ Dir[File.dirname(__FILE__) + "/support/**.rb"].each{|support_file| require suppo
14
14
  RSpec.configure do |config|
15
15
  config.include WithExitstatus
16
16
  config.include StubOS
17
+
18
+ config.before(:example) do
19
+ Terrapin::CommandLine.path = nil
20
+ Terrapin::CommandLine.runner = nil
21
+ end
17
22
  end
18
23
 
19
24
  def best_logger
@@ -52,17 +52,6 @@ describe "When picking a Runner" do
52
52
  end
53
53
 
54
54
  describe 'When running an executable in the supplemental path' do
55
- before do
56
- path = Pathname.new(File.dirname(__FILE__)) + '..' + 'support'
57
- File.open(path + 'ls', 'w'){|f| f.puts "#!/bin/sh\necho overridden-ls\n" }
58
- FileUtils.chmod(0755, path + 'ls')
59
- Terrapin::CommandLine.path = path
60
- end
61
-
62
- after do
63
- FileUtils.rm_f("#{Terrapin::CommandLine.path}/ls")
64
- end
65
-
66
55
  [
67
56
  Terrapin::CommandLine::BackticksRunner,
68
57
  Terrapin::CommandLine::PopenRunner,
@@ -72,10 +61,19 @@ describe 'When running an executable in the supplemental path' do
72
61
  describe runner_class do
73
62
  describe '#run' do
74
63
  it 'finds the correct executable' do
64
+ path = Pathname.new(File.dirname(__FILE__)) + '..' + 'support'
65
+ File.open(path + 'ls', 'w'){|f| f.puts "#!/bin/sh\necho overridden-ls\n" }
66
+ FileUtils.chmod(0755, path + 'ls')
67
+ Terrapin::CommandLine.path = path
75
68
  Terrapin::CommandLine.runner = runner_class.new
76
69
  command = Terrapin::CommandLine.new('ls')
70
+
77
71
  result = command.run
72
+
78
73
  expect(result.strip).to eq('overridden-ls')
74
+
75
+ ensure
76
+ FileUtils.rm("#{Terrapin::CommandLine.path}/ls")
79
77
  end
80
78
  end
81
79
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terrapin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Yurek
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-24 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: climate_control
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  requirements: []
166
- rubygems_version: 3.6.2
166
+ rubygems_version: 3.6.7
167
167
  specification_version: 4
168
168
  summary: Run shell commands safely, even with user-supplied values
169
169
  test_files: []