tmuxinator 3.4.1 → 3.4.2
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/lib/tmuxinator/tmux_version.rb +2 -0
- data/lib/tmuxinator/util.rb +3 -1
- data/lib/tmuxinator/version.rb +1 -1
- data/spec/lib/tmuxinator/config_spec.rb +2 -0
- data/spec/lib/tmuxinator/util_spec.rb +40 -0
- 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: 9a28fcd139a6a2ff19dbfb39a683879c281a3f50a69708eaae5fe7ea91f042ce
|
|
4
|
+
data.tar.gz: 1f9f45e49666e96cec5ec9e5b979cf8dc70d957d5a668575077f93d470fa860f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f171e361de524406ab8fa8ae72576845db194cb0db71a6f97e9432f84245d831357e96e4ae575009a890a447ce371045fe34fe76b9524dae7e01bb84dd196e58
|
|
7
|
+
data.tar.gz: 681c3b88e2a9b2a82126fdace5e82dd8c8eaea17f56fe0f53b4625798039bc714e5ef86eee71c9021432187f635b48f2862e34a3a4cce4dec4566c98fc58fcb8
|
data/lib/tmuxinator/util.rb
CHANGED
data/lib/tmuxinator/version.rb
CHANGED
|
@@ -4,4 +4,44 @@ require "spec_helper"
|
|
|
4
4
|
|
|
5
5
|
describe Tmuxinator::Util do
|
|
6
6
|
let(:util) { Object.new.extend(Tmuxinator::Util) }
|
|
7
|
+
|
|
8
|
+
describe "#current_session_name" do
|
|
9
|
+
def with_env(key, value)
|
|
10
|
+
had_key = ENV.key?(key)
|
|
11
|
+
original = ENV[key]
|
|
12
|
+
if value.nil?
|
|
13
|
+
ENV.delete(key)
|
|
14
|
+
else
|
|
15
|
+
ENV[key] = value
|
|
16
|
+
end
|
|
17
|
+
yield
|
|
18
|
+
ensure
|
|
19
|
+
if had_key
|
|
20
|
+
ENV[key] = original
|
|
21
|
+
else
|
|
22
|
+
ENV.delete(key)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
context "when TMUX is not set" do
|
|
27
|
+
it "returns an empty string without invoking the shell" do
|
|
28
|
+
with_env("TMUX", nil) do
|
|
29
|
+
expect(util).not_to receive(:`)
|
|
30
|
+
expect(util.current_session_name).to eq("")
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
context "when TMUX is set" do
|
|
36
|
+
it "returns the current tmux session name" do
|
|
37
|
+
with_env("TMUX", "/tmp/tmux-1000/default,1,0") do
|
|
38
|
+
expect(util).to receive(:`).
|
|
39
|
+
with('tmux display-message -p "#S"').
|
|
40
|
+
and_return("flash\n")
|
|
41
|
+
|
|
42
|
+
expect(util.current_session_name).to eq("flash")
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
7
47
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tmuxinator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.4.
|
|
4
|
+
version: 3.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Allen Bargi
|
|
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
250
250
|
- !ruby/object:Gem::Version
|
|
251
251
|
version: '2.7'
|
|
252
252
|
requirements: []
|
|
253
|
-
rubygems_version:
|
|
253
|
+
rubygems_version: 4.0.16
|
|
254
254
|
specification_version: 4
|
|
255
255
|
summary: Create and manage complex tmux sessions easily.
|
|
256
256
|
test_files:
|