squared 0.7.12 → 0.7.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1f82d48ab79c1dc869f6c34dbef07e57c7b1bd9cc0ce8b54582d2029d5e9889
4
- data.tar.gz: 55526a1592b3b6ef2aec992288fd74b7772837abc733d4eb6dc69f9e7a208cc6
3
+ metadata.gz: dcfaaa48501a181162e78334bb241561dbe890d64d71495dcfb4a88e9a4a8839
4
+ data.tar.gz: 192a883f356e0127e0d3ae0549d78745da6c0fe4ac80cf46f31b27b6740712a1
5
5
  SHA512:
6
- metadata.gz: 4b60c4bd1db9d601b87ae2e686c3d7ec2190cf766307186a682e10f0e200e5e5280196a7eb55d3c9821707189e9953b6ba1a76c2757ad1f10fec3c96e0d88a83
7
- data.tar.gz: b4527aff9694bf17460b65f0395d30147faaf5ccaee9042ac47e5d81d5f988470ff8e878e20f6a8dc22c39d7bcc166e15e953443a0785d46a71c5cb2aece8871
6
+ metadata.gz: 7141897d2f852cbcbad0ab3cd411f256c5111e28ad997c7987bdc2dd2cd9f7b59aff4de3c4ab1977b409fe7cdea56c219359a4d9940a694cabdc984c78b02647
7
+ data.tar.gz: 287860e11f435050c6bb64da259612977bdfc3c04aeac96bd4e1eb6c9d7432d9daf1e6c3f174c349410a9f2b26aec789e79c9b476aed48fbd4d42a36d6cd5b76
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.14] - 2026-10-22
4
+
5
+ ### Changed
6
+
7
+ - Python program meson prefix options use local path resolution.
8
+ - Bundle exec wrapper can be configured per application.
9
+
10
+ ### Fixed
11
+
12
+ - Bundle exec wrapper did not accept boolean values.
13
+
14
+ ## [0.6.21] - 2026-10-22
15
+
16
+ ### Fixed
17
+
18
+ - RuboCop did not resolve config to project directory.
19
+ - Python program did not use correct separator for double dash options.
20
+
21
+ ## [0.7.13] - 2026-09-25
22
+
23
+ ### Fixed
24
+
25
+ - OptionPartition did not parse quoted option values.
26
+
27
+ ## [0.6.20] - 2026-09-25
28
+
29
+ ### Added
30
+
31
+ - Prompt choice optional selection can be bypassed with a single dash.
32
+
33
+ ### Fixed
34
+
35
+ - Git interactive commit selection did not accept additional values.
36
+
3
37
  ## [0.7.12] - 2026-09-23
4
38
 
5
39
  ### Fixed
@@ -2018,6 +2052,8 @@
2018
2052
 
2019
2053
  - Changelog was created.
2020
2054
 
2055
+ [0.7.14]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.14
2056
+ [0.7.13]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.13
2021
2057
  [0.7.12]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.12
2022
2058
  [0.7.11]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.11
2023
2059
  [0.7.10]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.10
