tmuxinator 3.0.0 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tmuxinator/cli.rb +2 -2
- data/lib/tmuxinator/config.rb +2 -2
- data/lib/tmuxinator/tmux_version.rb +2 -0
- data/lib/tmuxinator/version.rb +1 -1
- data/spec/lib/tmuxinator/cli_spec.rb +1 -1
- data/spec/lib/tmuxinator/config_spec.rb +40 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f42642a664887ff2cca5808acf5b4f03783141a02473a71188f56c407d0cec19
|
4
|
+
data.tar.gz: 4acc35a53fb7ae4477e4169c25add826fd9e03322176270a4a1b595531311eda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f293c3d3281db562348a83734e4019871331a6377a685dc3e919e9c0c4da732254a39f284707cd1ab0a90ee34ee188583285b0bd9b94afc91c8ae2ded2d172ea
|
7
|
+
data.tar.gz: 66b6f4e0434f407407c49f97bc600722ef102a6179e1e1ded08103a698d4cb55b4e2afcf589e772f4d3a5d4b81b5b5aedc9c6087921ec9a72c4d7d7d3f8b2221
|
data/lib/tmuxinator/cli.rb
CHANGED
@@ -21,7 +21,7 @@ module Tmuxinator
|
|
21
21
|
for project reuse) or a path to a project config file (via the -p flag)
|
22
22
|
}.join(" "),
|
23
23
|
stop: "Stop a tmux session using a project's tmuxinator config",
|
24
|
-
local: "Start a tmux session using ./.tmuxinator.
|
24
|
+
local: "Start a tmux session using ./.tmuxinator.y[a]ml",
|
25
25
|
debug: "Output the shell commands that are generated by tmuxinator",
|
26
26
|
copy: %w{
|
27
27
|
Copy an existing project to a new project and
|
@@ -160,7 +160,7 @@ module Tmuxinator
|
|
160
160
|
|
161
161
|
def config_path(name, local = false)
|
162
162
|
if local
|
163
|
-
Tmuxinator::Config::
|
163
|
+
Tmuxinator::Config::LOCAL_DEFAULTS[0]
|
164
164
|
else
|
165
165
|
Tmuxinator::Config.default_project(name)
|
166
166
|
end
|
data/lib/tmuxinator/config.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Tmuxinator
|
2
2
|
class Config
|
3
|
-
|
3
|
+
LOCAL_DEFAULTS = ["./.tmuxinator.yml", "./.tmuxinator.yaml"].freeze
|
4
4
|
NO_LOCAL_FILE_MSG =
|
5
5
|
"Project file at ./.tmuxinator.yml doesn't exist.".freeze
|
6
6
|
NO_PROJECT_FOUND_MSG = "Project could not be found.".freeze
|
@@ -94,7 +94,7 @@ module Tmuxinator
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def local_project
|
97
|
-
|
97
|
+
LOCAL_DEFAULTS.detect { |f| File.exist?(f) }
|
98
98
|
end
|
99
99
|
|
100
100
|
def default_project(name)
|
data/lib/tmuxinator/version.rb
CHANGED
@@ -501,7 +501,7 @@ describe Tmuxinator::Cli do
|
|
501
501
|
end
|
502
502
|
|
503
503
|
context "file exists" do
|
504
|
-
let(:path) { Tmuxinator::Config::
|
504
|
+
let(:path) { Tmuxinator::Config::LOCAL_DEFAULTS[0] }
|
505
505
|
before do
|
506
506
|
expect(File).to receive(:exist?).with(path) { true }
|
507
507
|
end
|
@@ -213,12 +213,14 @@ describe Tmuxinator::Config do
|
|
213
213
|
|
214
214
|
describe "#default?" do
|
215
215
|
let(:directory) { described_class.directory }
|
216
|
-
let(:
|
216
|
+
let(:local_yml_default) { described_class::LOCAL_DEFAULTS[0] }
|
217
|
+
let(:local_yaml_default) { described_class::LOCAL_DEFAULTS[1] }
|
217
218
|
let(:proj_default) { described_class.default }
|
218
219
|
|
219
220
|
context "when the file exists" do
|
220
221
|
before do
|
221
|
-
allow(File).to receive(:exist?).with(
|
222
|
+
allow(File).to receive(:exist?).with(local_yml_default) { false }
|
223
|
+
allow(File).to receive(:exist?).with(local_yaml_default) { false }
|
222
224
|
allow(File).to receive(:exist?).with(proj_default) { true }
|
223
225
|
end
|
224
226
|
|
@@ -229,7 +231,8 @@ describe Tmuxinator::Config do
|
|
229
231
|
|
230
232
|
context "when the file doesn't exist" do
|
231
233
|
before do
|
232
|
-
allow(File).to receive(:exist?).with(
|
234
|
+
allow(File).to receive(:exist?).with(local_yml_default) { false }
|
235
|
+
allow(File).to receive(:exist?).with(local_yaml_default) { false }
|
233
236
|
allow(File).to receive(:exist?).with(proj_default) { false }
|
234
237
|
end
|
235
238
|
|
@@ -309,14 +312,14 @@ describe Tmuxinator::Config do
|
|
309
312
|
|
310
313
|
describe "#local?" do
|
311
314
|
it "checks if the given project exists" do
|
312
|
-
path = described_class::
|
315
|
+
path = described_class::LOCAL_DEFAULTS[0]
|
313
316
|
expect(File).to receive(:exist?).with(path) { true }
|
314
317
|
expect(described_class.local?).to be_truthy
|
315
318
|
end
|
316
319
|
end
|
317
320
|
|
318
321
|
describe "#local_project" do
|
319
|
-
let(:default) { described_class::
|
322
|
+
let(:default) { described_class::LOCAL_DEFAULTS[0] }
|
320
323
|
|
321
324
|
context "with a project yml" do
|
322
325
|
it "gets the project as path to the yml file" do
|
@@ -334,7 +337,7 @@ describe Tmuxinator::Config do
|
|
334
337
|
|
335
338
|
describe "#project" do
|
336
339
|
let(:directory) { described_class.directory }
|
337
|
-
let(:default) { described_class::
|
340
|
+
let(:default) { described_class::LOCAL_DEFAULTS[0] }
|
338
341
|
|
339
342
|
context "with an non-local project yml" do
|
340
343
|
before do
|
@@ -363,7 +366,8 @@ describe Tmuxinator::Config do
|
|
363
366
|
end
|
364
367
|
|
365
368
|
describe "#validate" do
|
366
|
-
let(:
|
369
|
+
let(:local_yml_default) { described_class::LOCAL_DEFAULTS[0] }
|
370
|
+
let(:local_yaml_default) { described_class::LOCAL_DEFAULTS[1] }
|
367
371
|
|
368
372
|
context "when a project config file is provided" do
|
369
373
|
it "should raise if the project config file can't be found" do
|
@@ -412,19 +416,42 @@ describe Tmuxinator::Config do
|
|
412
416
|
|
413
417
|
context "when no project name is provided" do
|
414
418
|
it "should raise if the local project file doesn't exist" do
|
415
|
-
expect(File).to receive(:exist?).with(
|
419
|
+
expect(File).to receive(:exist?).with(local_yml_default) { false }
|
420
|
+
expect(File).to receive(:exist?).with(local_yaml_default) { false }
|
416
421
|
expect do
|
417
422
|
described_class.validate
|
418
423
|
end.to raise_error RuntimeError, %r{Project.+doesn't.exist}
|
419
424
|
end
|
420
425
|
|
421
|
-
|
422
|
-
|
426
|
+
context "and tmuxinator.yml exists" do
|
427
|
+
it "should load and validate the local project" do
|
428
|
+
content = File.read(File.join(fixtures_dir, "sample.yml"))
|
423
429
|
|
424
|
-
|
425
|
-
|
430
|
+
expect(File).to receive(:exist?).
|
431
|
+
with(local_yml_default).
|
432
|
+
at_least(:once) { true }
|
433
|
+
expect(File).to receive(:read).
|
434
|
+
with(local_yml_default).
|
435
|
+
and_return(content)
|
436
|
+
expect(described_class.validate).to be_a Tmuxinator::Project
|
437
|
+
end
|
438
|
+
end
|
426
439
|
|
427
|
-
|
440
|
+
context "and tmuxinator.yaml exists" do
|
441
|
+
it "should load and validate the local project" do
|
442
|
+
content = File.read(File.join(fixtures_dir, "sample.yml"))
|
443
|
+
|
444
|
+
expect(File).to receive(:exist?).
|
445
|
+
with(local_yml_default).
|
446
|
+
at_least(:once) { false }
|
447
|
+
expect(File).to receive(:exist?).
|
448
|
+
with(local_yaml_default).
|
449
|
+
at_least(:once) { true }
|
450
|
+
expect(File).to receive(:read).
|
451
|
+
with(local_yaml_default).
|
452
|
+
and_return(content)
|
453
|
+
expect(described_class.validate).to be_a Tmuxinator::Project
|
454
|
+
end
|
428
455
|
end
|
429
456
|
end
|
430
457
|
|
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.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allen Bargi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-06-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: erubis
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 1.2.1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 1.2.1
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: xdg
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
302
|
- !ruby/object:Gem::Version
|
303
303
|
version: 1.8.23
|
304
304
|
requirements: []
|
305
|
-
rubygems_version: 3.
|
305
|
+
rubygems_version: 3.2.22
|
306
306
|
signing_key:
|
307
307
|
specification_version: 4
|
308
308
|
summary: Create and manage complex tmux sessions easily.
|