squared 0.1.6 → 0.1.7
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 +11 -0
- data/lib/squared/common/format.rb +1 -1
- data/lib/squared/common/prompt.rb +1 -1
- data/lib/squared/common/shell.rb +2 -2
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/project/base.rb +1 -1
- data/lib/squared/workspace/project/git.rb +20 -35
- data/lib/squared/workspace/project/ruby.rb +6 -4
- data/lib/squared/workspace/repo.rb +0 -2
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a84fd3fef43628c438131d98c9ac058b2511a7a7f0edab355ae534137a612d1d
|
4
|
+
data.tar.gz: 46e0925a6e7d854d71602aee88d54c2efff7e7ff782d847fd85e95759bad3ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e90a44a3914f551b4567d2013882ce362dfdc43b44bb157cb24fb2b6171cb64c46dbbb680ba7fcc17fd32f76d0e8d82bfa5ddc411eb00de5524ab5407135d413
|
7
|
+
data.tar.gz: 993f3899bf89ed18f8b89ddda7019c33484b76d2a770a72b8280fa898af6a7caecceafe862de7854236c9e52ddb7c2100cd9e388b8afb4dd3d0f4427647f15ad
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.1.7] - 2025-04-27
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- Project directory context method option pass was inverted.
|
8
|
+
- Shell options with spaces and without quotes were not escaped.
|
9
|
+
- Git task status did not display branch information.
|
10
|
+
- Ruby copy method argument include was ignored when used directly.
|
11
|
+
- Git commit could not push branch without same name as remote.
|
12
|
+
|
3
13
|
## [0.1.6] - 2025-04-17
|
4
14
|
|
5
15
|
### Fixed
|
@@ -108,6 +118,7 @@
|
|
108
118
|
|
109
119
|
- Changelog was created.
|
110
120
|
|
121
|
+
[0.1.7]: https://github.com/anpham6/squared/releases/tag/v0.1.7-ruby
|
111
122
|
[0.1.6]: https://github.com/anpham6/squared/releases/tag/v0.1.6-ruby
|
112
123
|
[0.1.5]: https://github.com/anpham6/squared/releases/tag/v0.1.5-ruby
|
113
124
|
[0.1.4]: https://github.com/anpham6/squared/releases/tag/v0.1.4-ruby
|
data/lib/squared/common/shell.rb
CHANGED
@@ -10,7 +10,7 @@ module Squared
|
|
10
10
|
|
11
11
|
def shell_escape(val, quote: false, force: false)
|
12
12
|
if (data = /\A(--?[^= ]+)((=|\s+)(["'])?(.+?)(["'])?)?\z/m.match(val = val.to_s))
|
13
|
-
return val if !data[2] || (!data[4] && data[5]
|
13
|
+
return val if !data[2] || (!data[4] && !data[5].match?(/\s/))
|
14
14
|
|
15
15
|
join = ->(opt) { data[1] + data[3] + shell_quote(opt) }
|
16
16
|
if data[4] == data[6]
|
@@ -21,7 +21,7 @@ module Squared
|
|
21
21
|
elsif Rake::Win32.windows?
|
22
22
|
quote ? shell_quote(val, force: force) : val
|
23
23
|
else
|
24
|
-
Shellwords.escape(val)
|
24
|
+
val.empty? ? '' : Shellwords.escape(val)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
data/lib/squared/version.rb
CHANGED
@@ -922,7 +922,7 @@ module Squared
|
|
922
922
|
def pwd_set(done = nil, pass: false, &blk)
|
923
923
|
pwd = Pathname.pwd
|
924
924
|
if block_given?
|
925
|
-
if path == pwd || pass == true || (pass.is_a?(String) && semscan(pass).join
|
925
|
+
if path == pwd || pass == true || (pass.is_a?(String) && semscan(pass).join <= RUBY_VERSION)
|
926
926
|
ret = instance_eval(&blk)
|
927
927
|
else
|
928
928
|
Dir.chdir(path)
|
@@ -295,6 +295,7 @@ module Squared
|
|
295
295
|
|
296
296
|
def status
|
297
297
|
cmd = git_session 'status', option('long') ? '--long' : '--short'
|
298
|
+
cmd << '--branch' if option('branch')
|
298
299
|
if (val = option('ignore-submodules', ignore: false))
|
299
300
|
cmd << shell_option('ignore-submodules', case val
|
300
301
|
when '0', 'none'
|
@@ -465,41 +466,29 @@ module Squared
|
|
465
466
|
raise_error('commit', 'pathspec', hint: 'missing') if (files = projectmap(files)).empty?
|
466
467
|
"-- #{files.join(' ')}"
|
467
468
|
end
|
468
|
-
|
469
|
+
format = '%(if)%(HEAD)%(then)%(refname:short)...%(upstream:short)...%(upstream:track)%(end)'
|
469
470
|
branch = nil
|
470
|
-
|
471
|
-
source('git fetch --no-tags --quiet', io: true, banner: false)
|
472
|
-
source(
|
473
|
-
next
|
474
|
-
|
475
|
-
branch =
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
next unless s.end_with?("/#{branch}")
|
483
|
-
|
484
|
-
origin = s[0..s.size - branch.size - 2]
|
485
|
-
break
|
486
|
-
end
|
487
|
-
end
|
488
|
-
end
|
489
|
-
upstream = !origin.nil?
|
490
|
-
elsif (data = Regexp.new("\\A(.+)/#{Regexp.escape(branch)}\\z").match(data[3]))
|
491
|
-
origin = data[1]
|
471
|
+
origin = nil
|
472
|
+
source('git fetch --no-tags --quiet', io: true, banner: false, stdout: true)
|
473
|
+
source("git for-each-ref --format=\"#{format}\" refs/heads", io: true, banner: false).first.each do |line|
|
474
|
+
next if (line = line.chomp).empty?
|
475
|
+
|
476
|
+
branch, origin, hint = line.split('...')
|
477
|
+
if hint && !hint.match?(/^\[(\D+0,\D+0)\]$/)
|
478
|
+
raise_error('work tree is not usable', hint: hint[1..-2])
|
479
|
+
elsif origin.empty?
|
480
|
+
return nil if pass
|
481
|
+
|
482
|
+
raise_error('no remote upstream', hint: branch)
|
492
483
|
end
|
493
484
|
break
|
494
485
|
end
|
495
|
-
|
486
|
+
i = origin.index('/')
|
487
|
+
branch = "#{branch}:#{origin[i + 1..-1]}" unless origin.end_with?("/#{branch}")
|
488
|
+
origin = origin[0..i - 1]
|
496
489
|
cmd = git_session 'commit'
|
497
490
|
cmd << '--dry-run' if option('dry-run')
|
498
|
-
if amend
|
499
|
-
cmd << '--amend'
|
500
|
-
else
|
501
|
-
cmd.delete('--amend')
|
502
|
-
end
|
491
|
+
cmd << '--amend' if amend
|
503
492
|
if message
|
504
493
|
append_message message
|
505
494
|
elsif flag == :'amend-orig' || option('no-edit')
|
@@ -507,13 +496,9 @@ module Squared
|
|
507
496
|
end
|
508
497
|
a = ['git add --verbose']
|
509
498
|
b = ['git push']
|
510
|
-
b << '--
|
511
|
-
if dry_run?
|
512
|
-
a << '--dry-run'
|
513
|
-
b << '--dry-run'
|
514
|
-
end
|
499
|
+
b << '--dry-run' if dry_run?
|
515
500
|
a << pathspec
|
516
|
-
b << '--force' if amend
|
501
|
+
b << '--force-with-lease' if amend
|
517
502
|
b << origin << branch
|
518
503
|
puts if pass
|
519
504
|
source a.join(' ')
|
@@ -207,13 +207,15 @@ module Squared
|
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
|
-
def copy(from: 'lib',
|
210
|
+
def copy(from: 'lib', into: @gemdir, override: false, **kwargs)
|
211
|
+
glob = kwargs[:include]
|
212
|
+
pass = kwargs[:exclude]
|
211
213
|
if @copy && !override
|
212
214
|
return super if runnable?(@copy)
|
213
215
|
|
214
216
|
from = @copy[:from] if @copy.key?(:from)
|
215
217
|
glob = @copy[:include] if @copy.key?(:include)
|
216
|
-
|
218
|
+
pass = @copy[:exclude] if @copy.key?(:exclude)
|
217
219
|
into = @copy[:into] if @copy.key?(:into)
|
218
220
|
end
|
219
221
|
return unless into
|
@@ -224,9 +226,9 @@ module Squared
|
|
224
226
|
as_a(from).each_with_index do |val, i|
|
225
227
|
a = basepath(val)
|
226
228
|
b = dest.join(val)
|
227
|
-
c = glob[i] || glob
|
229
|
+
c = glob[i] || glob.first
|
228
230
|
log.info "cp #{a.join(c)} #{b}"
|
229
|
-
copy_d(a, b, glob: c, pass:
|
231
|
+
copy_d(a, b, glob: c, pass: pass, verbose: verbose)
|
230
232
|
end
|
231
233
|
end
|
232
234
|
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squared
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- An Pham
|
8
|
+
autorequire:
|
8
9
|
bindir: exe
|
9
10
|
cert_chain: []
|
10
|
-
date:
|
11
|
+
date: 2025-04-28 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: rake
|
@@ -106,6 +107,7 @@ metadata:
|
|
106
107
|
homepage_uri: https://github.com/anpham6/squared
|
107
108
|
source_code_uri: https://github.com/anpham6/squared
|
108
109
|
documentation_uri: https://squared.readthedocs.io
|
110
|
+
post_install_message:
|
109
111
|
rdoc_options: []
|
110
112
|
require_paths:
|
111
113
|
- lib
|
@@ -120,7 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
122
|
- !ruby/object:Gem::Version
|
121
123
|
version: '0'
|
122
124
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
125
|
+
rubygems_version: 3.3.27
|
126
|
+
signing_key:
|
124
127
|
specification_version: 4
|
125
128
|
summary: Rake task generator for managing multi-language workspaces.
|
126
129
|
test_files: []
|