mxup 0.3.0 → 1.0.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/README.md +254 -40
- data/examples/myapp-dev.yml +49 -14
- data/lib/mxup/cli.rb +10 -7
- data/lib/mxup/config.rb +409 -62
- data/lib/mxup/migrations.rb +109 -0
- data/lib/mxup/reconciler.rb +4 -2
- data/lib/mxup/runner.rb +10 -9
- data/lib/mxup/status_view.rb +1 -1
- data/lib/mxup/version.rb +1 -1
- data/lib/mxup.rb +2 -0
- metadata +3 -2
data/lib/mxup/runner.rb
CHANGED
|
@@ -174,23 +174,24 @@ module Mxup
|
|
|
174
174
|
# --- profile switching -------------------------------------------------
|
|
175
175
|
|
|
176
176
|
# Before `up` runs, make sure we aren't stepping on a different profile
|
|
177
|
-
# of the same group. If the live session was brought up under a
|
|
178
|
-
#
|
|
179
|
-
# slate.
|
|
177
|
+
# selection of the same group. If the live session was brought up under a
|
|
178
|
+
# different set of profiles, tear it down first so the new selection starts
|
|
179
|
+
# from a clean slate. Selection order doesn't matter — `-p a,b` and
|
|
180
|
+
# `-p b,a` are the same live stack.
|
|
180
181
|
def handle_profile_switch
|
|
181
|
-
return
|
|
182
|
+
return if @config.profiles.empty?
|
|
182
183
|
return unless Tmux.has_session?(@session)
|
|
183
184
|
|
|
184
185
|
stored = Tmux.show_environment(@session, 'MXUP_PROFILE')
|
|
185
|
-
return if stored.nil? || stored == @config.
|
|
186
|
+
return if stored.nil? || stored.split(',').to_set == @config.profiles.to_set
|
|
186
187
|
|
|
187
188
|
if @dry_run
|
|
188
|
-
$stdout.puts "[dry-run] Would tear down profile '#{stored}' before " \
|
|
189
|
-
"bringing up '#{@config.
|
|
189
|
+
$stdout.puts "[dry-run] Would tear down profile(s) '#{stored}' before " \
|
|
190
|
+
"bringing up '#{@config.profiles_label}'"
|
|
190
191
|
return
|
|
191
192
|
end
|
|
192
193
|
|
|
193
|
-
$stdout.puts "Switching profile: '#{stored}' -> '#{@config.
|
|
194
|
+
$stdout.puts "Switching profile: '#{stored}' -> '#{@config.profiles_label}' " \
|
|
194
195
|
'(tearing down current profile first)...'
|
|
195
196
|
down
|
|
196
197
|
end
|
|
@@ -301,7 +302,7 @@ module Mxup
|
|
|
301
302
|
|
|
302
303
|
def watcher_command
|
|
303
304
|
cmd = mxup_executable + ['watch', @session]
|
|
304
|
-
cmd.concat(['-p', @config.
|
|
305
|
+
cmd.concat(['-p', @config.profiles_label]) if @config.profiles.any?
|
|
305
306
|
cmd
|
|
306
307
|
end
|
|
307
308
|
|
data/lib/mxup/status_view.rb
CHANGED
|
@@ -33,7 +33,7 @@ module Mxup
|
|
|
33
33
|
created_at = Time.at(created.to_i).strftime('%Y-%m-%d %H:%M:%S')
|
|
34
34
|
stored_prof = Tmux.show_environment(@session, 'MXUP_PROFILE')
|
|
35
35
|
bits = []
|
|
36
|
-
bits << "profile: #{stored_prof}"
|
|
36
|
+
bits << "#{stored_prof.include?(',') ? 'profiles' : 'profile'}: #{stored_prof}" if stored_prof
|
|
37
37
|
bits << "layout: #{active}" if active
|
|
38
38
|
suffix = bits.empty? ? '' : " (#{bits.join(', ')})"
|
|
39
39
|
out.puts "SESSION: #{@session} — up since #{created_at}#{suffix}"
|
data/lib/mxup/version.rb
CHANGED
data/lib/mxup.rb
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#
|
|
10
10
|
# Internals are organised into focused modules under lib/mxup/:
|
|
11
11
|
# Config / Window / PaneGroup / WaitSpec — pure data
|
|
12
|
+
# Migrations — config format history (`mxup migrations`)
|
|
12
13
|
# EnvFile — required_env validation + .env scaffolding
|
|
13
14
|
# Tmux — thin tmux(1) wrapper
|
|
14
15
|
# Launcher — per-window launcher scripts
|
|
@@ -33,6 +34,7 @@ module Mxup
|
|
|
33
34
|
end
|
|
34
35
|
|
|
35
36
|
require_relative 'mxup/config'
|
|
37
|
+
require_relative 'mxup/migrations'
|
|
36
38
|
require_relative 'mxup/env_file'
|
|
37
39
|
require_relative 'mxup/tmux'
|
|
38
40
|
require_relative 'mxup/launcher'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mxup
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vladislav Saifulin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|
|
@@ -62,6 +62,7 @@ files:
|
|
|
62
62
|
- lib/mxup/graceful_stop.rb
|
|
63
63
|
- lib/mxup/launcher.rb
|
|
64
64
|
- lib/mxup/layout_manager.rb
|
|
65
|
+
- lib/mxup/migrations.rb
|
|
65
66
|
- lib/mxup/pane_resolver.rb
|
|
66
67
|
- lib/mxup/process_probe.rb
|
|
67
68
|
- lib/mxup/reconciler.rb
|