tmuxinator 3.0.0 → 3.0.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 +4 -4
- data/lib/tmuxinator/cli.rb +2 -2
- data/lib/tmuxinator/config.rb +2 -2
- data/lib/tmuxinator/tmux_version.rb +1 -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 +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19533e5c3c18b83999791fa24b296d6e3cfaa8953f46368d89c132c8c99aade8
|
4
|
+
data.tar.gz: 2dc93ac182cca66dc8321d41387001ecc508cf2982f4a4c0cf35c66a0669db40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58ccdbf54cb4421e6aac93f45450b8b1e5b276a03f973db356ff4f3a586a23d58125f7e9478cd38d15ecf2de33ddce34851f6069f33834948dc11153eb25d3da
|
7
|
+
data.tar.gz: b172cc7f5bbe5289ecec50385c1569042316c082c08f9005ceecb69ae0ae2d754288266c7f9fcd107fb0931b31a6134ada1a9fe13cdb7d15905c0e9b206cda82
|
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.1
|
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: 2021-06-
|
12
|
+
date: 2021-06-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: erubis
|
@@ -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.15
|
306
306
|
signing_key:
|
307
307
|
specification_version: 4
|
308
308
|
summary: Create and manage complex tmux sessions easily.
|