@@ -2031,6 +2067,8 @@
2031
2067
  [0.7.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.2
2032
2068
  [0.7.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.1
2033
2069
  [0.7.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.7.0
2070
+ [0.6.21]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.21
2071
+ [0.6.20]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.20
2034
2072
  [0.6.19]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.19
2035
2073
  [0.6.18]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.18
2036
2074
  [0.6.17]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.17
@@ -86,7 +86,9 @@ module Squared
86
86
  while (ch = Readline.readline(msg))
87
87
  ch.strip!
88
88
  unless ch.empty?
89
- if multiple
89
+ if ch == '-' && !force
90
+ break
91
+ elsif multiple
90
92
  k = if ch == '*'
91
93
  (min..max).to_a
92
94
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.7.12'
4
+ VERSION = '0.7.14'
5
5
  end
@@ -1166,10 +1166,20 @@ module Squared
1166
1166
  ret = basepath(*args)
1167
1167
  return ret unless ascend && !ret.exist?
1168
1168
 
1169
+ case ascend
1170
+ when String, Pathname
1171
+ root = Pathname.new(ascend).cleanpath
1172
+ root = nil unless root.absolute? && root.directory?
1173
+ end
1169
1174
  path.parent.ascend.each do |dir|
1170
1175
  target = dir.join(*args)
1171
1176
  return target if target.exist?
1172
- break if (ascend.is_a?(String) && dir.join(ascend).exist?) || workspace.root == dir || parent&.path == dir
1177
+
1178
+ if root
1179
+ break if dir == root
1180
+ elsif workspace.root == dir || parent&.path == dir || (ascend.is_a?(String) && dir.join(ascend).exist?)
1181
+ break
1182
+ end
1173
1183
  end
1174
1184
  ret
1175
1185
  end
@@ -1872,7 +1882,7 @@ module Squared
1872
1882
  out << ''
1873
1883
  end
1874
1884
  if from
1875
- out << from
1885
+ out << (from = from.to_s)
1876
1886
  /\A(#{Regexp.escape(from)})(.*)\z/
1877
1887
  end
1878
1888
  else
@@ -1528,7 +1528,7 @@ module Squared
1528
1528
  end
1529
1529
  if (n = op.index('>'))
1530
1530
  patch = op.slice!(n, 2)[1]
1531
- elsif !op.exist?(op.last)
1531
+ elsif !op.last.include?('*') && !op.exist?(op.last)
1532
1532
  patch ||= op.pop
1533
1533
  end
1534
1534
  append_pathspec op.extras
@@ -2104,7 +2104,7 @@ module Squared
2104
2104
  ret = choice_index('Choose a commit', git_spawn(cmd, stdout: false), column: /^(\S+)/, force: force, **kwargs)
2105
2105
  case ret
2106
2106
  when Array
2107
- ret.map { |val| val&.stripstyle }
2107
+ ret.map { |val| val.is_a?(Array) ? val.map { |s| s&.stripstyle } : val&.stripstyle }
2108
2108
  when String
2109
2109
  ret.stripstyle
2110
2110
  else
@@ -709,7 +709,7 @@ module Squared
709
709
  append_platform
710
710
  end
711
711
  end
712
- cmd << '--package-lock=false' << 'save=false' if nolockfile?('npm')
712
+ cmd << '--package-lock=false' << '--save=false' if nolockfile?('npm')
713
713
  cmd << '--ignore-scripts' if option('ignore-scripts')
714
714
  end
715
715
  if add
@@ -79,12 +79,12 @@ module Squared
79
79
  OPT_MESON = {
80
80
  build: %w[D=q clearcache debug errorlogs fatal-meson-warnings pkgconfig.relocatable prefer-static
81
81
  python.allow-limited-api reconfigure stdsplit strip vsenv werror wipe auto-features=b backend=b
82
- bindir=p build.cmake-prefix-path=p build.pkg-config-path=p buildtype=b cmake-prefix-path=p
83
- cross-file=p datadir=p default-library=b default-both-libraries=b force-fallback-for=q genvslite=b
84
- includedir=p infodir=p install-umask=b layout=b libdir=p libexecdir=p licensedir=p localedir=p
85
- localstatedir=p mandir=p native-file=p optimization=b pkg-config-path=p prefix=p
86
- python.bytecompile=i python.platlibdir=p python.purelibdir=p python.install-env=b sbindir=p
87
- sharedstatedir=p sysconfdir=p unity=b unity-size=i warnlevel=b wrap-mode=b].freeze,
82
+ bindir=q build.cmake-prefix-path=p build.pkg-config-path=p buildtype=b cmake-prefix-path=p
83
+ cross-file=p datadir=q default-library=b default-both-libraries=b force-fallback-for=q genvslite=b
84
+ includedir=q infodir=q install-umask=b layout=b libdir=q libexecdir=q licensedir=q localedir=q
85
+ localstatedir=q mandir=q native-file=p optimization=b pkg-config-path=p prefix=p
86
+ python.bytecompile=b python.platlibdir=p python.purelibdir=p python.install-env=b sbindir=q
87
+ sharedstatedir=q sysconfdir=q unity=b unity-size=i warnlevel=b wrap-mode=b].freeze,
88
88
  compile: %w[clean v|verbose j|jobs=i l|load-average=b ninja-args=q vs-args=q xcode-args=q].freeze
89
89
  }.freeze
90
90
  PASS_PYTHON = {
@@ -276,7 +276,7 @@ module Squared
276
276
  args = args.to_a
277
277
  if args.empty?
278
278
  args = readline('Enter command', force: true).split(' ', 2)
279
- elsif args.size == 1 && option('interactive', notequals: '0', prefix: ref)
279
+ elsif args.size == 1 && option('interactive', notequals: '0', prefix: 'python')
280
280
  args << readline('Enter arguments', force: false) unless args.first.include?(' ')
281
281
  end
282
282
  venv_init
@@ -346,18 +346,18 @@ module Squared
346
346
  case flag
347
347
  when :upgrade
348
348
  task flag, [:strategy] do |_, args|
349
- install flag, (case args.strategy
350
- when 'eager'
351
- 'eager'
352
- when /^only-if|needed$/
353
- 'only-if-needed'
354
- end.yield_self do |val|
355
- if val
356
- args.extras << "upgrade-strategy=#{val}"
357
- else
358
- args.to_a
359
- end
360
- end)
349
+ val = case args.strategy
350
+ when 'eager'
351
+ 'eager'
352
+ when /^only-if/, /needed$/
353
+ 'only-if-needed'
354
+ end
355
+ args = if val
356
+ args.extras << "upgrade-strategy=#{val}"
357
+ else
358
+ args.to_a
359
+ end
360
+ install flag, args
361
361
  end
362
362
  when :requirement, :target
363
363
  task flag, [:path] do |_, args|
@@ -738,7 +738,7 @@ module Squared
738
738
  op = OptionPartition.new(session_opts(with, args: args, kwargs: kwargs, pass: pass), OPT_PYTHON[:common],
739
739
  session('python', path: !venv?),
740
740
  project: self, strict: strict?, multiple: [/^-c/], single: singleopt(:python),
741
- args: true, stdin: true)
741
+ sep: ' ', args: true, stdin: true)
742
742
  op.concat(args)
743
743
  if op.include?('-')
744
744
  op.exist?(add: true)
@@ -937,7 +937,8 @@ module Squared
937
937
  pre = preopts(quiet: quiet)
938
938
  return session(name, *pre, *cmd, path: !venv?) unless opts
939
939
 
940
- op = OptionPartition.new(opts, common, project: self, strict: strict?, single: singleopt(name.to_sym))
940
+ op = OptionPartition.new(opts, common, project: self, strict: strict?, sep: name == 'python' ? ' ' : '=',
941
+ single: singleopt(name.to_sym))
941
942
  [session(name, *pre, *op.to_a, *cmd, path: !venv?), op.extras]
942
943
  end
943
944
 
@@ -226,9 +226,10 @@ module Squared
226
226
  serve_set kwargs[:serve]
227
227
  gemfile_set kwargs[:gemspec]
228
228
  self.autodetect = autodetect
229
- @bundle = { exec: exec.is_a?(String) ? basepath!(exec) : false }
229
+ @bundle = { exec: exec }
230
230
  @steepfile = basepath! steep if steep
231
- @rubocopfile = Pathname.new(rubocop).realpath rescue basepath!(Dir.home, '.rubocop.yml') if rubocop
231
+ rubocop = rootpath('.rubocop.yml', ascend: Dir.home) if rubocop == true
232
+ @rubocopfile = basepath! rubocop if rubocop
232
233
  @rubygems = kwargs.fetch(:rubygems, 0)
233
234
  return unless rakefile && @output[0].nil? && @copy.nil? && !version && !self.autodetect
234
235
 
@@ -1563,7 +1564,7 @@ module Squared
1563
1564
 
1564
1565
  def rdbg(*args, banner: verbose?, with: nil, pass: PASS_RUBY[:rdbg], **kwargs)
1565
1566
  opts = session_opts(with, args: args, kwargs: kwargs, pass: pass)
1566
- cmd = session 'rdbg'
1567
+ cmd = session(*bundle_args('rdbg'))
1567
1568
  args.each_with_index do |val, index|
1568
1569
  break if val == '--'
1569
1570
  next unless exist?(val, type: 'f')
@@ -1846,7 +1847,7 @@ module Squared
1846
1847
  end
1847
1848
 
1848
1849
  def ruby_session(*cmd, **kwargs)
1849
- session('ruby', *preopts, *cmd, **kwargs)
1850
+ session(*bundle_args('ruby'), *preopts, *cmd, **kwargs)
1850
1851
  end
1851
1852
 
1852
1853
  def gem_session(*cmd, **kwargs)
@@ -1864,11 +1865,10 @@ module Squared
1864
1865
  end
1865
1866
 
1866
1867
  def rbs_session(*cmd, opts: nil)
1867
- args = bundle_args 'rbs'
1868
- return session(*args, *cmd) unless opts
1868
+ return session(*bundle_args('rbs'), *cmd) unless opts
1869
1869
 
1870
1870
  op = OptionPartition.new(opts, OPT_RUBY[:rbs], project: self, strict: strict?)
1871
- [session(*args, *op.to_a, *cmd), op.extras]
1871
+ [session(*bundle_args('rbs'), *op.to_a, *cmd), op.extras]
1872
1872
  end
1873
1873
 
1874
1874
  def gem_output(*cmd, **kwargs)
@@ -1876,7 +1876,7 @@ module Squared
1876
1876
  end
1877
1877
 
1878
1878
  def ruby_output(*cmd, **kwargs)
1879
- session_output('ruby', *cmd, **kwargs)
1879
+ session_output(*bundle_args('ruby'), *cmd, **kwargs)
1880
1880
  end
1881
1881
 
1882
1882
  def bundle_output(*cmd, **kwargs)
@@ -1889,7 +1889,20 @@ module Squared
1889
1889
 
1890
1890
  def bundle_args(*args)
1891
1891
  if (val = @bundle[:exec])
1892
- args.unshift(quote_option('gemfile', val)) unless val == true
1892
+ app = args.first
1893
+ if val.is_a?(Hash)
1894
+ env = val[app.to_s] || val[app.to_sym]
1895
+ return args unless env
1896
+
1897
+ val = env.is_a?(String) ? basepath!(env) : true
1898
+ elsif app == 'ruby'
1899
+ return args
1900
+ end
1901
+ if val.is_a?(String)
1902
+ return args unless (val = basepath!(val))
1903
+
1904
+ args.unshift("--gemfile=#{shell_escape(val.relative_path_from(path), quote: true)}")
1905
+ end
1893
1906
  args.unshift('bundle', 'exec')
1894
1907
  end
1895
1908
  args
@@ -379,7 +379,7 @@ module Squared
379
379
  if has.call(e) || (has.call(bl) && %w[true false].include?(val))
380
380
  add shell_option(key, val, **kwargs)
381
381
  elsif has.call(q)
382
- kwargs[:double] = true if has.call(qq, key)
382
+ kwargs[:double] = true if has.call(qq)
383
383
  add quote_option(key, val, **kwargs)
384
384
  elsif has.call(p)
385
385
  if !double.nil?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squared
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.12
4
+ version: 0.7.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Pham
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubygems_version: 4.0.21
128
+ rubygems_version: 4.0.23
129
129
  specification_version: 4
130
130
  summary: Rake task generator for managing multi-language workspaces.
131
131
  test_files: []