squared 0.6.10 → 0.7.0
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 +67 -14
- data/README.md +242 -204
- 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 +544 -446
- data/lib/squared/workspace/project/docker.rb +162 -155
- data/lib/squared/workspace/project/git.rb +180 -147
- data/lib/squared/workspace/project/node.rb +91 -89
- data/lib/squared/workspace/project/python.rb +245 -151
- data/lib/squared/workspace/project/ruby.rb +403 -291
- 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.
|
|
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")
|
|
@@ -360,8 +361,9 @@ Workspace::Application
|
|
|
360
361
|
add("squared", graph: ["chrome", "express"]) do
|
|
361
362
|
first("git:ls-files") { puts "1" } # skipped
|
|
362
363
|
first("git:ls-files", override: true) { puts "2" } # puts "2"
|
|
363
|
-
last("git:ls-files") { puts workspace.root } # puts "/workspaces"
|
|
364
|
-
|
|
364
|
+
last("git:ls-files") { puts workspace.root } # puts "/workspaces" (does not run when error is raised)
|
|
365
|
+
error("git:ls-files") { |err| err.is_a?(TypeError) } # return true to suppress error
|
|
366
|
+
end
|
|
365
367
|
end
|
|
366
368
|
.with(:ruby) do
|
|
367
369
|
run("gem build") # gem build
|
|
@@ -374,10 +376,10 @@ Workspace::Application
|
|
|
374
376
|
p "1"
|
|
375
377
|
end
|
|
376
378
|
# OR
|
|
377
|
-
run(["gem build", "--force", { "RUBY_VERSION" => "
|
|
379
|
+
run(["gem build", "--force", { "RUBY_VERSION" => "4.0.0" }]) # RUBY_VERSION="4.0.0" gem build --force
|
|
378
380
|
# OR
|
|
379
381
|
run({ #
|
|
380
|
-
command: "gem build", # RUBY_VERSION="
|
|
382
|
+
command: "gem build", # RUBY_VERSION="4.0.0" gem build --silent --force
|
|
381
383
|
opts: "--force", # composable
|
|
382
384
|
env: { "PATH" => "~/.bin" }, #
|
|
383
385
|
args: { silent: true } #
|
|
@@ -387,9 +389,9 @@ Workspace::Application
|
|
|
387
389
|
#
|
|
388
390
|
# All commands are either Array or Hash
|
|
389
391
|
#
|
|
390
|
-
run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-
|
|
392
|
+
run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-4.0.0" (merged)
|
|
391
393
|
["gem pristine", "--all", { "PATH" => "~/.bin" }, "--silent"], # gem pristine --silent --all
|
|
392
|
-
["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-
|
|
394
|
+
["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-4.0.0" }] # gem build --strict
|
|
393
395
|
]) #
|
|
394
396
|
# OR
|
|
395
397
|
run([ # Same
|
|
@@ -399,7 +401,7 @@ Workspace::Application
|
|
|
399
401
|
opts: "--all", args: "--silent" #
|
|
400
402
|
}, #
|
|
401
403
|
{ #
|
|
402
|
-
env: { "GEM_HOME" => "~/.gems/ruby-
|
|
404
|
+
env: { "GEM_HOME" => "~/.gems/ruby-4.0.0" }, #
|
|
403
405
|
command: "gem build", #
|
|
404
406
|
opts: { strict: true } #
|
|
405
407
|
} #
|
|
@@ -415,15 +417,15 @@ Workspace::Application
|
|
|
415
417
|
```
|
|
416
418
|
|
|
417
419
|
```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
|
|
420
|
+
rake pir:graph # emc + pir
|
|
421
|
+
rake express:graph # emc + pir + express
|
|
422
|
+
rake chrome:graph # android + chrome
|
|
423
|
+
rake graph:python # same
|
|
424
|
+
rake squared:graph # android + chrome + emc + pir + express + squared
|
|
425
|
+
rake graph:node # same
|
|
426
|
+
rake rake:graph # pathname + fileutils + optparse + rake
|
|
427
|
+
rake graph:ruby # same
|
|
428
|
+
rake graph # graph:node + graph:ruby
|
|
427
429
|
|
|
428
430
|
rake squared:graph:run[express,pir] # emc + pir + express + squared
|
|
429
431
|
rake squared:graph:run[node,-emc] # pir + express + squared
|
|
@@ -432,41 +434,51 @@ rake squared:graph:run[node,-emc] # pir + express + squared
|
|
|
432
434
|
### Tasks
|
|
433
435
|
|
|
434
436
|
```ruby
|
|
435
|
-
Workspace::
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
437
|
+
Workspace::Application
|
|
438
|
+
.new(prefix: "rb")
|
|
439
|
+
.batch(:ruby, :node, {
|
|
440
|
+
stage: [%i[graph test], true], # stage? (optional)
|
|
441
|
+
reset: %i[stash pull] # reset? (required)
|
|
442
|
+
})
|
|
443
|
+
.rename("depend", "install")
|
|
444
|
+
.add("squared", timeout: { ruby: 10 }, ref: :ruby) do # Overrides ruby=5,8
|
|
445
|
+
scope("nested:version") { puts self.version } # rake rb:squared:nested:version
|
|
446
|
+
end
|
|
447
|
+
.add("chrome-docs", timeout: 30, ref: :python) # Does not override ruby/python
|
|
448
|
+
.timeout({ ruby: 5, python: 5 }) # global (seconds/fraction)
|
|
449
|
+
.timeout({ ruby: 8, gem: 5, gem_update: 20, bundle_install: 30 }, ref: :ruby) # Overrides global (group | ref)
|
|
450
|
+
.build
|
|
441
451
|
```
|
|
442
452
|
|
|
453
|
+
Some global tasks and local git commands do not support using process shell timeout.
|
|
454
|
+
|
|
443
455
|
## Usage
|
|
444
456
|
|
|
445
457
|
```sh
|
|
446
|
-
rake -T
|
|
447
|
-
rake
|
|
458
|
+
rake -T # List tasks
|
|
459
|
+
rake # rake status (usually "build")
|
|
448
460
|
|
|
449
461
|
# 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[#]
|
|
462
|
+
rake pull # All except "default" + "app"
|
|
463
|
+
rake pull:ruby # pathname + optparse + logger
|
|
464
|
+
rake pull:default # pathname + optparse
|
|
465
|
+
rake pull:app # squared
|
|
466
|
+
rake pull:node # emc + pir + squared
|
|
467
|
+
|
|
468
|
+
rake build # All except "android"
|
|
469
|
+
rake doc # optparse + android
|
|
470
|
+
rake depend # All except "default"
|
|
471
|
+
|
|
472
|
+
rake build:ruby # rake compile + rake install + rake install
|
|
473
|
+
|
|
474
|
+
rake clean # All except "default" + "app"
|
|
475
|
+
rake clean:ruby # rake clean + rake clean + ["tmp/"]
|
|
476
|
+
rake clean:default # rake clean + rake clean + skip
|
|
477
|
+
rake clean:app # none + skip + ["build/"]
|
|
478
|
+
rake clean:node # none + ["publish/**/*.js", "tmp/"] + ["build/"]
|
|
479
|
+
|
|
480
|
+
rake squared:run[#] # List scripts (node)
|
|
481
|
+
rake squared:rake[#] # List tasks (ruby)
|
|
470
482
|
```
|
|
471
483
|
|
|
472
484
|
```sh
|
|
@@ -519,37 +531,37 @@ Non-task:
|
|
|
519
531
|
|
|
520
532
|
Most project classes will inherit from `Git` which enables these tasks:
|
|
521
533
|
|
|
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
|
-
|
|
|
534
|
+
| Task | Git | Command |
|
|
535
|
+
| :-------------- | :--------------- | :-------------------------------------------------------- |
|
|
536
|
+
| branch | branch | create track delete move copy list current |
|
|
537
|
+
| checkout | checkout | commit branch track detach path |
|
|
538
|
+
| commit | commit | add all amend amend-orig fixup |
|
|
539
|
+
| diff | diff | head branch files view between contain |
|
|
540
|
+
| fetch | fetch | origin remote all |
|
|
541
|
+
| files | ls-files | cached modified deleted others |
|
|
542
|
+
| git | | add blame clean grep mv revert rm sparse-checkout status |
|
|
543
|
+
| log | log | view between contain |
|
|
544
|
+
| merge | merge | commit no-commit send |
|
|
545
|
+
| pull | pull | origin remote all |
|
|
546
|
+
| rebase | rebase | branch onto send |
|
|
547
|
+
| refs | ls-remote --refs | heads tags remote |
|
|
548
|
+
| reset | reset | commit index patch mode undo |
|
|
549
|
+
| restore | restore | source staged worktree |
|
|
550
|
+
| rev | rev | commit branch build output |
|
|
551
|
+
| sparse-checkout | sparse-checkout | add reapply list clean disable |
|
|
552
|
+
| show | show | format oneline textconv |
|
|
553
|
+
| stash | stash | push pop apply branch drop clear list all staged worktree |
|
|
554
|
+
| submodule | submodule | status update branch url sync |
|
|
555
|
+
| switch | switch | branch create detach |
|
|
556
|
+
| tag | tag | add sign delete list |
|
|
544
557
|
|
|
545
558
|
You can disable all of them at once using the `exclude` property.
|
|
546
559
|
|
|
547
560
|
```ruby
|
|
548
|
-
Workspace::Application.exclude('autostash', 'rebase')
|
|
549
|
-
|
|
550
561
|
Workspace::Application
|
|
551
562
|
.new
|
|
552
563
|
.add("squared", exclude: :git)
|
|
564
|
+
.build(exclude: ["autostash", "rebase"])
|
|
553
565
|
```
|
|
554
566
|
|
|
555
567
|
You can disable one or more of them using the `pass` property as a *string*.
|
|
@@ -578,14 +590,14 @@ All project binary programs can have their executable path set to a non-global a
|
|
|
578
590
|
|
|
579
591
|
```ruby
|
|
580
592
|
Common::PATH.update({
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
593
|
+
git: "/usr/bin/git", # PATH_GIT=/usr/bin/git
|
|
594
|
+
tar: "/opt/archivers/tar", # PATH_TAR=/opt/archivers/tar
|
|
595
|
+
unzip: "/opt/archivers/unzip",
|
|
596
|
+
gem: "~/.rvm/gems/ruby-4.0.0/bin/gem",
|
|
597
|
+
bundle: "~/.rvm/gems/ruby-4.0.0/bin/bundle",
|
|
598
|
+
rake: "~/.rvm/gems/ruby-4.0.0/bin/rake",
|
|
599
|
+
npm: "/opt/node/v22.0.0/bin/npm",
|
|
600
|
+
python: "#{ENV["PYTHONPATH"]}/bin/python"
|
|
589
601
|
})
|
|
590
602
|
```
|
|
591
603
|
|
|
@@ -658,57 +670,57 @@ LOG_LEVEL # See gem "logger"
|
|
|
658
670
|
* Version: [2.51](https://github.com/git/git/blob/v2.51.0/Documentation/RelNotes/2.51.0.adoc)
|
|
659
671
|
|
|
660
672
|
```sh
|
|
661
|
-
GIT_OPTIONS=q,strategy=ort
|
|
662
|
-
GIT_OPTIONS_${NAME}=v,ff
|
|
663
|
-
GIT_AUTOSTASH=1
|
|
664
|
-
GIT_AUTOSTASH_${NAME}=0
|
|
673
|
+
GIT_OPTIONS=q,strategy=ort # all
|
|
674
|
+
GIT_OPTIONS_${NAME}=v,ff # project only
|
|
675
|
+
GIT_AUTOSTASH=1 # rebase (all)
|
|
676
|
+
GIT_AUTOSTASH_${NAME}=0 # rebase (project only)
|
|
665
677
|
```
|
|
666
678
|
|
|
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
|
|
679
|
+
| Command | Flag | ENV |
|
|
680
|
+
| :--------- | :---------------- | :------------------------------------------------------------------ |
|
|
681
|
+
| branch | create | TRACK=0,1,s F|FORCE |
|
|
682
|
+
| branch | move copy | F|FORCE |
|
|
683
|
+
| branch | delete | COUNT=n |
|
|
684
|
+
| branch | global | SYNC |
|
|
685
|
+
| checkout | branch | DETACH TRACK=s COUNT=n |
|
|
686
|
+
| checkout | detach | REFLOG=1 |
|
|
687
|
+
| checkout | track | COUNT=n |
|
|
688
|
+
| checkout | global path | HEAD=s PATHSPEC=s |
|
|
689
|
+
| checkout | * | F|FORCE MERGE |
|
|
690
|
+
| clone | * | DEPTH=n ORIGIN=s BRANCH=s REVISION=s BARE=1 LOCAL=0,1 |
|
|
691
|
+
| | | SINGLE_BRANCH=0,1 NO_CHECKOUT=1 NO_TAGS=1 QUIET=1 |
|
|
692
|
+
| commit | * | UPSTREAM=s DRY_RUN EDIT=0 M|MESSAGE=s |
|
|
693
|
+
| diff | -between -contain | MERGE_BASE |
|
|
694
|
+
| diff | head branch | INDEX=n |
|
|
695
|
+
| diff | * | PATHSPEC=s |
|
|
696
|
+
| fetch | -remote | ALL |
|
|
697
|
+
| fetch | remote | REFSPEC=s |
|
|
698
|
+
| fetch | * | F|FORCE RECURSE_SUBMODULES=0,1,s |
|
|
699
|
+
| git | rm | PATHSPEC=s |
|
|
700
|
+
| log | * | PATHSPEC=s |
|
|
701
|
+
| pull | remote | REFSPEC=s |
|
|
702
|
+
| pull | -remote | REBASE=0,1 ALL |
|
|
703
|
+
| pull | all | FF_ONLY=0 |
|
|
704
|
+
| pull | * | AUTOSTASH F|FORCE RECURSE_SUBMODULES=0,1,s |
|
|
705
|
+
| rebase | branch | HEAD=s |
|
|
706
|
+
| rebase | onto | INTERACTIVE I HEAD=s |
|
|
707
|
+
| reset | mode (mixed) | N REFRESH=0 |
|
|
708
|
+
| reset | index | PATHSPEC=s |
|
|
709
|
+
| reset | commit | COUNT=n REFLOG=1 |
|
|
710
|
+
| reset | -commit | HEAD=s |
|
|
711
|
+
| restore | * | PATHSPEC=s |
|
|
712
|
+
| revbuild | global | UNTRACKED_FILES=s IGNORE_SUBMODULES=s IGNORED=s (status) |
|
|
713
|
+
| stash | push | PATHSPEC=s |
|
|
714
|
+
| stash | global | ALL=0,1 KEEP_INDEX=0,1 INCLUDE_UNTRACKED=0,1 STAGED=0,1 M|MESSAGE=s |
|
|
715
|
+
| status | global | BRANCH LONG IGNORE_SUBMODULES=s,0-3 PATHSPEC=s |
|
|
716
|
+
| submodule | -branch -url | R|RECURSIVE |
|
|
717
|
+
| switch | detach | REFLOG=1 |
|
|
718
|
+
| switch | -detach | HEAD=s |
|
|
719
|
+
| switch | * | F|FORCE |
|
|
720
|
+
| tag | add | SIGN FORCE HEAD=s M|MESSAGE=s |
|
|
721
|
+
| tag | sign | F|FORCE HEAD=s M|MESSAGE=s |
|
|
722
|
+
| tag | delete | COUNT=n |
|
|
723
|
+
| rev | commit branch | HEAD=s |
|
|
712
724
|
|
|
713
725
|
### Docker
|
|
714
726
|
|
|
@@ -722,8 +734,8 @@ DOCKER_TAG_${NAME}=v0.1.0 # project only (override)
|
|
|
722
734
|
DOCKER_ALL=1 # list every image/container
|
|
723
735
|
DOCKER_Y=1 # confirm all
|
|
724
736
|
|
|
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=
|
|
737
|
+
BUILD_SQUARED_OPTS="NODE_TAG=24 RUBY_VERSION=4.0.0" DOCKER_SQUARED_OPTS="--no-cache --label=v1" rake squared:build
|
|
738
|
+
docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_VERSION=4.0.0" .
|
|
727
739
|
```
|
|
728
740
|
|
|
729
741
|
| Command | Flag | ENV |
|
|
@@ -732,30 +744,38 @@ docker build --no-cache --label=v1 --build-arg="NODE_TAG=24" --build-arg="RUBY_V
|
|
|
732
744
|
| buildx | bake | SERVICE=s |
|
|
733
745
|
| compose | build | TARGET=s |
|
|
734
746
|
| compose | run | VERSION=s |
|
|
747
|
+
| compose | publish | TAG=s REGISTRY=s |
|
|
735
748
|
| container | commit | REGISTRY=s PLATFORM=s DISABLE_CONTENT_TRUST=0,1 |
|
|
736
|
-
| container | -run -create -exec | ALL=1
|
|
749
|
+
| container | -run -create -exec | ALL=1 |
|
|
737
750
|
| | -update -commit | |
|
|
738
751
|
| image | rm | Y=1 |
|
|
739
752
|
| image | push | TAG=s REGISTRY=s |
|
|
740
753
|
| image | -push | ALL=1 |
|
|
741
|
-
|
|
|
742
|
-
| network | * | ALL=1 FILTER=s |
|
|
754
|
+
| network | * | ALL=1 |
|
|
743
755
|
|
|
744
756
|
### asdf
|
|
745
757
|
|
|
746
758
|
* Version: [15](https://asdf-vm.com/guide/getting-started-legacy.html) | [16+](https://asdf-vm.com/guide/getting-started.html)
|
|
747
759
|
|
|
748
|
-
| Command | Options
|
|
749
|
-
| :--------- |
|
|
750
|
-
| set | u|home p|parent
|
|
751
|
-
| exec |
|
|
752
|
-
| current |
|
|
760
|
+
| Command | Options | Arguments |
|
|
761
|
+
| :--------- | :----------------- | :------------ |
|
|
762
|
+
| set | u|home p|parent | version |
|
|
763
|
+
| exec | | command,args* |
|
|
764
|
+
| current | | |
|
|
753
765
|
|
|
754
766
|
```ruby
|
|
755
767
|
Workspace::Application
|
|
756
768
|
.new
|
|
757
|
-
.add("squared", asdf: "ruby", ref: :node)
|
|
758
|
-
.add("squared-ruby", "squared")
|
|
769
|
+
.add("squared", asdf: "ruby", ref: :node) # Detects ruby instead of nodejs
|
|
770
|
+
.add("squared-ruby", "squared", ref: :ruby) # Uses asdf program alias "ruby"
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
```sh
|
|
774
|
+
# ~/.bashrc (legacy)
|
|
775
|
+
|
|
776
|
+
export ASDF_DIR=/opt/asdf-vm
|
|
777
|
+
|
|
778
|
+
. $ASDF_DIR/asdf.sh
|
|
759
779
|
```
|
|
760
780
|
|
|
761
781
|
### Repo
|
|
@@ -773,6 +793,9 @@ chmod a+rx ~/.bin/repo
|
|
|
773
793
|
```
|
|
774
794
|
|
|
775
795
|
```ruby
|
|
796
|
+
require "squared/workspace"
|
|
797
|
+
require "squared/workspace/repo"
|
|
798
|
+
|
|
776
799
|
# REPO_ROOT = /workspaces |
|
|
777
800
|
# REPO_HOME = /workspaces/squared | Dir.pwd
|
|
778
801
|
# rake = /workspaces/squared/Rakefile | main?
|
|
@@ -785,17 +808,31 @@ chmod a+rx ~/.bin/repo
|
|
|
785
808
|
|
|
786
809
|
Workspace::Application
|
|
787
810
|
.new(main: "squared")
|
|
788
|
-
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "#{ENV["HOME"]}/.bin",
|
|
811
|
+
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], install: "#{ENV["HOME"]}/.bin", # install: first only
|
|
812
|
+
ref: %i[node -docker]) # exclude: -docker
|
|
813
|
+
.repo("https://github.com/anpham6/squared-repo", name: "doc", doc: true, test: true, ref: :python)
|
|
789
814
|
.add("squared", script: ["build:stage1", "build:stage2"])
|
|
815
|
+
.with(:python) do
|
|
816
|
+
add "android-docs"
|
|
817
|
+
add "chrome-docs"
|
|
818
|
+
end
|
|
790
819
|
.build
|
|
791
820
|
```
|
|
792
821
|
|
|
822
|
+
```sh
|
|
823
|
+
REPO_ROOT=/workspace/node rake repo:init
|
|
824
|
+
|
|
825
|
+
REPO_ROOT=/workspace/python rake repo:doc:init
|
|
826
|
+
```
|
|
827
|
+
|
|
793
828
|
These global options also can target the application main suffix `${NAME}`. (e.g. *REPO_ROOT_SQUARED*)
|
|
794
829
|
|
|
795
830
|
```sh
|
|
796
831
|
REPO_ROOT # parent dir
|
|
797
832
|
REPO_HOME # project dir (main)
|
|
833
|
+
REPO_OPTIONS # appended to application command
|
|
798
834
|
REPO_BUILD # script,run (e.g. build:dev | build:dev,make install | make)
|
|
835
|
+
REPO_SERIES # depend,build:parallel,doc:detect,lint (task order)
|
|
799
836
|
REPO_GROUP # string
|
|
800
837
|
REPO_REF # e.g. ruby,node
|
|
801
838
|
REPO_DEV # pattern,0,1
|
|
@@ -805,9 +842,9 @@ REPO_SYNC # 0,1
|
|
|
805
842
|
REPO_GIT # manifest repository
|
|
806
843
|
REPO_MANIFEST # e.g. latest,nightly,prod
|
|
807
844
|
REPO_GROUPS # e.g. base,prod,docs
|
|
808
|
-
REPO_STAGE # 0,1,2,
|
|
809
|
-
|
|
810
|
-
REPO_Y # 0,1
|
|
845
|
+
REPO_STAGE # 0,1|sync,2|depend,4|build,8|copy,16|lint,512|dev
|
|
846
|
+
REPO_SUBMODULES # 0,1
|
|
847
|
+
REPO_Y # 0,1
|
|
811
848
|
REPO_TIMEOUT # confirm dialog (seconds)
|
|
812
849
|
```
|
|
813
850
|
|
|
@@ -821,41 +858,42 @@ Features can be enabled through ENV when calling global tasks such as through *C
|
|
|
821
858
|
|
|
822
859
|
* Prefix: BUNDLE/GEM/RBS
|
|
823
860
|
|
|
824
|
-
| Command | Flag | ENV
|
|
825
|
-
| :--------- | :-------- |
|
|
826
|
-
| depend | - | BINSTUBS=s JOBS=n
|
|
827
|
-
|
|
|
828
|
-
|
|
|
829
|
-
|
|
|
861
|
+
| Command | Flag | ENV |
|
|
862
|
+
| :--------- | :-------- | :-------------------------------------------------------- |
|
|
863
|
+
| depend | - | BINSTUBS=s JOBS=n |
|
|
864
|
+
| depend | update | VERSION=major|minor|patch STRICT CONSERVATIVE |
|
|
865
|
+
| outdated | - | U|UPDATE=major|minor|patch ONLY_EXPLICIT DRY_RUN |
|
|
866
|
+
| gem | outdated | DOCUMENT=0,1 USER_INSTALL=0,1 |
|
|
867
|
+
| rbs | prototype | Y=0,1 |
|
|
830
868
|
|
|
831
869
|
#### Node
|
|
832
870
|
|
|
833
871
|
* Prefix: NPM/PNPM/YARN
|
|
834
872
|
|
|
835
|
-
| Command | Flag | ENV
|
|
836
|
-
| :------------- | :------------- |
|
|
837
|
-
| depend | - | FORCE CI IGNORE_SCRIPTS
|
|
838
|
-
| outdated | - | U|UPDATE=major|minor|patch DIFF DRY_RUN
|
|
839
|
-
| publish | - | OTP=s TAG=s ACCESS=0,1,s DRY_RUN
|
|
840
|
-
| depend package | * | PACAKGE_LOCK|LOCKFILE=0 NO_LOCKFILE=1 Y
|
|
841
|
-
| npm pnpm | depend package | CPU=s OS=s LIBC=s
|
|
842
|
-
| npm | package | SAVE IGNORE_SCRIPTS STRICT_PEER_DEPS
|
|
843
|
-
| pnpm | depend | PUBLIC_HOIST_PATTERN=s APPROVE_BUILDS
|
|
844
|
-
| pnpm | depend:add | ALLOW_BUILD=s
|
|
845
|
-
| yarn | depend package | IGNORE_ENGINES
|
|
873
|
+
| Command | Flag | ENV |
|
|
874
|
+
| :------------- | :------------- | :----------------------------------------------- |
|
|
875
|
+
| depend | - | FORCE CI IGNORE_SCRIPTS |
|
|
876
|
+
| outdated | - | U|UPDATE=major|minor|patch DIFF DRY_RUN |
|
|
877
|
+
| publish | - | OTP=s TAG=s ACCESS=0,1,s DRY_RUN |
|
|
878
|
+
| depend package | * | PACAKGE_LOCK|LOCKFILE=0 NO_LOCKFILE=1 Y |
|
|
879
|
+
| npm pnpm | depend package | CPU=s OS=s LIBC=s |
|
|
880
|
+
| npm | package | SAVE IGNORE_SCRIPTS STRICT_PEER_DEPS |
|
|
881
|
+
| pnpm | depend | PUBLIC_HOIST_PATTERN=s APPROVE_BUILDS |
|
|
882
|
+
| pnpm | depend:add | ALLOW_BUILD=s |
|
|
883
|
+
| yarn | depend package | IGNORE_ENGINES |
|
|
846
884
|
|
|
847
885
|
#### Python
|
|
848
886
|
|
|
849
887
|
* Prefix: PIP/POETRY
|
|
850
888
|
|
|
851
|
-
| Command | Flag | ENV
|
|
852
|
-
| :--------- | :-------- |
|
|
853
|
-
| global | * | CACHE_DIR=0,s PROXY=s PYTHON=s COLOR=0
|
|
854
|
-
| depend | - | E|EDITABLE=0,s BUILD_ISOLATION=0
|
|
855
|
-
| outdated | - | U|UPDATE=major|minor|patch NOT_REQUIRED=0 L|LOCAL DRY_RUN
|
|
856
|
-
| venv | exec | INTERACTIVE=0
|
|
857
|
-
| poetry | * | PROJECT=s
|
|
858
|
-
| poetry | depend | NO_ROOT
|
|
889
|
+
| Command | Flag | ENV |
|
|
890
|
+
| :--------- | :-------- | :-------------------------------------------------------- |
|
|
891
|
+
| global | * | CACHE_DIR=0,s PROXY=s PYTHON=s COLOR=0 |
|
|
892
|
+
| depend | - | E|EDITABLE=0,s BUILD_ISOLATION=0 |
|
|
893
|
+
| outdated | - | U|UPDATE=major|minor|patch NOT_REQUIRED=0 L|LOCAL DRY_RUN |
|
|
894
|
+
| venv | exec | INTERACTIVE=0 |
|
|
895
|
+
| poetry | * | PROJECT=s |
|
|
896
|
+
| poetry | depend | NO_ROOT |
|
|
859
897
|
|
|
860
898
|
## LICENSE
|
|
861
899
|
|