tmuxinator 3.3.5 → 3.3.6
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 +73 -10
- data/lib/tmuxinator/tmux_version.rb +1 -0
- data/lib/tmuxinator/version.rb +1 -1
- data/spec/lib/tmuxinator/cli_spec.rb +88 -0
- data/spec/lib/tmuxinator/config_spec.rb +1 -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: 1674129e2d3d0001468bb6ab7e8b304d758d8b1f41fd109f8373de858858e0bc
|
|
4
|
+
data.tar.gz: f2c815caabc1a64161cb0afad01d6347c51826af3882f2ec26661ba48340bf3e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8959a219874dc1bf4717880a83e529601fb5641327c70b89736cef1192328394df9320167d922540b71b96a1d31d7034e473ed4d61fdabd2a36dbd12b6f4407
|
|
7
|
+
data.tar.gz: 5ed4a6024b65078227ee4bcabe33042f9e26bc612daf27e81dbdbf77188ad1ba3d0817e8da3655e1dfb303b334f46507cf82f087e0cd4216176ef8292f71cad9
|
data/lib/tmuxinator/cli.rb
CHANGED
|
@@ -23,6 +23,7 @@ module Tmuxinator
|
|
|
23
23
|
delete: "Deletes given project",
|
|
24
24
|
doctor: "Look for problems in your configuration",
|
|
25
25
|
edit: "Alias of new",
|
|
26
|
+
help: "Shows help for a specific command",
|
|
26
27
|
implode: "Deletes all tmuxinator projects",
|
|
27
28
|
local: "Start a tmux session using ./.tmuxinator.y[a]ml",
|
|
28
29
|
list: "Lists all tmuxinator projects",
|
|
@@ -83,8 +84,16 @@ module Tmuxinator
|
|
|
83
84
|
method_option :local, type: :boolean,
|
|
84
85
|
aliases: ["-l"],
|
|
85
86
|
desc: "Create local project file at ./.tmuxinator.yml"
|
|
87
|
+
method_option :help, type: :boolean,
|
|
88
|
+
aliases: ["-h"],
|
|
89
|
+
desc: "Display usage information"
|
|
90
|
+
|
|
91
|
+
def new(name = nil, session = nil)
|
|
92
|
+
if options[:help] || name.nil?
|
|
93
|
+
invoke :help, ["new"]
|
|
94
|
+
return
|
|
95
|
+
end
|
|
86
96
|
|
|
87
|
-
def new(name, session = nil)
|
|
88
97
|
if session
|
|
89
98
|
new_project_with_session(name, session)
|
|
90
99
|
else
|
|
@@ -259,7 +268,15 @@ module Tmuxinator
|
|
|
259
268
|
"the current session"
|
|
260
269
|
method_option "no-pre-window", type: :boolean, default: false,
|
|
261
270
|
desc: "Skip pre_window commands"
|
|
271
|
+
method_option :help, type: :boolean,
|
|
272
|
+
aliases: "-h",
|
|
273
|
+
desc: "Display usage information"
|
|
262
274
|
def start(name = nil, *args)
|
|
275
|
+
if options[:help]
|
|
276
|
+
invoke :help, ["start"]
|
|
277
|
+
return
|
|
278
|
+
end
|
|
279
|
+
|
|
263
280
|
params = start_params(name, *args)
|
|
264
281
|
|
|
265
282
|
show_version_warning if version_warning?(
|
|
@@ -276,8 +293,16 @@ module Tmuxinator
|
|
|
276
293
|
desc: "Path to project config file"
|
|
277
294
|
method_option "suppress-tmux-version-warning",
|
|
278
295
|
desc: "Don't show a warning for unsupported tmux versions"
|
|
296
|
+
method_option :help, type: :boolean,
|
|
297
|
+
aliases: "-h",
|
|
298
|
+
desc: "Display usage information"
|
|
279
299
|
|
|
280
300
|
def stop(name = nil)
|
|
301
|
+
if options[:help]
|
|
302
|
+
invoke :help, ["stop"]
|
|
303
|
+
return
|
|
304
|
+
end
|
|
305
|
+
|
|
281
306
|
# project-config takes precedence over a named project in the case that
|
|
282
307
|
# both are provided.
|
|
283
308
|
if options["project-config"]
|
|
@@ -342,7 +367,15 @@ module Tmuxinator
|
|
|
342
367
|
"the current session"
|
|
343
368
|
method_option "no-pre-window", type: :boolean, default: false,
|
|
344
369
|
desc: "Skip pre_window commands"
|
|
370
|
+
method_option :help, type: :boolean,
|
|
371
|
+
aliases: "-h",
|
|
372
|
+
desc: "Display usage information"
|
|
345
373
|
def debug(name = nil, *args)
|
|
374
|
+
if options[:help]
|
|
375
|
+
invoke :help, ["debug"]
|
|
376
|
+
return
|
|
377
|
+
end
|
|
378
|
+
|
|
346
379
|
params = start_params(name, *args)
|
|
347
380
|
|
|
348
381
|
project = create_project(params)
|
|
@@ -353,8 +386,16 @@ module Tmuxinator
|
|
|
353
386
|
desc "copy [EXISTING] [NEW]", COMMANDS[:copy]
|
|
354
387
|
map "c" => :copy
|
|
355
388
|
map "cp" => :copy
|
|
389
|
+
method_option :help, type: :boolean,
|
|
390
|
+
aliases: "-h",
|
|
391
|
+
desc: "Display usage information"
|
|
392
|
+
|
|
393
|
+
def copy(existing = nil, new = nil)
|
|
394
|
+
if options[:help] || existing.nil? || new.nil?
|
|
395
|
+
invoke :help, ["copy"]
|
|
396
|
+
return
|
|
397
|
+
end
|
|
356
398
|
|
|
357
|
-
def copy(existing, new)
|
|
358
399
|
existing_config_path = Tmuxinator::Config.project(existing)
|
|
359
400
|
new_config_path = Tmuxinator::Config.project(new)
|
|
360
401
|
|
|
@@ -374,18 +415,32 @@ module Tmuxinator
|
|
|
374
415
|
desc "delete [PROJECT1] [PROJECT2] ...", COMMANDS[:delete]
|
|
375
416
|
map "d" => :delete
|
|
376
417
|
map "rm" => :delete
|
|
418
|
+
method_option :help, type: :boolean,
|
|
419
|
+
aliases: "-h",
|
|
420
|
+
desc: "Display usage information"
|
|
377
421
|
|
|
378
422
|
def delete(*projects)
|
|
379
|
-
projects.
|
|
380
|
-
|
|
381
|
-
|
|
423
|
+
if options[:help] || projects.empty?
|
|
424
|
+
invoke :help, ["delete"]
|
|
425
|
+
return
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
delete_projects(*projects)
|
|
429
|
+
end
|
|
382
430
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
431
|
+
no_commands do
|
|
432
|
+
def delete_projects(*projects)
|
|
433
|
+
projects.each do |project|
|
|
434
|
+
if Tmuxinator::Config.exist?(name: project)
|
|
435
|
+
config = Tmuxinator::Config.project(project)
|
|
436
|
+
|
|
437
|
+
if yes?("Are you sure you want to delete #{project}?(y/n)", :red)
|
|
438
|
+
FileUtils.rm(config)
|
|
439
|
+
say "Deleted #{project}"
|
|
440
|
+
end
|
|
441
|
+
else
|
|
442
|
+
say "#{project} does not exist!"
|
|
386
443
|
end
|
|
387
|
-
else
|
|
388
|
-
say "#{project} does not exist!"
|
|
389
444
|
end
|
|
390
445
|
end
|
|
391
446
|
end
|
|
@@ -411,8 +466,16 @@ module Tmuxinator
|
|
|
411
466
|
method_option :active, type: :boolean,
|
|
412
467
|
aliases: ["-a"],
|
|
413
468
|
desc: "Filter output by active project sessions."
|
|
469
|
+
method_option :help, type: :boolean,
|
|
470
|
+
aliases: ["-h"],
|
|
471
|
+
desc: "Display usage information"
|
|
414
472
|
|
|
415
473
|
def list
|
|
474
|
+
if options[:help]
|
|
475
|
+
invoke :help, ["list"]
|
|
476
|
+
return
|
|
477
|
+
end
|
|
478
|
+
|
|
416
479
|
say "tmuxinator projects:"
|
|
417
480
|
configs = Tmuxinator::Config.configs(active: options[:active])
|
|
418
481
|
if options[:newline]
|
data/lib/tmuxinator/version.rb
CHANGED
|
@@ -206,6 +206,7 @@ describe Tmuxinator::Cli do
|
|
|
206
206
|
delete
|
|
207
207
|
doctor
|
|
208
208
|
edit
|
|
209
|
+
help
|
|
209
210
|
implode
|
|
210
211
|
local
|
|
211
212
|
list
|
|
@@ -297,6 +298,24 @@ describe Tmuxinator::Cli do
|
|
|
297
298
|
end
|
|
298
299
|
end
|
|
299
300
|
|
|
301
|
+
context "with --help flag" do
|
|
302
|
+
it "shows help instead of starting project" do
|
|
303
|
+
ARGV.replace(["start", "--help"])
|
|
304
|
+
expect(Kernel).not_to receive(:exec)
|
|
305
|
+
out, _err = capture_io { cli.start }
|
|
306
|
+
expect(out).to include("start [PROJECT] [ARGS]")
|
|
307
|
+
expect(out).to include("Options:")
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
it "shows help with -h flag" do
|
|
311
|
+
ARGV.replace(["start", "-h"])
|
|
312
|
+
expect(Kernel).not_to receive(:exec)
|
|
313
|
+
out, _err = capture_io { cli.start }
|
|
314
|
+
expect(out).to include("start [PROJECT] [ARGS]")
|
|
315
|
+
expect(out).to include("Options:")
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
|
|
300
319
|
context "deprecations" do
|
|
301
320
|
before do
|
|
302
321
|
allow($stdin).to receive_messages(getc: "y")
|
|
@@ -340,6 +359,16 @@ describe Tmuxinator::Cli do
|
|
|
340
359
|
end
|
|
341
360
|
end
|
|
342
361
|
|
|
362
|
+
context "with --help flag" do
|
|
363
|
+
it "shows help instead of stopping project" do
|
|
364
|
+
ARGV.replace(["stop", "--help"])
|
|
365
|
+
expect(Kernel).not_to receive(:exec)
|
|
366
|
+
out, _err = capture_io { cli.start }
|
|
367
|
+
expect(out).to include("stop [PROJECT]")
|
|
368
|
+
expect(out).to include("Options:")
|
|
369
|
+
end
|
|
370
|
+
end
|
|
371
|
+
|
|
343
372
|
include_examples :unsupported_version_message, :stop, :foo
|
|
344
373
|
end
|
|
345
374
|
|
|
@@ -526,6 +555,15 @@ describe Tmuxinator::Cli do
|
|
|
526
555
|
allow(File).to receive(:open) { |&block| block.yield file }
|
|
527
556
|
end
|
|
528
557
|
|
|
558
|
+
context "with --help flag" do
|
|
559
|
+
it "shows help instead of creating project" do
|
|
560
|
+
ARGV.replace(["new", "--help"])
|
|
561
|
+
out, _err = capture_io { cli.start }
|
|
562
|
+
expect(out).to include("new [PROJECT]")
|
|
563
|
+
expect(out).to include("Options:")
|
|
564
|
+
end
|
|
565
|
+
end
|
|
566
|
+
|
|
529
567
|
context "without the --local option" do
|
|
530
568
|
before do
|
|
531
569
|
ARGV.replace(["new", name])
|
|
@@ -651,6 +689,31 @@ describe Tmuxinator::Cli do
|
|
|
651
689
|
allow(Tmuxinator::Config).to receive(:exist?) { true }
|
|
652
690
|
end
|
|
653
691
|
|
|
692
|
+
context "with --help flag" do
|
|
693
|
+
it "shows help instead of copying project" do
|
|
694
|
+
ARGV.replace(["copy", "--help"])
|
|
695
|
+
expect(FileUtils).not_to receive(:copy_file)
|
|
696
|
+
out, _err = capture_io { cli.start }
|
|
697
|
+
expect(out).to include("copy [EXISTING] [NEW]")
|
|
698
|
+
expect(out).to include("Options:")
|
|
699
|
+
end
|
|
700
|
+
|
|
701
|
+
it "shows help with -h flag" do
|
|
702
|
+
ARGV.replace(["copy", "-h"])
|
|
703
|
+
expect(FileUtils).not_to receive(:copy_file)
|
|
704
|
+
out, _err = capture_io { cli.start }
|
|
705
|
+
expect(out).to include("copy [EXISTING] [NEW]")
|
|
706
|
+
expect(out).to include("Options:")
|
|
707
|
+
end
|
|
708
|
+
|
|
709
|
+
it "shows help when only one argument provided" do
|
|
710
|
+
ARGV.replace(["copy", "foo"])
|
|
711
|
+
expect(FileUtils).not_to receive(:copy_file)
|
|
712
|
+
out, _err = capture_io { cli.start }
|
|
713
|
+
expect(out).to include("copy [EXISTING] [NEW]")
|
|
714
|
+
end
|
|
715
|
+
end
|
|
716
|
+
|
|
654
717
|
context "new project already exists" do
|
|
655
718
|
before do
|
|
656
719
|
allow(Thor::LineEditor).to receive_messages(readline: "y")
|
|
@@ -732,6 +795,31 @@ describe Tmuxinator::Cli do
|
|
|
732
795
|
end
|
|
733
796
|
|
|
734
797
|
describe "#delete" do
|
|
798
|
+
context "with --help flag" do
|
|
799
|
+
it "shows help instead of deleting project" do
|
|
800
|
+
ARGV.replace(["delete", "--help"])
|
|
801
|
+
expect(FileUtils).not_to receive(:rm)
|
|
802
|
+
out, _err = capture_io { cli.start }
|
|
803
|
+
expect(out).to include("delete [PROJECT1] [PROJECT2]")
|
|
804
|
+
expect(out).to include("Options:")
|
|
805
|
+
end
|
|
806
|
+
|
|
807
|
+
it "shows help with -h flag" do
|
|
808
|
+
ARGV.replace(["delete", "-h"])
|
|
809
|
+
expect(FileUtils).not_to receive(:rm)
|
|
810
|
+
out, _err = capture_io { cli.start }
|
|
811
|
+
expect(out).to include("delete [PROJECT1] [PROJECT2]")
|
|
812
|
+
expect(out).to include("Options:")
|
|
813
|
+
end
|
|
814
|
+
|
|
815
|
+
it "shows help when no arguments provided" do
|
|
816
|
+
ARGV.replace(["delete"])
|
|
817
|
+
expect(FileUtils).not_to receive(:rm)
|
|
818
|
+
out, _err = capture_io { cli.start }
|
|
819
|
+
expect(out).to include("delete [PROJECT1] [PROJECT2]")
|
|
820
|
+
end
|
|
821
|
+
end
|
|
822
|
+
|
|
735
823
|
context "with a single argument" do
|
|
736
824
|
before do
|
|
737
825
|
ARGV.replace(["delete", "foo"])
|
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.3.
|
|
4
|
+
version: 3.3.6
|
|
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: 2025-
|
|
12
|
+
date: 2025-11-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: erubi
|