squared 0.4.2 → 0.4.3
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/CHANGELOG.md +16 -0
- data/README.ruby.md +1 -0
- data/lib/squared/common/base.rb +2 -1
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/project/docker.rb +8 -5
- data/lib/squared/workspace/project/git.rb +21 -8
- 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: e853dbba49cb1383e99d6d2c1cc7a4dbe9a62a3c3af22eefdb1980cb4d541a59
|
4
|
+
data.tar.gz: 7beece13d36c4f8269c4172f94e83f0237c122bd582a78c47b4085ca3e337bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afc95be4880369baca382127c313baf9e561ce5b44ec9bcaa2069226e2774350ae037b22b1f0b1a4fe3b11efd3ac4e109154e0d78ee50b07ebfc2949ffdebfc9
|
7
|
+
data.tar.gz: 56380157773696be7f6430259d4f6d63e3ef3b198abdea4d7433419252c742d10b50c6b3374c824acfce130ef06f30e13b4f045f89d2c7528d47738a1ca9e670
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.4.3] - 2025-04-01
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Git global command branch shows ahead and behind values.
|
8
|
+
- Workspace theme style label warn was created.
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
- Git and Docker did not order common options first.
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- Git commit amend uses flag --force-with-lease.
|
17
|
+
|
3
18
|
## [0.4.2] - 2025-03-28
|
4
19
|
|
5
20
|
### Added
|
@@ -390,6 +405,7 @@
|
|
390
405
|
|
391
406
|
- Changelog was created.
|
392
407
|
|
408
|
+
[0.4.3]: https://github.com/anpham6/squared/releases/tag/v0.4.3-ruby
|
393
409
|
[0.4.2]: https://github.com/anpham6/squared/releases/tag/v0.4.2-ruby
|
394
410
|
[0.4.1]: https://github.com/anpham6/squared/releases/tag/v0.4.1-ruby
|
395
411
|
[0.4.0]: https://github.com/anpham6/squared/releases/tag/v0.4.0-ruby
|
data/README.ruby.md
CHANGED
data/lib/squared/common/base.rb
CHANGED
data/lib/squared/version.rb
CHANGED
@@ -492,11 +492,14 @@ module Squared
|
|
492
492
|
private
|
493
493
|
|
494
494
|
def docker_session(*cmd, opts: nil)
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
495
|
+
if opts
|
496
|
+
out = []
|
497
|
+
opts = option_sanitize(opts, OPT_DOCKER[:common], target: out).first
|
498
|
+
ret = session('docker', *out, *cmd)
|
499
|
+
[ret, opts]
|
500
|
+
else
|
501
|
+
session('docker', *cmd)
|
502
|
+
end
|
500
503
|
end
|
501
504
|
|
502
505
|
def docker_output(*cmd, **kwargs)
|
@@ -698,7 +698,9 @@ module Squared
|
|
698
698
|
|
699
699
|
def pull(flag = nil, opts = [], sync: invoked_sync?('pull', flag), remote: nil)
|
700
700
|
cmd, opts = git_session('pull', flag && "--#{flag}", opts: opts)
|
701
|
-
if
|
701
|
+
if flag == :rebase
|
702
|
+
cmd << '--autostash' if option('autostash')
|
703
|
+
elsif (val = option('rebase', ignore: false))
|
702
704
|
cmd << case val
|
703
705
|
when '0'
|
704
706
|
'--no-rebase'
|
@@ -1111,7 +1113,7 @@ module Squared
|
|
1111
1113
|
b << '--dry-run'
|
1112
1114
|
end
|
1113
1115
|
a << pathspec
|
1114
|
-
b << '--force' if amend
|
1116
|
+
b << '--force-with-lease' if amend
|
1115
1117
|
b << origin << branch
|
1116
1118
|
puts if pass
|
1117
1119
|
source a
|
@@ -1215,7 +1217,16 @@ module Squared
|
|
1215
1217
|
a = sub_style(data[0], styles: theme[:inline])
|
1216
1218
|
b = sub_style(data[1], styles: theme[:extra])
|
1217
1219
|
r = /\A(?:\[(.+?)(?=\]\s)\]\s)?(.+)\z/m.match(data[2..-1].join(' '))
|
1218
|
-
|
1220
|
+
if (r1 = r[1]) && r1 =~ /^(.+):(?: ([a-z]+) (\d+),)? ([a-z]+) (\d+)$/
|
1221
|
+
write = ->(s1, s2) { "#{s1.capitalize.rjust(7)}: #{sub_style(s2, styles: theme[:warn])}" }
|
1222
|
+
r1 = $1
|
1223
|
+
r2 = $2 && write.($2, $3)
|
1224
|
+
r3 = write.($4, $5)
|
1225
|
+
end
|
1226
|
+
r1 = nil if r1 == "origin/#{data[0]}"
|
1227
|
+
[" Branch: #{a + (r1 ? " (#{r1})" : '')}", r2, r3, " Commit: #{b}", "Message: #{r[2]}"]
|
1228
|
+
.compact
|
1229
|
+
.join("\n")
|
1219
1230
|
end
|
1220
1231
|
on :last, from
|
1221
1232
|
end
|
@@ -1577,11 +1588,13 @@ module Squared
|
|
1577
1588
|
|
1578
1589
|
def git_session(*cmd, opts: nil, worktree: true, **kwargs)
|
1579
1590
|
dir = worktree ? ["--work-tree=#{shell_quote(path)}", "--git-dir=#{shell_quote(gitpath)}"] : []
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1591
|
+
if opts
|
1592
|
+
opts = option_sanitize(opts, OPT_GIT[:common], target: dir).first
|
1593
|
+
ret = session('git', *dir, *cmd, **kwargs)
|
1594
|
+
[ret, opts]
|
1595
|
+
else
|
1596
|
+
session('git', *dir, *cmd, **kwargs)
|
1597
|
+
end
|
1585
1598
|
end
|
1586
1599
|
|
1587
1600
|
def git_output(*cmd, **kwargs)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squared
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- An Pham
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-04-01 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rake
|