squared 0.1.2 → 0.1.4
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 +19 -0
- data/README.ruby.md +6 -6
- data/lib/squared/common/format.rb +1 -1
- data/lib/squared/common/shell.rb +1 -1
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/project/base.rb +14 -14
- data/lib/squared/workspace/project/git.rb +10 -10
- data/lib/squared/workspace/project/node.rb +1 -1
- data/lib/squared/workspace/project/python.rb +37 -36
- data/lib/squared/workspace/project/ruby.rb +4 -4
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7942c4e6f2ca9177fbca4e9a5400982c4a6c5431c04e3f4ed2c80f8d47408cf8
|
4
|
+
data.tar.gz: 8bf51312a2ecbe75a54c1d584a336fb4729b89db9be305259a8fc076bc7b7488
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3156775e41dd2eaba6609631b37111d4d52f979ec7f14f456f0e05b3d43b481a0880fdf2552ba557d4e70594af541fec4564e990b701b11146c3dfd5f25ef92
|
7
|
+
data.tar.gz: 9b63ad8b38308c35557961061c5e89fd787bd0b7db094443464aa8f27e3eee661fc3031d297556e896f9cc9404df7a327e5b198ae6f81fe45b5f22b579bb7756
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.1.4] - 2024-02-05
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- Build options with array args were not recognized.
|
8
|
+
- Base clean command did not enumerate non-string values.
|
9
|
+
- Git command refs did not include ref option.
|
10
|
+
- Pip upgrade did not append package names.
|
11
|
+
|
12
|
+
## [0.1.3] - 2024-01-02
|
13
|
+
|
14
|
+
### Fixed
|
15
|
+
|
16
|
+
- Output lines from IO were missing theme styling.
|
17
|
+
- Node did not apply build options when stored as Array.
|
18
|
+
- Git commit push did not send origin and branch.
|
19
|
+
|
3
20
|
## [0.1.2] - 2024-12-23
|
4
21
|
|
5
22
|
### Added
|
@@ -71,6 +88,8 @@
|
|
71
88
|
|
72
89
|
- Changelog was created.
|
73
90
|
|
91
|
+
[0.1.4]: https://github.com/anpham6/squared/releases/tag/v0.1.4-ruby
|
92
|
+
[0.1.3]: https://github.com/anpham6/squared/releases/tag/v0.1.3-ruby
|
74
93
|
[0.1.2]: https://github.com/anpham6/squared/releases/tag/v0.1.2-ruby
|
75
94
|
[0.1.1]: https://github.com/anpham6/squared/releases/tag/v0.1.1-ruby
|
76
95
|
[0.1.0]: https://github.com/anpham6/squared/releases/tag/v0.1.0-ruby
|
data/README.ruby.md
CHANGED
@@ -255,16 +255,16 @@ Non-task:
|
|
255
255
|
# :env :run :opts
|
256
256
|
# LD_LIBRARY_PATH="path/to/lib" CFLAGS="-Wall" gcc a.c -o a.o -c
|
257
257
|
BUILD_${NAME} # gcc a.c -o a.o
|
258
|
-
|
259
|
-
|
258
|
+
BUILD_${NAME}_OPTS # -c
|
259
|
+
BUILD_${NAME}_ENV # {"LD_LIBRARY_PATH":"path/to/lib","CFLAGS":"-Wall"} (hash/json)
|
260
260
|
|
261
261
|
# :env :opts :script
|
262
262
|
# NODE_ENV="production" NO_COLOR="1" npm run --loglevel=error --workspaces=false build:dev
|
263
263
|
BUILD_${NAME} # build:dev
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
264
|
+
BUILD_${NAME}_OPTS # --loglevel=error --workspaces=false
|
265
|
+
BUILD_${NAME}_ENV # {"NODE_ENV":"production","NO_COLOR":"1"} (hash/json)
|
266
|
+
BUILD_${NAME}_DEV # pattern,0,1 (:dev)
|
267
|
+
BUILD_${NAME}_PROD # pattern,0,1 (:prod)
|
268
268
|
|
269
269
|
BUILD_${NAME}=0 # skip project
|
270
270
|
```
|
@@ -170,7 +170,7 @@ module Squared
|
|
170
170
|
args = args.map(&:to_s)
|
171
171
|
if args.size > 1
|
172
172
|
title = log_title(level, color: false)
|
173
|
-
sub = { pat:
|
173
|
+
sub = { pat: /^(#{title})(.+)$/, styles: __get__(:theme)[:logger][log_sym(level)] } if color
|
174
174
|
emphasize(args, title: title + (subject ? " #{subject}" : ''), sub: sub)
|
175
175
|
else
|
176
176
|
msg = [log_title(level, color: color)]
|
data/lib/squared/common/shell.rb
CHANGED
data/lib/squared/version.rb
CHANGED
@@ -343,7 +343,7 @@ module Squared
|
|
343
343
|
when String
|
344
344
|
cmd = "#{cmd} #{opts}"
|
345
345
|
when Array
|
346
|
-
cmd = cmd.join(' && ')
|
346
|
+
cmd = as_a(cmd).concat(opts).join(' && ')
|
347
347
|
else
|
348
348
|
cmd = [cmd, compose(opts, script: false)].compact.join(' ') unless opts == false || !respond_to?(:compose)
|
349
349
|
end
|
@@ -364,11 +364,11 @@ module Squared
|
|
364
364
|
end
|
365
365
|
|
366
366
|
def doc(*, sync: invoked_sync?('doc'), **)
|
367
|
-
build(@doc, sync: sync) if @doc
|
367
|
+
build(*as_a(@doc), sync: sync) if @doc
|
368
368
|
end
|
369
369
|
|
370
370
|
def test(*, sync: invoked_sync?('test'), **)
|
371
|
-
build(@test, sync: sync) if @test
|
371
|
+
build(*as_a(@test), sync: sync) if @test
|
372
372
|
end
|
373
373
|
|
374
374
|
def clean(*)
|
@@ -376,19 +376,19 @@ module Squared
|
|
376
376
|
when String
|
377
377
|
run_s(@clean, sync: invoked_sync?('clean'))
|
378
378
|
when Enumerable
|
379
|
-
as_a(@clean).each do |val|
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
log.warn "rm -rf #{dir}"
|
386
|
-
dir.rmtree
|
379
|
+
(@clean.is_a?(Hash) ? @clean.values : as_a(@clean)).each do |val|
|
380
|
+
val = val.to_s
|
381
|
+
path = basepath(val)
|
382
|
+
if path.directory? && val =~ %r{[\\/]$}
|
383
|
+
log.warn "rm -rf #{path}"
|
384
|
+
path.rmtree
|
387
385
|
else
|
388
|
-
files = val.include?('*') ? Dir[
|
386
|
+
files = val.include?('*') ? Dir[path] : [path]
|
389
387
|
files.each do |file|
|
388
|
+
next unless File.file?(file)
|
389
|
+
|
390
390
|
begin
|
391
|
-
File.delete(file)
|
391
|
+
File.delete(file)
|
392
392
|
rescue StandardError => e
|
393
393
|
log.error e
|
394
394
|
end
|
@@ -1032,7 +1032,7 @@ module Squared
|
|
1032
1032
|
end
|
1033
1033
|
|
1034
1034
|
def headerstyle
|
1035
|
-
{ pat:
|
1035
|
+
{ pat: /^(\S+)(\s+)$/, styles: theme[:header] }
|
1036
1036
|
end
|
1037
1037
|
|
1038
1038
|
def scriptargs
|
@@ -261,8 +261,8 @@ module Squared
|
|
261
261
|
append_pull opts, OPT_PULL, flag
|
262
262
|
sub = if verbose
|
263
263
|
[
|
264
|
-
{ pat:
|
265
|
-
{ pat:
|
264
|
+
{ pat: /^(.+)(\|\s+\d+\s+)([^-]*)(-+)(.*)$/, styles: :red, index: 4 },
|
265
|
+
{ pat: /^(.+)(\|\s+\d+\s+)(\++)(-*)(.*)$/, styles: :green, index: 3 }
|
266
266
|
]
|
267
267
|
end
|
268
268
|
source(sync: sync, sub: sub, **threadargs)
|
@@ -315,10 +315,10 @@ module Squared
|
|
315
315
|
end
|
316
316
|
ret = write_lines(out, banner: banner, sub: if verbose
|
317
317
|
[
|
318
|
-
{ pat:
|
319
|
-
{ pat:
|
320
|
-
{ pat:
|
321
|
-
{ pat:
|
318
|
+
{ pat: /^(.)([A-Z])(.+)$/, styles: :red, index: 2 },
|
319
|
+
{ pat: /^([A-Z])(.+)$/, styles: :green },
|
320
|
+
{ pat: /^(\?\?)(.+)$/, styles: :red },
|
321
|
+
{ pat: /^(## )(.+)(\.{3})(.+)$/,
|
322
322
|
styles: [nil, :green, nil, :red], index: -1 }
|
323
323
|
]
|
324
324
|
end)
|
@@ -402,7 +402,7 @@ module Squared
|
|
402
402
|
end
|
403
403
|
|
404
404
|
def refs(flag, grep: nil)
|
405
|
-
git_session 'ls-remote', "
|
405
|
+
git_session 'ls-remote', "--#{flag}", '--refs'
|
406
406
|
out, banner = source(io: true)
|
407
407
|
print_item banner
|
408
408
|
ret = write_lines(out, grep: grep)
|
@@ -410,7 +410,7 @@ module Squared
|
|
410
410
|
end
|
411
411
|
|
412
412
|
def files(flag, grep: nil)
|
413
|
-
git_session 'ls-files', "
|
413
|
+
git_session 'ls-files', "--#{flag}"
|
414
414
|
out, banner = source(io: true)
|
415
415
|
print_item banner
|
416
416
|
ret = write_lines(out, grep: grep)
|
@@ -514,7 +514,7 @@ module Squared
|
|
514
514
|
end
|
515
515
|
a << pathspec
|
516
516
|
b << '--force' if amend
|
517
|
-
b <<
|
517
|
+
b << origin << branch
|
518
518
|
puts if pass
|
519
519
|
source a.join(' ')
|
520
520
|
source cmd
|
@@ -624,7 +624,7 @@ module Squared
|
|
624
624
|
styles = theme.fetch(:banner, []).reject { |s| s.to_s.end_with?('!') }
|
625
625
|
styles << :bold if styles.size <= 1
|
626
626
|
puts print_footer("#{size} #{size == 1 ? type.sub(/s\z/, '') : type}",
|
627
|
-
sub: {
|
627
|
+
sub: { pat: /\A(\d+)(.+)\z/, styles: styles })
|
628
628
|
else
|
629
629
|
puts empty_status("No #{type} were #{action}", 'grep', grep)
|
630
630
|
end
|
@@ -4,7 +4,7 @@ module Squared
|
|
4
4
|
module Workspace
|
5
5
|
module Project
|
6
6
|
class Python < Git
|
7
|
-
REQUIREMENTS = %w[requirements.txt pyproject.toml
|
7
|
+
REQUIREMENTS = %w[requirements.txt pyproject.toml].freeze
|
8
8
|
OPT_USER = %w[pre dry-run].freeze
|
9
9
|
OPT_FORCE = (OPT_USER + ['user']).freeze
|
10
10
|
OPT_GENERAL = %w{venv isolated no-cache-dir [v]erbose}.freeze
|
@@ -29,7 +29,7 @@ module Squared
|
|
29
29
|
def config?(val)
|
30
30
|
return false unless (val = as_path(val))
|
31
31
|
|
32
|
-
REQUIREMENTS.any? { |file| val.join(file).exist? }
|
32
|
+
(REQUIREMENTS + ['setup.py']).any? { |file| val.join(file).exist? }
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -98,32 +98,30 @@ module Squared
|
|
98
98
|
if @depend && !flag
|
99
99
|
super
|
100
100
|
elsif outdated?
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
cmd << (type == 1 ? '-r requirements.txt' : '.')
|
123
|
-
run(sync: sync)
|
124
|
-
when 3
|
125
|
-
run_s("#{@bin} setup.py install", sync: sync)
|
101
|
+
cmd = pip_session 'install'
|
102
|
+
case flag
|
103
|
+
when :user
|
104
|
+
cmd << '--user'
|
105
|
+
append_pip opts, OPT_USER
|
106
|
+
when :target
|
107
|
+
cmd << shell_option('target', basepath(dir), quote: true)
|
108
|
+
append_pip opts, OPT_USER + ['upgrade']
|
109
|
+
append_eager opts
|
110
|
+
when :upgrade
|
111
|
+
cmd << '--upgrade'
|
112
|
+
extra = []
|
113
|
+
append_pip(opts, OPT_FORCE, extra: extra)
|
114
|
+
append_eager opts
|
115
|
+
extra.delete('eager')
|
116
|
+
append_value(extra, delim: true)
|
117
|
+
when :force
|
118
|
+
cmd << '--force-reinstall'
|
119
|
+
append_pip opts, OPT_FORCE
|
120
|
+
else
|
121
|
+
append_pip
|
126
122
|
end
|
123
|
+
cmd << (dependtype == 1 ? '-r requirements.txt' : '.') unless flag == :upgrade
|
124
|
+
run(sync: sync)
|
127
125
|
end
|
128
126
|
end
|
129
127
|
|
@@ -162,16 +160,19 @@ module Squared
|
|
162
160
|
session('pip', *cmd)
|
163
161
|
end
|
164
162
|
|
165
|
-
def append_pip(opts = [], list = [])
|
163
|
+
def append_pip(opts = [], list = [], extra: nil)
|
166
164
|
opts.each do |opt|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
165
|
+
data = nil
|
166
|
+
if list.include?(opt) || OPT_GENERAL.include?(opt) || (data = opt.match(/^verbose|(v+)$/))
|
167
|
+
@session << case opt
|
168
|
+
when 'venv'
|
169
|
+
'--require-virtualenv'
|
170
|
+
else
|
171
|
+
(data && data[1] ? "-#{data[1]}" : "--#{opt}")
|
172
|
+
end
|
173
|
+
elsif extra
|
174
|
+
extra << opt
|
175
|
+
end
|
175
176
|
end
|
176
177
|
val = nil
|
177
178
|
@session << shell_option('proxy', val, quote: true) if (val = option('proxy'))
|
@@ -7,9 +7,9 @@ module Squared
|
|
7
7
|
VAR_SET = %i[version autodetect].freeze
|
8
8
|
GEMFILE = %w[Gemfile Gemfile.lock gem.deps.rb Isolate].freeze
|
9
9
|
RUBY_DIR = (GEMFILE + Rake::Application::DEFAULT_RAKEFILES + ['README.rdoc']).freeze
|
10
|
-
OPT_INSTALL = %w[no-cache
|
11
|
-
OPT_UPDATE = %w[redownload local strict
|
12
|
-
OPT_OUTDATED = %w[
|
10
|
+
OPT_INSTALL = %w[system frozen no-cache no-prune].freeze
|
11
|
+
OPT_UPDATE = %w[all redownload conservative local strict group=s].freeze
|
12
|
+
OPT_OUTDATED = %w[pre only-explicit local strict group=s].freeze
|
13
13
|
private_constant :VAR_SET, :GEMFILE, :RUBY_DIR, :OPT_INSTALL, :OPT_UPDATE, :OPT_OUTDATED
|
14
14
|
|
15
15
|
class << self
|
@@ -178,7 +178,7 @@ module Squared
|
|
178
178
|
gem_session 'install'
|
179
179
|
append_value opts
|
180
180
|
when :with, :without
|
181
|
-
|
181
|
+
bundle_session 'install'
|
182
182
|
append_repeat flag, opts
|
183
183
|
when :redownload, :local, :'prefer-local'
|
184
184
|
cmd = bundle_session 'install', "--#{flag}"
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- An Pham
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-05 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rake
|
@@ -93,7 +92,6 @@ metadata:
|
|
93
92
|
homepage_uri: https://github.com/anpham6/squared
|
94
93
|
source_code_uri: https://github.com/anpham6/squared
|
95
94
|
documentation_uri: https://squared.readthedocs.io
|
96
|
-
post_install_message:
|
97
95
|
rdoc_options: []
|
98
96
|
require_paths:
|
99
97
|
- lib
|
@@ -108,8 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
106
|
- !ruby/object:Gem::Version
|
109
107
|
version: '0'
|
110
108
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
112
|
-
signing_key:
|
109
|
+
rubygems_version: 3.6.3
|
113
110
|
specification_version: 4
|
114
111
|
summary: Rake task generator for managing multi-language workspaces.
|
115
112
|
test_files: []
|