tmuxinator 0.13.0 → 0.14.0
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.rb +1 -16
- data/lib/tmuxinator/cli.rb +34 -3
- data/lib/tmuxinator/project.rb +2 -13
- data/lib/tmuxinator/tmux_version.rb +29 -0
- data/lib/tmuxinator/version.rb +1 -1
- data/spec/lib/tmuxinator/cli_spec.rb +53 -6
- metadata +22 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc5773ff4f15a7fe8845c86254fd30a2955fc2b27696868e011c3bd7270b5338
|
4
|
+
data.tar.gz: 3af29bcfbcb61b3cf0fc25ef750f5abe027ab227d87b7cdc232f43f3ed497097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c47cf13e6a6bf16dca8c92ed7c75717c15bb6c10e012ebb30b6ebe629fd93466f96c0add8d230bb4d42d0e37f7c4324aa76c7c39e63a15b4abda5124ae5dec42
|
7
|
+
data.tar.gz: f3f676e33b049051b264eaec47eaaca6ce4b3d3ce67e96a8857599216e60269ec3fe28c34bee490151fdfdc94269477904fa256fd9ff6ba58e53299a2ef82ebc
|
data/lib/tmuxinator.rb
CHANGED
@@ -7,24 +7,9 @@ require "xdg"
|
|
7
7
|
require "yaml"
|
8
8
|
|
9
9
|
module Tmuxinator
|
10
|
-
SUPPORTED_TMUX_VERSIONS = [
|
11
|
-
1.5,
|
12
|
-
1.6,
|
13
|
-
1.7,
|
14
|
-
1.8,
|
15
|
-
1.9,
|
16
|
-
2.0,
|
17
|
-
2.1,
|
18
|
-
2.2,
|
19
|
-
2.3,
|
20
|
-
2.4,
|
21
|
-
2.5,
|
22
|
-
2.6,
|
23
|
-
2.7,
|
24
|
-
2.8
|
25
|
-
].freeze
|
26
10
|
end
|
27
11
|
|
12
|
+
require "tmuxinator/tmux_version"
|
28
13
|
require "tmuxinator/util"
|
29
14
|
require "tmuxinator/deprecations"
|
30
15
|
require "tmuxinator/wemux_support"
|
data/lib/tmuxinator/cli.rb
CHANGED
@@ -202,14 +202,27 @@ module Tmuxinator
|
|
202
202
|
def render_project(project)
|
203
203
|
if project.deprecations.any?
|
204
204
|
project.deprecations.each { |deprecation| say deprecation, :red }
|
205
|
-
|
206
|
-
print "Press ENTER to continue."
|
207
|
-
STDIN.getc
|
205
|
+
show_continuation_prompt
|
208
206
|
end
|
209
207
|
|
210
208
|
Kernel.exec(project.render)
|
211
209
|
end
|
212
210
|
|
211
|
+
def version_warning?(suppress_flag)
|
212
|
+
!Tmuxinator::TmuxVersion.supported? && !suppress_flag
|
213
|
+
end
|
214
|
+
|
215
|
+
def show_version_warning
|
216
|
+
say Tmuxinator::TmuxVersion::UNSUPPORTED_VERSION_MSG, :red
|
217
|
+
show_continuation_prompt
|
218
|
+
end
|
219
|
+
|
220
|
+
def show_continuation_prompt
|
221
|
+
say
|
222
|
+
print "Press ENTER to continue."
|
223
|
+
STDIN.getc
|
224
|
+
end
|
225
|
+
|
213
226
|
def kill_project(project)
|
214
227
|
Kernel.exec(project.kill)
|
215
228
|
end
|
@@ -224,6 +237,8 @@ module Tmuxinator
|
|
224
237
|
desc: "Give the session a different name"
|
225
238
|
method_option "project-config", aliases: "-p",
|
226
239
|
desc: "Path to project config file"
|
240
|
+
method_option "suppress-tmux-version-warning",
|
241
|
+
desc: "Don't show a warning for unsupported tmux versions"
|
227
242
|
|
228
243
|
def start(name = nil, *args)
|
229
244
|
# project-config takes precedence over a named project in the case that
|
@@ -241,25 +256,41 @@ module Tmuxinator
|
|
241
256
|
project_config: options["project-config"]
|
242
257
|
}
|
243
258
|
|
259
|
+
show_version_warning if version_warning?(
|
260
|
+
options["suppress-tmux-version-warning"]
|
261
|
+
)
|
262
|
+
|
244
263
|
project = create_project(params)
|
245
264
|
render_project(project)
|
246
265
|
end
|
247
266
|
|
248
267
|
desc "stop [PROJECT]", COMMANDS[:stop]
|
249
268
|
map "st" => :stop
|
269
|
+
method_option "suppress-tmux-version-warning",
|
270
|
+
desc: "Don't show a warning for unsupported tmux versions"
|
250
271
|
|
251
272
|
def stop(name)
|
252
273
|
params = {
|
253
274
|
name: name
|
254
275
|
}
|
276
|
+
show_version_warning if version_warning?(
|
277
|
+
options["suppress-tmux-version-warning"]
|
278
|
+
)
|
279
|
+
|
255
280
|
project = create_project(params)
|
256
281
|
kill_project(project)
|
257
282
|
end
|
258
283
|
|
259
284
|
desc "local", COMMANDS[:local]
|
260
285
|
map "." => :local
|
286
|
+
method_option "suppress-tmux-version-warning",
|
287
|
+
desc: "Don't show a warning for unsupported tmux versions"
|
261
288
|
|
262
289
|
def local
|
290
|
+
show_version_warning if version_warning?(
|
291
|
+
options["suppress-tmux-version-warning"]
|
292
|
+
)
|
293
|
+
|
263
294
|
render_project(create_project(attach: options[:attach]))
|
264
295
|
end
|
265
296
|
|
data/lib/tmuxinator/project.rb
CHANGED
@@ -34,11 +34,6 @@ module Tmuxinator
|
|
34
34
|
DEPRECATION: The `post` option has been replaced by project hooks and will
|
35
35
|
not be supported anymore.
|
36
36
|
M
|
37
|
-
TMUX_MASTER_DEP_MSG = <<-M
|
38
|
-
DEPRECATION: You are running tmuxinator with an unsupported version of tmux.
|
39
|
-
Please consider using a supported version:
|
40
|
-
(#{Tmuxinator::SUPPORTED_TMUX_VERSIONS.join(', ')})
|
41
|
-
M
|
42
37
|
|
43
38
|
attr_reader :yaml
|
44
39
|
attr_reader :force_attach
|
@@ -276,8 +271,7 @@ module Tmuxinator
|
|
276
271
|
cli_args?,
|
277
272
|
legacy_synchronize?,
|
278
273
|
pre?,
|
279
|
-
post
|
280
|
-
unsupported_version?
|
274
|
+
post?
|
281
275
|
]
|
282
276
|
end
|
283
277
|
|
@@ -288,8 +282,7 @@ module Tmuxinator
|
|
288
282
|
CLIARGS_DEP_MSG,
|
289
283
|
SYNC_DEP_MSG,
|
290
284
|
PRE_DEP_MSG,
|
291
|
-
POST_DEP_MSG
|
292
|
-
TMUX_MASTER_DEP_MSG
|
285
|
+
POST_DEP_MSG
|
293
286
|
]
|
294
287
|
end
|
295
288
|
|
@@ -321,10 +314,6 @@ module Tmuxinator
|
|
321
314
|
yaml["post"]
|
322
315
|
end
|
323
316
|
|
324
|
-
def unsupported_version?
|
325
|
-
!Tmuxinator::SUPPORTED_TMUX_VERSIONS.include?(Tmuxinator::Config.version)
|
326
|
-
end
|
327
|
-
|
328
317
|
def get_pane_base_index
|
329
318
|
tmux_config["pane-base-index"]
|
330
319
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Tmuxinator
|
2
|
+
module TmuxVersion
|
3
|
+
SUPPORTED_TMUX_VERSIONS = [
|
4
|
+
1.5,
|
5
|
+
1.6,
|
6
|
+
1.7,
|
7
|
+
1.8,
|
8
|
+
1.9,
|
9
|
+
2.0,
|
10
|
+
2.1,
|
11
|
+
2.2,
|
12
|
+
2.3,
|
13
|
+
2.4,
|
14
|
+
2.5,
|
15
|
+
2.6,
|
16
|
+
2.7,
|
17
|
+
2.8
|
18
|
+
].freeze
|
19
|
+
UNSUPPORTED_VERSION_MSG = <<-MSG.freeze
|
20
|
+
WARNING: You are running tmuxinator with an unsupported version of tmux.
|
21
|
+
Please consider using a supported version:
|
22
|
+
(#{SUPPORTED_TMUX_VERSIONS.join(', ')})
|
23
|
+
MSG
|
24
|
+
|
25
|
+
def self.supported?(version = Tmuxinator::Config.version)
|
26
|
+
SUPPORTED_TMUX_VERSIONS.include?(version)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/tmuxinator/version.rb
CHANGED
@@ -207,6 +207,47 @@ describe Tmuxinator::Cli do
|
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
|
+
shared_examples_for :unsupported_version_message do |*args|
|
211
|
+
before do
|
212
|
+
ARGV.replace([*args])
|
213
|
+
end
|
214
|
+
|
215
|
+
context "unsupported version" do
|
216
|
+
before do
|
217
|
+
allow($stdin).to receive_messages(getc: "y")
|
218
|
+
allow(Tmuxinator::TmuxVersion).to receive(:supported?).and_return(false)
|
219
|
+
end
|
220
|
+
|
221
|
+
it "prints the warning" do
|
222
|
+
out, _err = capture_io { cli.start }
|
223
|
+
expect(out).to include "WARNING"
|
224
|
+
end
|
225
|
+
|
226
|
+
context "with --suppress-tmux-version-warning flag" do
|
227
|
+
before do
|
228
|
+
ARGV.replace([*args, "--suppress-tmux-version-warning"])
|
229
|
+
end
|
230
|
+
|
231
|
+
it "does not print the warning" do
|
232
|
+
out, _err = capture_io { cli.start }
|
233
|
+
expect(out).not_to include "WARNING"
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
context "supported version" do
|
239
|
+
before do
|
240
|
+
allow($stdin).to receive_messages(getc: "y")
|
241
|
+
allow(Tmuxinator::TmuxVersion).to receive(:supported?).and_return(true)
|
242
|
+
end
|
243
|
+
|
244
|
+
it "does not print the warning" do
|
245
|
+
out, _err = capture_io { cli.start }
|
246
|
+
expect(out).not_to include "WARNING"
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
210
251
|
describe "#start" do
|
211
252
|
before do
|
212
253
|
ARGV.replace(["start", "foo"])
|
@@ -255,6 +296,8 @@ describe Tmuxinator::Cli do
|
|
255
296
|
expect(out).to include "DEPRECATION"
|
256
297
|
end
|
257
298
|
end
|
299
|
+
|
300
|
+
include_examples :unsupported_version_message, :start, :foo
|
258
301
|
end
|
259
302
|
|
260
303
|
describe "#stop" do
|
@@ -273,16 +316,18 @@ describe Tmuxinator::Cli do
|
|
273
316
|
expect(out).to eq ""
|
274
317
|
end
|
275
318
|
end
|
319
|
+
|
320
|
+
include_examples :unsupported_version_message, :stop, :foo
|
276
321
|
end
|
277
322
|
|
278
323
|
describe "#local" do
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
end
|
324
|
+
before do
|
325
|
+
allow(Tmuxinator::Config).to receive_messages(validate: project)
|
326
|
+
allow(Tmuxinator::Config).to receive_messages(version: 1.9)
|
327
|
+
allow(Kernel).to receive(:exec)
|
328
|
+
end
|
285
329
|
|
330
|
+
shared_examples_for :local_project do
|
286
331
|
it "starts the project" do
|
287
332
|
expect(Kernel).to receive(:exec)
|
288
333
|
out, err = capture_io { cli.start }
|
@@ -304,6 +349,8 @@ describe Tmuxinator::Cli do
|
|
304
349
|
end
|
305
350
|
it_should_behave_like :local_project
|
306
351
|
end
|
352
|
+
|
353
|
+
include_examples :unsupported_version_message, :local
|
307
354
|
end
|
308
355
|
|
309
356
|
describe "#start(custom_name)" do
|
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: 0.
|
4
|
+
version: 0.14.0
|
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: 2018-
|
12
|
+
date: 2018-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: erubis
|
@@ -113,14 +113,14 @@ dependencies:
|
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '0.
|
116
|
+
version: '0.8'
|
117
117
|
type: :development
|
118
118
|
prerelease: false
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '0.
|
123
|
+
version: '0.8'
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: factory_bot
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,14 +197,28 @@ dependencies:
|
|
197
197
|
requirements:
|
198
198
|
- - "~>"
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version: 0.
|
200
|
+
version: '0.16'
|
201
201
|
type: :development
|
202
202
|
prerelease: false
|
203
203
|
version_requirements: !ruby/object:Gem::Requirement
|
204
204
|
requirements:
|
205
205
|
- - "~>"
|
206
206
|
- !ruby/object:Gem::Version
|
207
|
-
version: 0.
|
207
|
+
version: '0.16'
|
208
|
+
- !ruby/object:Gem::Dependency
|
209
|
+
name: unicode-display_width
|
210
|
+
requirement: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - "~>"
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '1.3'
|
215
|
+
type: :development
|
216
|
+
prerelease: false
|
217
|
+
version_requirements: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - "~>"
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '1.3'
|
208
222
|
description: Create and manage complex tmux sessions easily.
|
209
223
|
email:
|
210
224
|
- allen.bargi@gmail.com
|
@@ -232,6 +246,7 @@ files:
|
|
232
246
|
- lib/tmuxinator/hooks/project.rb
|
233
247
|
- lib/tmuxinator/pane.rb
|
234
248
|
- lib/tmuxinator/project.rb
|
249
|
+
- lib/tmuxinator/tmux_version.rb
|
235
250
|
- lib/tmuxinator/util.rb
|
236
251
|
- lib/tmuxinator/version.rb
|
237
252
|
- lib/tmuxinator/wemux_support.rb
|
@@ -294,7 +309,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
309
|
version: 1.8.23
|
295
310
|
requirements: []
|
296
311
|
rubyforge_project:
|
297
|
-
rubygems_version: 2.7.
|
312
|
+
rubygems_version: 2.7.7
|
298
313
|
signing_key:
|
299
314
|
specification_version: 4
|
300
315
|
summary: Create and manage complex tmux sessions easily.
|