squared 0.6.9 → 0.7.1
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 +89 -2
- data/README.md +245 -203
- data/lib/squared/common/format.rb +7 -10
- data/lib/squared/common/prompt.rb +23 -24
- data/lib/squared/common/shell.rb +16 -17
- data/lib/squared/common/system.rb +29 -20
- data/lib/squared/common/utils.rb +43 -54
- data/lib/squared/config.rb +17 -16
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +290 -175
- data/lib/squared/workspace/project/base.rb +566 -446
- data/lib/squared/workspace/project/docker.rb +151 -131
- data/lib/squared/workspace/project/git.rb +205 -151
- data/lib/squared/workspace/project/node.rb +90 -88
- data/lib/squared/workspace/project/python.rb +236 -139
- data/lib/squared/workspace/project/ruby.rb +395 -281
- data/lib/squared/workspace/project/support/class.rb +12 -6
- data/lib/squared/workspace/project/support/optionpartition.rb +58 -41
- data/lib/squared/workspace/project/support/utils.rb +68 -0
- data/lib/squared/workspace/project.rb +0 -7
- data/lib/squared/workspace/repo.rb +234 -169
- data/lib/squared/workspace/series.rb +91 -86
- data/lib/squared/workspace/support/base.rb +15 -1
- metadata +2 -1
data/README.md
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
# squared 0.
|
|
1
|
+
# squared 0.7
|
|
2
2
|
|
|
3
3
|
* [source](https://github.com/anpham6/squared-ruby)
|
|
4
4
|
* [docs](https://squared.readthedocs.io)
|
|
5
5
|
|
|
6
6
|
## Version Compatibility
|
|
7
7
|
|
|
8
|
-
| Date | squared | Min |
|
|
9
|
-
| :--------: | ------: | -----: | -----: |
|
|
10
|
-
| 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 |
|
|
11
|
-
| 2025-01-07 | 0.2.0 | | 3.4.0 |
|
|
12
|
-
| 2025-02-07 | 0.3.0 | | 3.4.1 |
|
|
13
|
-
| 2025-03-06 | 0.4.0 | | 3.4.2 |
|
|
14
|
-
| 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.3 |
|
|
15
|
-
| ---------- | ----- | ----- | ----- |
|
|
16
|
-
| 2025-08-23 | 0.5.5 | | 3.4.5 |
|
|
17
|
-
| 2025-10-31 | 0.6.0 | | 3.4.7 |
|
|
8
|
+
| Date | squared | Min | Latest | LTS |
|
|
9
|
+
| :--------: | ------: | -----: | -----: | --: |
|
|
10
|
+
| 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 | |
|
|
11
|
+
| 2025-01-07 | 0.2.0 | | 3.4.0 | |
|
|
12
|
+
| 2025-02-07 | 0.3.0 | | 3.4.1 | |
|
|
13
|
+
| 2025-03-06 | 0.4.0 | | 3.4.2 | * |
|
|
14
|
+
| 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.3 | * |
|
|
15
|
+
| ---------- | ----- | ----- | ----- | --- |
|
|
16
|
+
| 2025-08-23 | 0.5.5 | | 3.4.5 | |
|
|
17
|
+
| 2025-10-31 | 0.6.0 | | 3.4.7 | * |
|
|
18
|
+
| 2026-01-07 | 0.7.0 | 2.5.0 | 4.0.0 | * |
|
|
18
19
|
|
|
19
|
-
The range chart indicates the latest Ruby tested against at the time of release.
|
|
20
|
+
The range chart indicates the *latest* Ruby tested against at the time of release.
|
|
20
21
|
|
|
21
22
|
## Installation
|
|
22
23
|
|
|
@@ -32,13 +33,12 @@ Projects from any accessible folder can be added relative to the parent director
|
|
|
32
33
|
require "squared"
|
|
33
34
|
|
|
34
35
|
require "squared/workspace"
|
|
35
|
-
require "squared/workspace/
|
|
36
|
-
require "squared/workspace/project/
|
|
37
|
-
require "squared/workspace/project/
|
|
38
|
-
require "squared/workspace/project/
|
|
39
|
-
require "squared/workspace/project/docker" #
|
|
36
|
+
require "squared/workspace/project/node" # Optional (when using ref: :node)
|
|
37
|
+
require "squared/workspace/project/python" #
|
|
38
|
+
require "squared/workspace/project/ruby" #
|
|
39
|
+
require "squared/workspace/project/docker" #
|
|
40
40
|
# OR
|
|
41
|
-
require "squared/app"
|
|
41
|
+
require "squared/app" # All workspace related modules
|
|
42
42
|
|
|
43
43
|
# NODE_ENV = production
|
|
44
44
|
|
|
@@ -54,11 +54,11 @@ require "squared/app" # All workspace related mod
|
|
|
54
54
|
# sqd = /workspaces/squared/sqd
|
|
55
55
|
|
|
56
56
|
# Load external Project classes (optional)
|
|
57
|
-
Workspace::Application.load_ref(
|
|
58
|
-
Workspace::Application.load_ref(
|
|
57
|
+
Workspace::Application.load_ref("/home/user/.gem/ruby/4.0.0/gems/squared-0.7.0/lib/squared/workspace/project") # ref = :node => node.rb (absolute)
|
|
58
|
+
Workspace::Application.load_ref("lib/squared/workspace/project", gem: "squared") # bundle env (relative)
|
|
59
59
|
|
|
60
60
|
Workspace::Application
|
|
61
|
-
.new(Dir.pwd, main: "squared") # Dir.pwd? (main? is implicitly basename)
|
|
61
|
+
.new(Dir.pwd, main: "squared", exception: Logger::ERROR) # Dir.pwd? (main? is implicitly basename) | treat warnings as errors
|
|
62
62
|
.banner("group", "project", styles: ["yellow", "black"], border: "bold") # name | project | path | ref | group? | parent? | version?
|
|
63
63
|
.run("rake install", ref: :ruby)
|
|
64
64
|
.depend(false, group: "default")
|
|
@@ -69,8 +69,8 @@ Workspace::Application
|
|
|
69
69
|
"CFLAGS" => "-fPIC -O1"
|
|
70
70
|
})
|
|
71
71
|
.add("optparse", doc: "rake rdoc", gemspec: "optparse.gemspec", group: "default") # Uses bundler/gem_tasks (without C extensions)
|
|
72
|
-
.add("logger", copy: { from: "lib", glob: "**/*.rb", into: "/home/user/.local/gem/ruby/
|
|
73
|
-
self.gemdir = "/home/user/.local/gem/ruby/
|
|
72
|
+
.add("logger", copy: { from: "lib", glob: "**/*.rb", into: "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0" }, clean: ["tmp/"]) do # autodetect: true | "rvm" | "rbenv" | "asdf" | "bundler"
|
|
73
|
+
self.gemdir = "/home/user/.local/gem/ruby/4.0.0/gems/logger-1.7.0" # Default for "into"
|
|
74
74
|
end
|
|
75
75
|
.add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node) # Node
|
|
76
76
|
.add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
|
|
@@ -96,8 +96,8 @@ Workspace::Application
|
|
|
96
96
|
apply :depend, false #
|
|
97
97
|
apply :clean, ["build/sqd/"] # variable_set (alias)
|
|
98
98
|
end
|
|
99
|
-
.with(:docker, only: ["build", "compose"]) do
|
|
100
|
-
.add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared",
|
|
99
|
+
.with(:docker, only: ["build", "compose"], hide: [:windows?]) do # When true hide entire group (formerly pass 0.6.0)
|
|
100
|
+
.add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared", # compose publish => { oci: "oci://docker.io" }
|
|
101
101
|
args: "--ssh=default",
|
|
102
102
|
secrets: ["id=github,env=GITHUB_TOKEN"],
|
|
103
103
|
mounts: ["src=.,dst=/project,ro,bind-propagation=rshared"]) do # Docker
|
|
@@ -143,7 +143,7 @@ Python.options(:build, "build:dev", opts: ["no-deps"]) # inherits
|
|
|
143
143
|
|
|
144
144
|
Workspace::Application
|
|
145
145
|
.new(ENV["SQUARED_HOME"], prefix: "rb", common: false) # Local styles
|
|
146
|
-
.group("ruby", "default", run: "rake build", copy: "rake install", clean: "rake clean", ref: :ruby, override: {
|
|
146
|
+
.group("ruby", "default", run: "rake build", copy: "rake install", clean: "rake clean", rubygems: 3, ref: :ruby, override: { # legacy: gem 3.6 | bundler 2.7 => ["3", "2.7"]
|
|
147
147
|
pathname: {
|
|
148
148
|
run: "rake compile" # rake rb:pathname:build
|
|
149
149
|
}
|
|
@@ -168,19 +168,20 @@ Workspace::Application
|
|
|
168
168
|
bundle("exec", "-A --cache=true", with: "lint", verbose: true) # bundle exec --gemfile="/squared/Gemfile" rubocop --parallel -A --cache=true
|
|
169
169
|
}
|
|
170
170
|
end
|
|
171
|
-
.with(:python, editable: false) do
|
|
172
|
-
banner([:name, ": ", :version], "path")
|
|
173
|
-
doc("make html")
|
|
174
|
-
run(false)
|
|
175
|
-
exclude(%i[base git])
|
|
176
|
-
add("android-docs", "android")
|
|
177
|
-
add("chrome-docs", "chrome") do
|
|
171
|
+
.with(:python, editable: false) do # ref=Symbol | group=String
|
|
172
|
+
banner([:name, ": ", :version], "path") # chrome-docs: 0.1.0 | /workspaces/chrome-docs
|
|
173
|
+
doc("make html") # rake rb:doc:python
|
|
174
|
+
run(false) # rake rb:build:python (disabled)
|
|
175
|
+
exclude(%i[base git]) # Project::Git.ref (superclass)
|
|
176
|
+
add("android-docs", "android", venv: [".venv", "virtualenv", "--clean"]) # directory,virtualenv?,options (python -m virtualenv) | virtualenv.ini
|
|
177
|
+
add("chrome-docs", "chrome", venv: ".venv") do # rake rb:chrome:doc (python -m venv)
|
|
178
178
|
apply :run, proc {
|
|
179
|
-
pip("wheel", with: "build:dev")
|
|
179
|
+
pip("wheel", with: "build:dev") # pip wheel -r "/chrome-docs/requirements.txt" --no-deps
|
|
180
180
|
}
|
|
181
181
|
end
|
|
182
182
|
end
|
|
183
183
|
.style("inline", "bold")
|
|
184
|
+
.stage("init:project") { puts self.path } # modify attributes before building tasks (init | begin | project:begin/end | populate | extensions | series | finalize | end)
|
|
184
185
|
.build
|
|
185
186
|
```
|
|
186
187
|
|
|
@@ -189,10 +190,10 @@ Workspace::Application
|
|
|
189
190
|
### Archive
|
|
190
191
|
|
|
191
192
|
```ruby
|
|
192
|
-
# HEADERS={"Authorization":"Bearer RANDOM-TOKEN"} | hash/json
|
|
193
|
-
# ZIP_DEPTH=0
|
|
194
|
-
# TAR_DEPTH=0
|
|
195
|
-
# UNPACK_FORCE=1
|
|
193
|
+
# HEADERS='{"Authorization":"Bearer RANDOM-TOKEN"}' | hash/json
|
|
194
|
+
# ZIP_DEPTH=0 | default=1
|
|
195
|
+
# TAR_DEPTH=0 | TAR_DEPTH_SQUARED
|
|
196
|
+
# UNPACK_FORCE=1 | Remove target directory
|
|
196
197
|
|
|
197
198
|
Workspace::Application
|
|
198
199
|
.new(main: "squared")
|
|
@@ -245,12 +246,15 @@ Workspace::Application
|
|
|
245
246
|
}
|
|
246
247
|
)
|
|
247
248
|
.with(:node) do # rake clone:node
|
|
248
|
-
add("e-mc", "emc")
|
|
249
|
+
add("e-mc", "emc") do # https://github.com/anpham6/e-mc
|
|
250
|
+
revbuild(before: %w[status squared:status], # emc:status + squared:status (always)
|
|
251
|
+
after: "refresh") # emc:refresh (changed)
|
|
252
|
+
end #
|
|
249
253
|
add("pi-r", "pir") # https://github.com/anpham6/pi-r
|
|
250
254
|
add("squared") # https://github.com/anpham6/squared
|
|
251
255
|
end
|
|
252
256
|
.with(:python) do # rake clone:python
|
|
253
|
-
add("android-docs")
|
|
257
|
+
add("android-docs") { revbuild(pass: false) } # Do not update status on a failed run
|
|
254
258
|
add("chrome-docs") do
|
|
255
259
|
revbuild(include: "source/", exclude: ["source/conf.py"]) # Limit files being watched
|
|
256
260
|
end
|
|
@@ -360,8 +364,9 @@ Workspace::Application
|
|
|
360
364
|
add("squared", graph: ["chrome", "express"]) do
|
|
361
365
|
first("git:ls-files") { puts "1" } # skipped
|
|
362
366
|
first("git:ls-files", override: true) { puts "2" } # puts "2"
|
|
363
|
-
last("git:ls-files") { puts workspace.root } # puts "/workspaces"
|
|
364
|
-
|
|
367
|
+
last("git:ls-files") { puts workspace.root } # puts "/workspaces" (does not run when error is raised)
|
|
368
|
+
error("git:ls-files") { |err| err.is_a?(TypeError) } # return true to suppress error
|
|
369
|
+
end
|
|
365
370
|
end
|
|
366
371
|
.with(:ruby) do
|
|
367
372
|
run("gem build") # gem build
|
|
@@ -374,10 +379,10 @@ Workspace::Application
|
|
|
374
379
|
p "1"
|
|
375
380
|
end
|
|
376
381
|
# OR
|
|
377
|
-
run(["gem build", "--force", { "RUBY_VERSION" => "
|
|
382
|
+
run(["gem build", "--force", { "RUBY_VERSION" => "4.0.0" }]) # RUBY_VERSION="4.0.0" gem build --force
|
|
378
383
|
# OR
|
|
379
384
|
run({ #
|
|
380
|
-
command: "gem build", # RUBY_VERSION="
|
|
385
|
+
command: "gem build", # RUBY_VERSION="4.0.0" gem build --silent --force
|
|
381
386
|
opts: "--force", # composable
|
|
382
387
|
env: { "PATH" => "~/.bin" }, #
|
|
383
388
|
args: { silent: true } #
|
|
@@ -387,9 +392,9 @@ Workspace::Application
|
|
|
387
392
|
#
|
|
388
393
|
# All commands are either Array or Hash
|
|
389
394
|
#
|
|
390
|
-
run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-
|
|
395
|
+
run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-4.0.0" (merged)
|
|
391
396
|
["gem pristine", "--all", { "PATH" => "~/.bin" }, "--silent"], # gem pristine --silent --all
|
|
392
|
-
["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-
|
|
397
|
+
["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-4.0.0" }] # gem build --strict
|
|
393
398
|
]) #
|
|
394
399
|
# OR
|
|
395
400
|
run([ # Same
|
|
@@ -399,7 +404,7 @@ Workspace::Application
|
|
|
399
404
|
opts: "--all", args: "--silent" #
|
|
400
405
|
}, #
|
|
401
406
|
{ #
|
|
402
|
-
env: { "GEM_HOME" => "~/.gems/ruby-
|
|
407
|
+
env: { "GEM_HOME" => "~/.gems/ruby-4.0.0" }, #
|
|
403
408
|
command: "gem build", #
|
|
404
409
|
opts: { strict: true } #
|
|
405
410
|
} #
|
|
@@ -415,15 +420,15 @@ Workspace::Application
|
|
|
415
420
|
```
|
|
416
421
|
|
|
417
422
|
```sh
|
|
418
|
-
rake pir:graph
|
|
419
|
-
rake express:graph
|
|
420
|
-
rake chrome:graph
|
|
421
|
-
rake graph:python
|
|
422
|
-
rake squared:graph
|
|
423
|
-
rake graph:node
|
|
424
|
-
rake rake:graph
|
|
425
|
-
rake graph:ruby
|
|
426
|
-
rake graph
|
|
423
|
+
rake pir:graph # emc + pir
|
|
424
|
+
rake express:graph # emc + pir + express
|
|
425
|
+
rake chrome:graph # android + chrome
|
|
426
|
+
rake graph:python # same
|
|
427
|
+
rake squared:graph # android + chrome + emc + pir + express + squared
|
|
428
|
+
rake graph:node # same
|
|
429
|
+
rake rake:graph # pathname + fileutils + optparse + rake
|
|
430
|
+
rake graph:ruby # same
|
|
431
|
+
rake graph # graph:node + graph:ruby
|
|
427
432
|
|
|
428
433
|
rake squared:graph:run[express,pir] # emc + pir + express + squared
|
|
429
434
|
rake squared:graph:run[node,-emc] # pir + express + squared
|
|
@@ -432,41 +437,51 @@ rake squared:graph:run[node,-emc] # pir + express + squared
|
|
|
432
437
|
### Tasks
|
|
433
438
|
|
|
434
439
|
```ruby
|
|
435
|
-
Workspace::
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
440
|
+
Workspace::Application
|
|
441
|
+
.new(prefix: "rb")
|
|
442
|
+
.batch(:ruby, :node, {
|
|
443
|
+
stage: [%i[graph test], true], # stage? (optional)
|
|
444
|
+
reset: %i[stash pull] # reset? (required)
|
|
445
|
+
})
|
|
446
|
+
.rename("depend", "install")
|
|
447
|
+
.add("squared", timeout: { ruby: 10 }, ref: :ruby) do # Overrides ruby=5,8
|
|
448
|
+
scope("nested:version") { puts self.version } # rake rb:squared:nested:version
|
|
449
|
+
end
|
|
450
|
+
.add("chrome-docs", timeout: 30, ref: :python) # Does not override ruby/python
|
|
451
|
+
.timeout({ ruby: 5, python: 5 }) # global (seconds/fraction)
|
|
452
|
+
.timeout({ ruby: 8, gem: 5, gem_update: 20, bundle_install: 30 }, ref: :ruby) # Overrides global (group | ref)
|
|
453
|
+
.build
|
|
441
454
|
```
|
|
442
455
|
|
|
456
|
+
Some global tasks and local git commands do not support using process shell timeout.
|
|
457
|
+
|
|
443
458
|
## Usage
|
|
444
459
|
|
|
445
460
|
```sh
|
|
446
|
-
rake -T
|
|
447
|
-
rake
|
|
461
|
+
rake -T # List tasks
|
|
462
|
+
rake # rake status (usually "build")
|
|
448
463
|
|
|
449
464
|
# GIT_OPTIONS=rebase
|
|
450
|
-
rake pull
|
|
451
|
-
rake pull:ruby
|
|
452
|
-
rake pull:default
|
|
453
|
-
rake pull:app
|
|
454
|
-
rake pull:node
|
|
455
|
-
|
|
456
|
-
rake build
|
|
457
|
-
rake doc
|
|
458
|
-
rake depend
|
|
459
|
-
|
|
460
|
-
rake build:ruby
|
|
461
|
-
|
|
462
|
-
rake clean
|
|
463
|
-
rake clean:ruby
|
|
464
|
-
rake clean:default
|
|
465
|
-
rake clean:app
|
|
466
|
-
rake clean:node
|
|
467
|
-
|
|
468
|
-
rake squared:run[#]
|
|
469
|
-
rake squared:rake[#]
|
|
465
|
+
rake pull # All except "default" + "app"
|
|
466
|
+
rake pull:ruby # pathname + optparse + logger
|
|
467
|
+
rake pull:default # pathname + optparse
|
|
468
|
+
rake pull:app # squared
|
|
469
|
+
rake pull:node # emc + pir + squared
|
|
470
|
+
|
|
471
|
+
rake build # All except "android"
|
|
472
|
+
rake doc # optparse + android
|
|
473
|
+
rake depend # All except "default"
|
|
474
|
+
|
|
475
|
+
rake build:ruby # rake compile + rake install + rake install
|
|
476
|
+
|
|
477
|
+
rake clean # All except "default" + "app"
|
|
478
|
+
rake clean:ruby # rake clean + rake clean + ["tmp/"]
|
|
479
|
+
rake clean:default # rake clean + rake clean + skip
|
|
480
|
+
rake clean:app # none + skip + ["build/"]
|
|
481
|
+
rake clean:node # none + ["publish/**/*.js", "tmp/"] + ["build/"]
|
|
482
|
+
|
|
483
|
+
rake squared:run[#] # List scripts (node)
|
|
484
|
+
rake squared:rake[#] # List tasks (ruby)
|
|
470
485
|
```
|
|
471
486
|
|
|
472
487
|
```sh
|
|
@@ -519,37 +534,37 @@ Non-task:
|
|
|
519
534
|
|
|
520
535
|
Most project classes will inherit from `Git` which enables these tasks:
|
|
521
536
|
|
|
522
|
-
| Task
|
|
523
|
-
|
|
|
524
|
-
| branch
|
|
525
|
-
| checkout
|
|
526
|
-
| commit
|
|
527
|
-
| diff
|
|
528
|
-
| fetch
|
|
529
|
-
| files
|
|
530
|
-
| git
|
|
531
|
-
| log
|
|
532
|
-
| merge
|
|
533
|
-
| pull
|
|
534
|
-
| rebase
|
|
535
|
-
| refs
|
|
536
|
-
| reset
|
|
537
|
-
| restore
|
|
538
|
-
| rev
|
|
539
|
-
|
|
|
540
|
-
|
|
|
541
|
-
|
|
|
542
|
-
|
|
|
543
|
-
|
|
|
537
|
+
| Task | Git | Command |
|
|
538
|
+
| :-------------- | :--------------- | :-------------------------------------------------------- |
|
|
539
|
+
| branch | branch | create track delete move copy list current |
|
|
540
|
+
| checkout | checkout | commit branch track detach path |
|
|
541
|
+
| commit | commit | add all amend amend-orig fixup |
|
|
542
|
+
| diff | diff | head branch files view between contain |
|
|
543
|
+
| fetch | fetch | origin remote all |
|
|
544
|
+
| files | ls-files | cached modified deleted others |
|
|
545
|
+
| git | | add blame clean grep mv revert rm sparse-checkout status |
|
|
546
|
+
| log | log | view between contain |
|
|
547
|
+
| merge | merge | commit no-commit send |
|
|
548
|
+
| pull | pull | origin remote all |
|
|
549
|
+
| rebase | rebase | branch onto send |
|
|
550
|
+
| refs | ls-remote --refs | heads tags remote |
|
|
551
|
+
| reset | reset | commit index patch mode undo |
|
|
552
|
+
| restore | restore | source staged worktree |
|
|
553
|
+
| rev | rev | commit branch build output |
|
|
554
|
+
| sparse-checkout | sparse-checkout | add reapply list clean disable |
|
|
555
|
+
| show | show | format oneline textconv |
|
|
556
|
+
| stash | stash | push pop apply branch drop clear list all staged worktree |
|
|
557
|
+
| submodule | submodule | status update branch url sync |
|
|
558
|
+
| switch | switch | branch create detach |
|
|
559
|
+
| tag | tag | add sign delete list |
|
|
544
560
|
|
|
545
561
|
You can disable all of them at once using the `exclude` property.
|
|
546
562
|
|
|
547
563
|
```ruby
|
|
548
|
-
Workspace::Application.exclude('autostash', 'rebase')
|
|
549
|
-
|
|
550
564
|
Workspace::Application
|
|
551
565
|
.new
|
|
552
566
|
.add("squared", exclude: :git)
|
|
567
|
+
.build(exclude: ["autostash", "rebase"])
|
|
553
568
|
```
|
|
554
569
|
|
|
555
570
|
You can disable one or more of them using the `pass` property as a *string*.
|
|
@@ -578,14 +593,14 @@ All project binary programs can have their executable path set to a non-global a
|
|
|
578
593
|
|
|
579
594
|
```ruby
|
|
580
595
|
Common::PATH.update({
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
596
|
+
git: "/usr/bin/git", # PATH_GIT=/usr/bin/git
|
|
597
|
+
tar: "/opt/archivers/tar", # PATH_TAR=/opt/archivers/tar
|
|
598
|
+
unzip: "/opt/archivers/unzip",
|
|
599
|
+
gem: "~/.rvm/gems/ruby-4.0.0/bin/gem",
|
|
600
|
+
bundle: "~/.rvm/gems/ruby-4.0.0/bin/bundle",
|
|
601
|
+
rake: "~/.rvm/gems/ruby-4.0.0/bin/rake",
|
|
602
|
+
npm: "/opt/node/v22.0.0/bin/npm",
|
|
603
|
+
python: "#{ENV["PYTHONPATH"]}/bin/python"
|
|
589
604
|
})
|
|
590
605
|
```
|
|
591
606
|
|
|
@@ -658,57 +673,57 @@ LOG_LEVEL # See gem "logger"
|
|
|
658
673
|
* Version: [2.51](https://github.com/git/git/blob/v2.51.0/Documentation/RelNotes/2.51.0.adoc)
|
|
659
674
|
|
|
660
675
|
```sh
|
|
661
|
-
GIT_OPTIONS=q,strategy=ort
|
|
662
|
-
GIT_OPTIONS_${NAME}=v,ff
|
|
663
|
-
GIT_AUTOSTASH=1
|
|
664
|
-
GIT_AUTOSTASH_${NAME}=0
|
|
676
|
+
GIT_OPTIONS=q,strategy=ort # all
|
|
677
|
+
GIT_OPTIONS_${NAME}=v,ff # project only
|
|
678
|
+
GIT_AUTOSTASH=1 # rebase (all)
|
|
679
|
+
GIT_AUTOSTASH_${NAME}=0 # rebase (project only)
|
|
665
680
|
```
|
|
666
681
|
|
|
667
|
-
| Command | Flag | ENV
|
|
668
|
-
| :--------- | :---------------- |
|
|
669
|
-
| branch | create | TRACK=0,1,s F|FORCE
|
|
670
|
-
| branch | move copy | F|FORCE
|
|
671
|
-
| branch | delete | COUNT=n
|
|
672
|
-
| branch | global | SYNC
|
|
673
|
-
| checkout | branch | DETACH TRACK=s COUNT=n
|
|
674
|
-
| checkout | detach | REFLOG=1
|
|
675
|
-
| checkout | track | COUNT=n
|
|
676
|
-
| checkout | global path | HEAD=s PATHSPEC=s
|
|
677
|
-
| checkout | * | F|FORCE MERGE
|
|
678
|
-
| clone | * | DEPTH=n ORIGIN=s BRANCH=s REVISION=s BARE=1 LOCAL=0,1
|
|
679
|
-
| | | SINGLE_BRANCH=0,1 NO_CHECKOUT=1 NO_TAGS=1 QUIET=1
|
|
680
|
-
| commit | * | UPSTREAM=s DRY_RUN EDIT=0 M|MESSAGE=s
|
|
681
|
-
| diff | -between -contain | MERGE_BASE
|
|
682
|
-
| diff | head branch | INDEX=n
|
|
683
|
-
| diff | * | PATHSPEC=s
|
|
684
|
-
| fetch | -remote | ALL
|
|
685
|
-
| fetch | remote | REFSPEC=s
|
|
686
|
-
| fetch | * | F|FORCE RECURSE_SUBMODULES=0,1,s
|
|
687
|
-
| git | rm | PATHSPEC=s
|
|
688
|
-
| log | * | PATHSPEC=s
|
|
689
|
-
| pull | remote | REFSPEC=s
|
|
690
|
-
| pull | -remote | REBASE=0,1 ALL
|
|
691
|
-
| pull | all | FF_ONLY=0
|
|
692
|
-
| pull | * | AUTOSTASH F|FORCE RECURSE_SUBMODULES=0,1,s
|
|
693
|
-
| rebase | branch | HEAD=s
|
|
694
|
-
| rebase | onto | INTERACTIVE I HEAD=s
|
|
695
|
-
| reset | mode (mixed) | N REFRESH=0
|
|
696
|
-
| reset | index | PATHSPEC=s
|
|
697
|
-
| reset | commit | COUNT=n REFLOG=1
|
|
698
|
-
| reset | -commit | HEAD=s
|
|
699
|
-
| restore | * | PATHSPEC=s
|
|
700
|
-
| revbuild | global | UNTRACKED_FILES=s IGNORE_SUBMODULES=s IGNORED=s (status)
|
|
701
|
-
| stash | push | PATHSPEC=s
|
|
702
|
-
| stash | global | ALL=0,1 KEEP_INDEX=0,1 INCLUDE_UNTRACKED=0,1 STAGED=0,1 M|MESSAGE=s
|
|
703
|
-
| status | global | BRANCH LONG IGNORE_SUBMODULES=s,0-3 PATHSPEC=s
|
|
704
|
-
| submodule | -branch -url | R|RECURSIVE
|
|
705
|
-
| switch | detach | REFLOG=1
|
|
706
|
-
| switch | -detach | HEAD=s
|
|
707
|
-
| switch | * | F|FORCE
|
|
708
|
-
| tag | add | SIGN FORCE HEAD=s M|MESSAGE=s
|
|
709
|
-
| tag | sign | F|FORCE HEAD=s M|MESSAGE=s
|
|
710
|
-
| tag | delete | COUNT=n
|
|
711
|
-
| rev | commit branch | HEAD=s
|
|
682
|
+
| Command | Flag | ENV |
|
|
683
|
+
| :--------- | :---------------- | :------------------------------------------------------------------ |
|
|
684
|
+
| branch | create | TRACK=0,1,s F|FORCE |
|
|
685
|
+
| branch | move copy | F|FORCE |
|
|
686
|
+
| branch | delete | COUNT=n |
|
|
687
|
+
| branch | global | SYNC |
|
|
688
|
+
| checkout | branch | DETACH TRACK=s COUNT=n |
|
|
689
|
+
| checkout | detach | REFLOG=1 |
|
|
690
|
+
| checkout | track | COUNT=n |
|
|
691
|
+
| checkout | global path | HEAD=s PATHSPEC=s |
|
|
692
|
+
| checkout | * | F|FORCE MERGE |
|
|
693
|
+
| clone | * | DEPTH=n ORIGIN=s BRANCH=s REVISION=s BARE=1 LOCAL=0,1 |
|
|
694
|
+
| | | SINGLE_BRANCH=0,1 NO_CHECKOUT=1 NO_TAGS=1 QUIET=1 |
|
|
695
|
+
| commit | * | UPSTREAM=s DRY_RUN EDIT=0 M|MESSAGE=s |
|
|
696
|
+
| diff | -between -contain | MERGE_BASE |
|
|
697
|
+
| diff | head branch | INDEX=n |
|
|
698
|
+
| diff | * | PATHSPEC=s |
|
|
699
|
+
| fetch | -remote | ALL |
|
|
700
|
+
| fetch | remote | REFSPEC=s |
|
|
701
|
+
| fetch | * | F|FORCE RECURSE_SUBMODULES=0,1,s |
|
|
702
|
+
| git | rm | PATHSPEC=s |
|
|
703
|
+
| log | * | PATHSPEC=s |
|
|
704
|
+
| pull | remote | REFSPEC=s |
|
|
705
|
+
| pull | -remote | REBASE=0,1 ALL |
|
|
706
|
+
| pull | all | FF_ONLY=0 |
|
|
707
|
+
| pull | * | AUTOSTASH F|FORCE RECURSE_SUBMODULES=0,1,s |
|
|
708
|
+
| rebase | branch | HEAD=s |
|
|
709
|
+
| rebase | onto | INTERACTIVE I HEAD=s |
|
|
710
|
+
| reset | mode (mixed) | N REFRESH=0 |
|
|
711
|
+
| reset | index | PATHSPEC=s |
|
|
712
|
+
| reset | commit | COUNT=n REFLOG=1 |
|
|
713
|
+
| reset | -commit | HEAD=s |
|
|
714
|
+
| restore | * | PATHSPEC=s |
|
|
715
|
+
| revbuild | global | UNTRACKED_FILES=s IGNORE_SUBMODULES=s IGNORED=s (status) |
|
|
716
|
+
| stash | push | PATHSPEC=s |
|
|
717
|
+
| stash | global | ALL=0,1 KEEP_INDEX=0,1 INCLUDE_UNTRACKED=0,1 STAGED=0,1 M|MESSAGE=s |
|
|
718
|
+
| status | global | BRANCH LONG IGNORE_SUBMODULES=s,0-3 PATHSPEC=s |
|
|
719
|
+
| submodule | -branch -url | R|RECURSIVE |
|
|
720
|
+
| switch | detach | REFLOG=1 |
|
|
721
|
+
| switch | -detach | HEAD=s |
|
|
722
|
+
| switch | * | F|FORCE |
|
|
723
|
+
| tag | add | SIGN FORCE HEAD=s M|MESSAGE=s |
|
|
724
|
+
| tag | sign | F|FORCE HEAD=s M|MESSAGE=s |
|
|
725
|
+
| tag | delete | COUNT=n |
|
|
726
|
+
| rev | commit branch | HEAD=s |
|
|
712
727
|
|
|
713
728
|
### Docker
|
|
714
729
|
|
|
@@ -722,8 +737,8 @@ DOCKER_TAG_${NAME}=v0.1.0 # project only (override)
|
|
|
722
737
|
DOCKER_ALL=1 # list every image/container
|
|
723
738
|
DOCKER_Y=1 # confirm all
|
|
724
739
|
|
|
725
|
-
BUILD_SQUARED_OPTS="NODE_TAG=24 RUBY_VERSION=
|
|
726
|
-
docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_VERSION=
|
|
740
|
+
BUILD_SQUARED_OPTS="NODE_TAG=24 RUBY_VERSION=4.0.0" DOCKER_SQUARED_OPTS="--no-cache --label=v1" rake squared:build
|
|
741
|
+
docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_VERSION=4.0.0" .
|
|
727
742
|
```
|
|
728
743
|
|
|
729
744
|
| Command | Flag | ENV |
|
|
@@ -732,6 +747,7 @@ docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_V
|
|
|
732
747
|
| buildx | bake | SERVICE=s |
|
|
733
748
|
| compose | build | TARGET=s |
|
|
734
749
|
| compose | run | VERSION=s |
|
|
750
|
+
| compose | publish | TAG=s REGISTRY=s |
|
|
735
751
|
| container | commit | REGISTRY=s PLATFORM=s DISABLE_CONTENT_TRUST=0,1 |
|
|
736
752
|
| container | -run -create -exec | ALL=1 |
|
|
737
753
|
| | -update -commit | |
|
|
@@ -744,17 +760,25 @@ docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_V
|
|
|
744
760
|
|
|
745
761
|
* Version: [15](https://asdf-vm.com/guide/getting-started-legacy.html) | [16+](https://asdf-vm.com/guide/getting-started.html)
|
|
746
762
|
|
|
747
|
-
| Command | Options
|
|
748
|
-
| :--------- |
|
|
749
|
-
| set | u|home p|parent
|
|
750
|
-
| exec |
|
|
751
|
-
| current |
|
|
763
|
+
| Command | Options | Arguments |
|
|
764
|
+
| :--------- | :----------------- | :------------ |
|
|
765
|
+
| set | u|home p|parent | version |
|
|
766
|
+
| exec | | command,args* |
|
|
767
|
+
| current | | |
|
|
752
768
|
|
|
753
769
|
```ruby
|
|
754
770
|
Workspace::Application
|
|
755
771
|
.new
|
|
756
|
-
.add("squared", asdf: "ruby", ref: :node)
|
|
757
|
-
.add("squared-ruby", "squared")
|
|
772
|
+
.add("squared", asdf: "ruby", ref: :node) # Detects ruby instead of nodejs
|
|
773
|
+
.add("squared-ruby", "squared", ref: :ruby) # Uses asdf program alias "ruby"
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
```sh
|
|
777
|
+
# ~/.bashrc (legacy)
|
|
778
|
+
|
|
779
|
+
export ASDF_DIR=/opt/asdf-vm
|
|
780
|
+
|
|
781
|
+
. $ASDF_DIR/asdf.sh
|
|
758
782
|
```
|
|
759
783
|
|
|
760
784
|
### Repo
|
|
@@ -772,6 +796,9 @@ chmod a+rx ~/.bin/repo
|
|
|
772
796
|
```
|
|
773
797
|
|
|
774
798
|
```ruby
|
|
799
|
+
require "squared/workspace"
|
|
800
|
+
require "squared/workspace/repo"
|
|
801
|
+
|
|
775
802
|
# REPO_ROOT = /workspaces |
|
|
776
803
|
# REPO_HOME = /workspaces/squared | Dir.pwd
|
|
777
804
|
# rake = /workspaces/squared/Rakefile | main?
|
|
@@ -784,17 +811,31 @@ chmod a+rx ~/.bin/repo
|
|
|
784
811
|
|
|
785
812
|
Workspace::Application
|
|
786
813
|
.new(main: "squared")
|
|
787
|
-
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "#{ENV["HOME"]}/.bin",
|
|
814
|
+
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "#{ENV["HOME"]}/.bin", # install: first only
|
|
815
|
+
ref: %i[node -docker]) # exclude: -docker
|
|
816
|
+
.repo("https://github.com/anpham6/squared-repo", name: "doc", doc: true, test: true, ref: :python)
|
|
788
817
|
.add("squared", script: ["build:stage1", "build:stage2"])
|
|
818
|
+
.with(:python) do
|
|
819
|
+
add "android-docs"
|
|
820
|
+
add "chrome-docs"
|
|
821
|
+
end
|
|
789
822
|
.build
|
|
790
823
|
```
|
|
791
824
|
|
|
825
|
+
```sh
|
|
826
|
+
REPO_ROOT=/workspace/node rake repo:init
|
|
827
|
+
|
|
828
|
+
REPO_ROOT=/workspace/python rake repo:doc:init
|
|
829
|
+
```
|
|
830
|
+
|
|
792
831
|
These global options also can target the application main suffix `${NAME}`. (e.g. *REPO_ROOT_SQUARED*)
|
|
793
832
|
|
|
794
833
|
```sh
|
|
795
834
|
REPO_ROOT # parent dir
|
|
796
835
|
REPO_HOME # project dir (main)
|
|
836
|
+
REPO_OPTIONS # appended to application command
|
|
797
837
|
REPO_BUILD # script,run (e.g. build:dev | build:dev,make install | make)
|
|
838
|
+
REPO_SERIES # depend,build:parallel,doc:detect,lint (task order)
|
|
798
839
|
REPO_GROUP # string
|
|
799
840
|
REPO_REF # e.g. ruby,node
|
|
800
841
|
REPO_DEV # pattern,0,1
|
|
@@ -804,9 +845,9 @@ REPO_SYNC # 0,1
|
|
|
804
845
|
REPO_GIT # manifest repository
|
|
805
846
|
REPO_MANIFEST # e.g. latest,nightly,prod
|
|
806
847
|
REPO_GROUPS # e.g. base,prod,docs
|
|
807
|
-
REPO_STAGE # 0,1,2,
|
|
808
|
-
|
|
809
|
-
REPO_Y # 0,1
|
|
848
|
+
REPO_STAGE # 0,1|sync,2|depend,4|build,8|copy,16|lint,512|dev
|
|
849
|
+
REPO_SUBMODULES # 0,1
|
|
850
|
+
REPO_Y # 0,1 (bypass interactive prompt)
|
|
810
851
|
REPO_TIMEOUT # confirm dialog (seconds)
|
|
811
852
|
```
|
|
812
853
|
|
|
@@ -820,41 +861,42 @@ Features can be enabled through ENV when calling global tasks such as through *C
|
|
|
820
861
|
|
|
821
862
|
* Prefix: BUNDLE/GEM/RBS
|
|
822
863
|
|
|
823
|
-
| Command | Flag | ENV
|
|
824
|
-
| :--------- | :-------- |
|
|
825
|
-
| depend | - | BINSTUBS=s JOBS=n
|
|
826
|
-
|
|
|
827
|
-
|
|
|
828
|
-
|
|
|
864
|
+
| Command | Flag | ENV |
|
|
865
|
+
| :--------- | :-------- | :-------------------------------------------------------- |
|
|
866
|
+
| depend | - | BINSTUBS=s JOBS=n |
|
|
867
|
+
| depend | update | VERSION=major|minor|patch STRICT CONSERVATIVE |
|
|
868
|
+
| outdated | - | U|UPDATE=major|minor|patch ONLY_EXPLICIT DRY_RUN |
|
|
869
|
+
| gem | outdated | DOCUMENT=0,1 USER_INSTALL=0,1 |
|
|
870
|
+
| rbs | prototype | Y=0,1 |
|
|
829
871
|
|
|
830
872
|
#### Node
|
|
831
873
|
|
|
832
874
|
* Prefix: NPM/PNPM/YARN
|
|
833
875
|
|
|
834
|
-
| Command | Flag | ENV
|
|
835
|
-
| :------------- | :------------- |
|
|
836
|
-
| depend | - | FORCE CI IGNORE_SCRIPTS
|
|
837
|
-
| outdated | - | U|UPDATE=major|minor|patch DIFF DRY_RUN
|
|
838
|
-
| publish | - | OTP=s TAG=s ACCESS=0,1,s DRY_RUN
|
|
839
|
-
| depend package | * | PACAKGE_LOCK|LOCKFILE=0 NO_LOCKFILE=1 Y
|
|
840
|
-
| npm pnpm | depend package | CPU=s OS=s LIBC=s
|
|
841
|
-
| npm | package | SAVE IGNORE_SCRIPTS STRICT_PEER_DEPS
|
|
842
|
-
| pnpm | depend | PUBLIC_HOIST_PATTERN=s APPROVE_BUILDS
|
|
843
|
-
| pnpm | depend:add | ALLOW_BUILD=s
|
|
844
|
-
| yarn | depend package | IGNORE_ENGINES
|
|
876
|
+
| Command | Flag | ENV |
|
|
877
|
+
| :------------- | :------------- | :----------------------------------------------- |
|
|
878
|
+
| depend | - | FORCE CI IGNORE_SCRIPTS |
|
|
879
|
+
| outdated | - | U|UPDATE=major|minor|patch DIFF DRY_RUN |
|
|
880
|
+
| publish | - | OTP=s TAG=s ACCESS=0,1,s DRY_RUN Y |
|
|
881
|
+
| depend package | * | PACAKGE_LOCK|LOCKFILE=0 NO_LOCKFILE=1 Y |
|
|
882
|
+
| npm pnpm | depend package | CPU=s OS=s LIBC=s |
|
|
883
|
+
| npm | package | SAVE IGNORE_SCRIPTS STRICT_PEER_DEPS |
|
|
884
|
+
| pnpm | depend | PUBLIC_HOIST_PATTERN=s APPROVE_BUILDS |
|
|
885
|
+
| pnpm | depend:add | ALLOW_BUILD=s |
|
|
886
|
+
| yarn | depend package | IGNORE_ENGINES |
|
|
845
887
|
|
|
846
888
|
#### Python
|
|
847
889
|
|
|
848
890
|
* Prefix: PIP/POETRY
|
|
849
891
|
|
|
850
|
-
| Command | Flag | ENV
|
|
851
|
-
| :--------- | :-------- |
|
|
852
|
-
| global | * | CACHE_DIR=0,s PROXY=s PYTHON=s COLOR=0
|
|
853
|
-
| depend | - | E|EDITABLE=0,s BUILD_ISOLATION=0
|
|
854
|
-
| outdated | - | U|UPDATE=major|minor|patch NOT_REQUIRED=0 L|LOCAL DRY_RUN
|
|
855
|
-
| venv | exec | INTERACTIVE=0
|
|
856
|
-
| poetry | * | PROJECT=s
|
|
857
|
-
| poetry | depend | NO_ROOT
|
|
892
|
+
| Command | Flag | ENV |
|
|
893
|
+
| :--------- | :-------- | :-------------------------------------------------------- |
|
|
894
|
+
| global | * | CACHE_DIR=0,s PROXY=s PYTHON=s COLOR=0 |
|
|
895
|
+
| depend | - | E|EDITABLE=0,s BUILD_ISOLATION=0 |
|
|
896
|
+
| outdated | - | U|UPDATE=major|minor|patch NOT_REQUIRED=0 L|LOCAL DRY_RUN |
|
|
897
|
+
| venv | exec | INTERACTIVE=0 |
|
|
898
|
+
| poetry | * | PROJECT=s |
|
|
899
|
+
| poetry | depend | NO_ROOT |
|
|
858
900
|
|
|
859
901
|
## LICENSE
|
|
860
902
|
|