squared 0.5.18 → 0.6.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 +87 -105
- data/README.md +101 -69
- data/lib/squared/common/base.rb +1 -22
- data/lib/squared/common/format.rb +40 -34
- data/lib/squared/common/prompt.rb +57 -34
- data/lib/squared/common/shell.rb +71 -55
- data/lib/squared/common/system.rb +69 -36
- data/lib/squared/common/utils.rb +29 -6
- data/lib/squared/config.rb +27 -34
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +80 -81
- data/lib/squared/workspace/project/base.rb +534 -369
- data/lib/squared/workspace/project/docker.rb +376 -273
- data/lib/squared/workspace/project/git.rb +348 -335
- data/lib/squared/workspace/project/node.rb +499 -272
- data/lib/squared/workspace/project/python.rb +332 -203
- data/lib/squared/workspace/project/ruby.rb +664 -354
- data/lib/squared/workspace/project/support/class.rb +192 -188
- data/lib/squared/workspace/repo.rb +43 -41
- data/lib/squared/workspace/series.rb +6 -6
- data/lib/squared/workspace/support/base.rb +3 -24
- data/lib/squared/workspace/support/variables.rb +48 -0
- data/lib/squared/workspace/support.rb +1 -1
- data/lib/squared/workspace.rb +4 -6
- metadata +3 -3
- data/lib/squared/workspace/support/data.rb +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed078210213186745643650b4a73f7f376b5aba7033643c850b48d555c198501
|
|
4
|
+
data.tar.gz: d4d8c0e6308f3bdc3aca66891980259ad52ce11f3a53112c7a22ae4de9e31f40
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fcf308f894ee49566103575561b74459afc1aa7e03af8d5c5397c7bb7432dfce996cbb1291f4f81af792d5b1dd8ed6a9075ce7b2fab6f41dca0c56431e38b78c
|
|
7
|
+
data.tar.gz: 19f25542363b33fa567cbfcb0267c79fbc55a313ce0fba8ab25ec17dd43f276b004b00304e8bfe38dba1338a2e554170a8f1535d1bdc5981407fae6e9bff2bf8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,106 +1,97 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.
|
|
4
|
-
|
|
5
|
-
### Fixed
|
|
6
|
-
|
|
7
|
-
- See `0.5.18`.
|
|
8
|
-
|
|
9
|
-
## [0.4.32] - 2025-11-25
|
|
10
|
-
|
|
11
|
-
### Fixed
|
|
12
|
-
|
|
13
|
-
- Git method commit did not include --dry-run with add command.
|
|
14
|
-
- JoinSet method include? did not always search to start of delimiter.
|
|
15
|
-
- Config viewer did not check for a readable package registry document.
|
|
16
|
-
- Powershell executable did not check for alternate path location.
|
|
17
|
-
|
|
18
|
-
## [0.5.17] - 2025-11-22
|
|
19
|
-
|
|
20
|
-
### Fixed
|
|
21
|
-
|
|
22
|
-
- See `0.4.31`.
|
|
23
|
-
|
|
24
|
-
## [0.4.31] - 2025-11-22
|
|
25
|
-
|
|
26
|
-
### Changed
|
|
27
|
-
|
|
28
|
-
- Project base attribute project was converted into an accessor.
|
|
29
|
-
- Ruby command flag is given precedence to a program file.
|
|
30
|
-
|
|
31
|
-
### Fixed
|
|
32
|
-
|
|
33
|
-
- Repo application tasks are not created on Windows.
|
|
34
|
-
- Repo module used conflicting REPO_URL with Repo application.
|
|
35
|
-
- Project task outdated did not check pass and only exclusions.
|
|
36
|
-
- Workspace static method resolve did nothing when given a String.
|
|
37
|
-
- Project base run command types did not include Struct.
|
|
38
|
-
- Project change directory context did not always restore when raised.
|
|
39
|
-
- Ruby file method attributes did not always return nil.
|
|
40
|
-
- JoinSet with a delimiter did not report correct size.
|
|
41
|
-
|
|
42
|
-
## [0.5.16] - 2025-11-14
|
|
43
|
-
|
|
44
|
-
### Fixed
|
|
45
|
-
|
|
46
|
-
- See `0.4.30`.
|
|
47
|
-
|
|
48
|
-
## [0.4.30] - 2025-11-14
|
|
3
|
+
## [0.6.0] - 2025-10-31
|
|
49
4
|
|
|
50
5
|
### Added
|
|
51
6
|
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
7
|
+
- Docker command compose action create was implemented.
|
|
8
|
+
- Docker command compose action ps was implemented.
|
|
9
|
+
- Docker command compose action ps is interactive.
|
|
10
|
+
- Project base asdf commands [latest|where|update] were implemented.
|
|
11
|
+
- Pip command options were updated to 25.2.
|
|
12
|
+
- Command line programs who do not assign with equals are supported.
|
|
13
|
+
- Docker command ls with column formatting was implemented.
|
|
14
|
+
- Git command stash action staged and worktree were implemented.
|
|
15
|
+
- Git command diff action files can output to a patch file.
|
|
16
|
+
- Repo task init with REPO_Y can auto-accept overwrite confirmation.
|
|
17
|
+
- Caller locations for errors can be excluded using ARG[:BACKTRACE].
|
|
18
|
+
- Node command package action reinstall was implemented.
|
|
19
|
+
- Node class method and command tsc was implemented.
|
|
20
|
+
- Python command pip action reinstall was implemented.
|
|
21
|
+
- Project command options can be stored by class ref and project name.
|
|
22
|
+
- Bundler command config is interactive.
|
|
23
|
+
- Ruby method bundle supports stored command options.
|
|
24
|
+
- Ruby method rake supports stored command options.
|
|
25
|
+
- Ruby method ruby supports stored command options.
|
|
26
|
+
- Ruby method gem supports stored command options.
|
|
27
|
+
- Python method pip supports stored command options.
|
|
28
|
+
- Python command pip action wheel was implemented.
|
|
29
|
+
- Ruby method irb supports stored command options.
|
|
30
|
+
- Ruby command gem action command was implemented.
|
|
31
|
+
- ENV supplementary command options can be space delimited.
|
|
32
|
+
- Project command options can extend other stored options.
|
|
33
|
+
- Ruby command gem action outdated can update without being interactive.
|
|
34
|
+
- Ruby command gem action update system can accept a specific version.
|
|
35
|
+
- Ruby command gem action outdated supports threading.
|
|
36
|
+
- Git command grep was implemented.
|
|
37
|
+
- Common format bright colors fallback to standard colors when not enabled.
|
|
38
|
+
- Project base command unpack action gz was implemented.
|
|
39
|
+
- Common format defined String instance method subhint.
|
|
40
|
+
- Application readers [exception|pipe|verbose|warning] were converted into accessors.
|
|
41
|
+
- Node private projects can publish entire workspace with tags.
|
|
42
|
+
- Node command outdated can select a range of packages to update.
|
|
43
|
+
- Gem command outdated can select a range of packages to update.
|
|
44
|
+
- Python command outdated can select a range of packages to update.
|
|
45
|
+
- Node command outdated option diff was implemented.
|
|
46
|
+
- Bundler command outdated can select a range of packages to update.
|
|
47
|
+
- Common prompt method choice can select all items with "\*".
|
|
48
|
+
- Node command bump can auto-commit package.json using GIT_MESSAGE.
|
|
49
|
+
- Git command options were updated to version 2.51.
|
|
94
50
|
|
|
95
51
|
### Changed
|
|
96
52
|
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
-
|
|
53
|
+
- Git method source will raise error when checking exit status.
|
|
54
|
+
- Date gem is no longer globally required.
|
|
55
|
+
- Global task git:all was removed.
|
|
56
|
+
- Common base method as_a was relocated to Utils.
|
|
57
|
+
- Python command build and publish detects only one backend.
|
|
58
|
+
- Docker command compose action ps was renamed service.
|
|
59
|
+
- Docker command image action list was renamed ls.
|
|
60
|
+
- Project base method success? conditionally calls print_success method.
|
|
61
|
+
- Error classes were not specified for invalid operation.
|
|
62
|
+
- Common format methods stripstyle and stripext are String instance methods.
|
|
63
|
+
- Common format method alias puts_oe was removed.
|
|
64
|
+
- Git commands without a valid action will exit with error status.
|
|
65
|
+
- Errno exceptions are used in place of SystemCallError.
|
|
66
|
+
- Common format method raise_error defaults to RuntimeError.
|
|
67
|
+
- OptionPartition delegator method delete_at was renamed remove_at.
|
|
68
|
+
- Node event name "publish" was renamed to "npm:publish".
|
|
69
|
+
- Project task run with a Method passes self as first argument.
|
|
70
|
+
- Ruby command check was removed.
|
|
71
|
+
- Ruby method gem! was renamed gem.
|
|
72
|
+
- Ruby methods ruby and irb first argument was converted into kwargs.
|
|
73
|
+
- Ruby method rake executes all tasks in one run command.
|
|
74
|
+
- Ruby project file methods return nil instead of false.
|
|
75
|
+
- Ruby commands [exec|cache|config] were relocated under bundle namespace.
|
|
76
|
+
- Ruby command gem action update without arguments is not modified.
|
|
77
|
+
- Ruby command install was replaced with reinstall under bundle namespace.
|
|
78
|
+
- Ruby command update was relocated under bundle namespace.
|
|
79
|
+
- Common prompt confirm timeout was revised for non-immediate responses.
|
|
80
|
+
- Project relative paths are stripped from banner when context is displayed.
|
|
81
|
+
- Workspace module Support extend submodules private methods.
|
|
82
|
+
- Workspace method add passes parent through Project constructor.
|
|
83
|
+
- Project base method run_s uses last argument for ENV hash.
|
|
84
|
+
- Project base method inject does not exit program when raised.
|
|
85
|
+
- Reline gem is installed only when using at least Ruby 3.0.
|
|
86
|
+
- Python method install arguments strategy and user were removed.
|
|
87
|
+
- Project command outdated does not support threading when interactive.
|
|
88
|
+
- Project base accessor global was converted into a reader and setter.
|
|
89
|
+
- Repo build can simultaneously use script and run through REPO_BUILD.
|
|
90
|
+
- Repo static method read_manifest was made an instance method named repo_manifest.
|
|
91
|
+
|
|
92
|
+
### Fixed
|
|
93
|
+
|
|
94
|
+
- Node task update did not check equivalent ENV install options.
|
|
104
95
|
|
|
105
96
|
## [0.5.12] - 2025-10-31
|
|
106
97
|
|
|
@@ -1286,11 +1277,7 @@
|
|
|
1286
1277
|
|
|
1287
1278
|
- Changelog was created.
|
|
1288
1279
|
|
|
1289
|
-
[0.
|
|
1290
|
-
[0.5.16]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.16
|
|
1291
|
-
[0.5.15]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.15
|
|
1292
|
-
[0.5.14]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.14
|
|
1293
|
-
[0.5.13]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.13
|
|
1280
|
+
[0.6.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.0
|
|
1294
1281
|
[0.5.12]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.12
|
|
1295
1282
|
[0.5.11]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.11
|
|
1296
1283
|
[0.5.10]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.10
|
|
@@ -1304,11 +1291,6 @@
|
|
|
1304
1291
|
[0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
|
|
1305
1292
|
[0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
|
|
1306
1293
|
[0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
|
|
1307
|
-
[0.4.31]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.31
|
|
1308
|
-
[0.4.30]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.30
|
|
1309
|
-
[0.4.29]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.29
|
|
1310
|
-
[0.4.28]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.28
|
|
1311
|
-
[0.4.27]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.27
|
|
1312
1294
|
[0.4.26]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.26
|
|
1313
1295
|
[0.4.25]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.25
|
|
1314
1296
|
[0.4.24]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.24
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# squared 0.
|
|
1
|
+
# squared 0.6
|
|
2
2
|
|
|
3
3
|
* [source](https://github.com/anpham6/squared-ruby)
|
|
4
4
|
* [docs](https://squared.readthedocs.io)
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
| 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.3 |
|
|
15
15
|
| ---------- | ----- | ----- | ----- |
|
|
16
16
|
| 2025-08-23 | 0.5.5 | | 3.4.5 |
|
|
17
|
+
| 2025-10-31 | 0.6.0 | | 3.4.7 |
|
|
17
18
|
|
|
18
19
|
The range chart indicates the latest Ruby tested against at the time of release.
|
|
19
20
|
|
|
@@ -23,9 +24,23 @@ The range chart indicates the latest Ruby tested against at the time of release.
|
|
|
23
24
|
gem install squared
|
|
24
25
|
```
|
|
25
26
|
|
|
27
|
+
### Optional
|
|
28
|
+
|
|
29
|
+
* [Repo](https://source.android.com/docs/setup/reference/repo)
|
|
30
|
+
* https://github.com/anpham6/squared-repo
|
|
31
|
+
* Python 3.6
|
|
32
|
+
* Not compatible with Windows
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
mkdir -p ~/.bin
|
|
36
|
+
PATH="${HOME}/.bin:${PATH}"
|
|
37
|
+
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
|
|
38
|
+
chmod a+rx ~/.bin/repo
|
|
39
|
+
```
|
|
40
|
+
|
|
26
41
|
## Example - Rakefile
|
|
27
42
|
|
|
28
|
-
Projects from any accessible folder can be added relative to the parent directory or absolutely. Missing projects will simply be excluded from the task runner.
|
|
43
|
+
Projects from any accessible folder can be added relative to the parent directory (e.g. *REPO_ROOT*) or absolutely. The same Rakefile can also manage other similarly cloned `Repo` repositories remotely by setting the `REPO_ROOT` environment variable to the location. Missing projects will simply be excluded from the task runner.
|
|
29
44
|
|
|
30
45
|
```ruby
|
|
31
46
|
require "squared"
|
|
@@ -41,6 +56,14 @@ require "squared/app" # All workspace related mod
|
|
|
41
56
|
|
|
42
57
|
# NODE_ENV = production
|
|
43
58
|
|
|
59
|
+
# REPO_ROOT = /workspaces |
|
|
60
|
+
# REPO_HOME = /workspaces/squared | Dir.pwd
|
|
61
|
+
# rake = /workspaces/squared/Rakefile | main?
|
|
62
|
+
# OR
|
|
63
|
+
# REPO_ROOT = /workspaces | Dir.pwd
|
|
64
|
+
# rake = /workspaces/Rakefile |
|
|
65
|
+
# REPO_HOME = /workspaces/squared | main: "squared"
|
|
66
|
+
|
|
44
67
|
# pathname = /workspaces/pathname
|
|
45
68
|
# optparse = /workspaces/optparse
|
|
46
69
|
# log = /workspaces/logger
|
|
@@ -55,6 +78,7 @@ require "squared/app" # All workspace related mod
|
|
|
55
78
|
Workspace::Application
|
|
56
79
|
.new(Dir.pwd, main: "squared") # Dir.pwd? (main? is implicitly basename)
|
|
57
80
|
.banner("group", "project", styles: ["yellow", "black"], border: "bold") # name | project | path | ref | group? | parent? | version?
|
|
81
|
+
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "build:prod"], ref: :node) # Repo (optional)
|
|
58
82
|
.run("rake install", ref: :ruby)
|
|
59
83
|
.depend(false, group: "default")
|
|
60
84
|
.clean("rake clean", group: "default")
|
|
@@ -119,20 +143,59 @@ Workspace::Application
|
|
|
119
143
|
# android = /workspaces/android-docs
|
|
120
144
|
# chrome = /workspaces/chrome-docs
|
|
121
145
|
|
|
146
|
+
# ...symbol?, string, ...string?, ...symbol?
|
|
147
|
+
# extend name args project
|
|
148
|
+
|
|
149
|
+
Node = Workspace::Project::Node # tsc
|
|
150
|
+
Node.options("build:dev", "target=es2022", project: "tsconfig.json") # :node (ref)
|
|
151
|
+
Node.options("build:dev", "outDir=tmp", :squared) # squared (project name)
|
|
152
|
+
|
|
153
|
+
Ruby = Workspace::Project::Ruby # ruby | gem | rake | bundle | irb
|
|
154
|
+
Ruby.options("lint", "rubocop", opts: ["gemfile=Gemfile"]) # :ruby
|
|
155
|
+
Ruby.options("lint", "--parallel", :squared)
|
|
156
|
+
|
|
157
|
+
Python = Workspace::Project::Python # pip
|
|
158
|
+
Python.options("build", opts: ["r=requirements.txt"]) # :python
|
|
159
|
+
Python.options(:build, "build:dev", opts: ["no-deps"])
|
|
160
|
+
|
|
122
161
|
Workspace::Application
|
|
123
|
-
.new(ENV["SQUARED_HOME"], prefix: "rb", common: false)
|
|
162
|
+
.new(ENV["SQUARED_HOME"], prefix: "rb", common: false) # Local styles
|
|
124
163
|
.group("ruby", "default", run: "rake build", copy: "rake install", clean: "rake clean", ref: :ruby, override: {
|
|
125
164
|
pathname: {
|
|
126
|
-
run: "rake compile"
|
|
165
|
+
run: "rake compile" # rake rb:pathname:build
|
|
127
166
|
}
|
|
128
167
|
})
|
|
129
|
-
.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
168
|
+
.add("squared") do
|
|
169
|
+
apply :run, proc { # rake rb:squared:build
|
|
170
|
+
tsc(with: scriptname || "build:dev", verbose: true) # Repo (global)
|
|
171
|
+
# OR
|
|
172
|
+
tsc("target=es2022", "outDir=tmp", project: "tsconfig.json") # 1
|
|
173
|
+
tsc("clean=true", "./sqd/tsconfig.json", build: true) # 2
|
|
174
|
+
run("npm run build:dev", { "RUBYOPT" => "-W2" }, from: :run) # 3
|
|
175
|
+
|
|
176
|
+
# Parallel
|
|
177
|
+
[
|
|
178
|
+
Thread.new { tsc(sync: false) },
|
|
179
|
+
Thread.new { tsc(sync: false) },
|
|
180
|
+
Thread.new { run(sync: false) }
|
|
181
|
+
]
|
|
182
|
+
.each(&:join)
|
|
183
|
+
}
|
|
184
|
+
apply :lint, proc {
|
|
185
|
+
bundle("exec", "-A --cache=true", with: "lint", verbose: true) # bundle exec --gemfile='/squared/Gemfile' rubocop --parallel -A --cache=true
|
|
186
|
+
}
|
|
187
|
+
end
|
|
188
|
+
.with(:python, editable: false) do # ref=Symbol | group=String
|
|
189
|
+
banner([:name, ": ", :version], "path") # chrome-docs: 0.1.0 | /workspaces/chrome-docs
|
|
190
|
+
doc("make html") # rake rb:doc:python
|
|
191
|
+
run(false) # rake rb:build:python (disabled)
|
|
192
|
+
exclude(%i[base git]) # Project::Git.ref (superclass)
|
|
193
|
+
add("android-docs", "android") # rake rb:android:doc
|
|
194
|
+
add("chrome-docs", "chrome") do # rake rb:chrome:doc
|
|
195
|
+
apply :run, proc {
|
|
196
|
+
pip("wheel", with: "build:dev") # pip wheel -r '/chrome-docs/requirements.txt' --no-deps
|
|
197
|
+
}
|
|
198
|
+
end
|
|
136
199
|
end
|
|
137
200
|
.style("inline", "bold")
|
|
138
201
|
.build
|
|
@@ -473,28 +536,28 @@ Non-task:
|
|
|
473
536
|
|
|
474
537
|
Most project classes will inherit from `Git` which enables these tasks:
|
|
475
538
|
|
|
476
|
-
| Task | Git | Command
|
|
477
|
-
| :--------- | :--------------- |
|
|
478
|
-
| branch | branch | create track delete move copy list current
|
|
479
|
-
| checkout | checkout | commit branch track detach path
|
|
480
|
-
| commit | commit | add all amend amend-orig fixup
|
|
481
|
-
| diff | diff | head branch files view between contain
|
|
482
|
-
| fetch | fetch | origin remote all
|
|
483
|
-
| files | ls-files | cached modified deleted others
|
|
484
|
-
| git | | add blame clean mv revert rm status
|
|
485
|
-
| log | log | view between contain
|
|
486
|
-
| merge | merge | commit no-commit send
|
|
487
|
-
| pull | pull | origin remote all
|
|
488
|
-
| rebase | rebase | branch onto send
|
|
489
|
-
| refs | ls-remote --refs | heads tags remote
|
|
490
|
-
| reset | reset | commit index patch mode undo
|
|
491
|
-
| restore | restore | source staged worktree
|
|
492
|
-
| rev | rev | commit build output
|
|
493
|
-
| show | show | format oneline textconv
|
|
494
|
-
| stash | stash | push pop apply branch drop clear list all
|
|
495
|
-
| submodule | submodule | status update branch url sync
|
|
496
|
-
| switch | switch | branch create detach
|
|
497
|
-
| tag | tag | add sign delete list
|
|
539
|
+
| Task | Git | Command |
|
|
540
|
+
| :--------- | :--------------- | :-------------------------------------------------------- |
|
|
541
|
+
| branch | branch | create track delete move copy list current |
|
|
542
|
+
| checkout | checkout | commit branch track detach path |
|
|
543
|
+
| commit | commit | add all amend amend-orig fixup |
|
|
544
|
+
| diff | diff | head branch files view between contain |
|
|
545
|
+
| fetch | fetch | origin remote all |
|
|
546
|
+
| files | ls-files | cached modified deleted others |
|
|
547
|
+
| git | | add blame clean grep mv revert rm status |
|
|
548
|
+
| log | log | view between contain |
|
|
549
|
+
| merge | merge | commit no-commit send |
|
|
550
|
+
| pull | pull | origin remote all |
|
|
551
|
+
| rebase | rebase | branch onto send |
|
|
552
|
+
| refs | ls-remote --refs | heads tags remote |
|
|
553
|
+
| reset | reset | commit index patch mode undo |
|
|
554
|
+
| restore | restore | source staged worktree |
|
|
555
|
+
| rev | rev | commit build output |
|
|
556
|
+
| show | show | format oneline textconv |
|
|
557
|
+
| stash | stash | push pop apply branch drop clear list all staged worktree |
|
|
558
|
+
| submodule | submodule | status update branch url sync |
|
|
559
|
+
| switch | switch | branch create detach |
|
|
560
|
+
| tag | tag | add sign delete list |
|
|
498
561
|
|
|
499
562
|
You can disable all of them at once using the `exclude` property.
|
|
500
563
|
|
|
@@ -609,7 +672,7 @@ LOG_LEVEL # See gem "logger"
|
|
|
609
672
|
|
|
610
673
|
### Git
|
|
611
674
|
|
|
612
|
-
* Version: [2.
|
|
675
|
+
* Version: [2.51](https://github.com/git/git/blob/v2.51.0/Documentation/RelNotes/2.51.0.adoc)
|
|
613
676
|
|
|
614
677
|
```sh
|
|
615
678
|
GIT_OPTIONS=q,strategy=ort # all
|
|
@@ -707,58 +770,27 @@ Workspace::Application
|
|
|
707
770
|
|
|
708
771
|
### Repo
|
|
709
772
|
|
|
710
|
-
|
|
711
|
-
* https://github.com/anpham6/squared-repo
|
|
712
|
-
* Python 3.6
|
|
713
|
-
* Not compatible with Windows
|
|
714
|
-
|
|
715
|
-
```sh
|
|
716
|
-
mkdir -p ~/.bin
|
|
717
|
-
PATH="${HOME}/.bin:${PATH}"
|
|
718
|
-
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
|
|
719
|
-
chmod a+rx ~/.bin/repo
|
|
720
|
-
```
|
|
721
|
-
|
|
722
|
-
```ruby
|
|
723
|
-
# REPO_ROOT = /workspaces |
|
|
724
|
-
# REPO_HOME = /workspaces/squared | Dir.pwd
|
|
725
|
-
# rake = /workspaces/squared/Rakefile | main?
|
|
726
|
-
#
|
|
727
|
-
# OR
|
|
728
|
-
#
|
|
729
|
-
# REPO_ROOT = /workspaces | Dir.pwd
|
|
730
|
-
# rake = /workspaces/Rakefile |
|
|
731
|
-
# REPO_HOME = /workspaces/squared | main: "squared"
|
|
732
|
-
|
|
733
|
-
Workspace::Application
|
|
734
|
-
.new(main: "squared")
|
|
735
|
-
.repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], ref: :node)
|
|
736
|
-
.add("squared", script: ["build:stage1", "build:stage2"])
|
|
737
|
-
.build
|
|
738
|
-
```
|
|
739
|
-
|
|
740
|
-
These global options also can target the application main suffix `${NAME}`. (e.g. *REPO_ROOT_SQUARED*)
|
|
773
|
+
These global options also can target the application main suffix `${NAME}`. (e.g. REPO_ROOT_SQUARED)
|
|
741
774
|
|
|
742
775
|
```sh
|
|
743
776
|
REPO_ROOT # parent dir
|
|
744
777
|
REPO_HOME # project dir (main)
|
|
745
|
-
REPO_BUILD # run,
|
|
778
|
+
REPO_BUILD # script,run (e.g. build:dev | build:dev,make install | make)
|
|
746
779
|
REPO_GROUP # string
|
|
747
780
|
REPO_REF # e.g. ruby,node
|
|
748
781
|
REPO_DEV # pattern,0,1
|
|
749
782
|
REPO_PROD # pattern,0,1
|
|
750
783
|
REPO_WARN # 0,1
|
|
751
784
|
REPO_SYNC # 0,1
|
|
752
|
-
|
|
785
|
+
REPO_URL # manifest repository
|
|
753
786
|
REPO_MANIFEST # e.g. latest,nightly,prod
|
|
754
787
|
REPO_GROUPS # e.g. base,prod,docs
|
|
755
788
|
REPO_STAGE # 0,1,2,3,4
|
|
756
789
|
REPO_SUBMODULLES # 0,1
|
|
790
|
+
REPO_Y # 0,1
|
|
757
791
|
REPO_TIMEOUT # confirm dialog (seconds)
|
|
758
792
|
```
|
|
759
793
|
|
|
760
|
-
Other similarly cloned `Repo` repositories can be managed remotely by setting the `REPO_ROOT` environment variable to the location.
|
|
761
|
-
|
|
762
794
|
## LICENSE
|
|
763
795
|
|
|
764
796
|
BSD 3-Clause
|
data/lib/squared/common/base.rb
CHANGED
|
@@ -17,6 +17,7 @@ module Squared
|
|
|
17
17
|
GRAPH: ['|', '-', '|', '\\', '-'].freeze,
|
|
18
18
|
BORDER: ['|', '-', '-', '-', '-', '-', '|', '|', '-', '-'].freeze,
|
|
19
19
|
VIEW: 'view',
|
|
20
|
+
BACKTRACE: $DEBUG || !$VERBOSE.nil?,
|
|
20
21
|
LEVEL: ENV.fetch('LOG_LEVEL', 0).to_i,
|
|
21
22
|
COLOR: ENV.fetch('NO_COLOR', '').empty?
|
|
22
23
|
}
|
|
@@ -97,27 +98,5 @@ module Squared
|
|
|
97
98
|
VAR[:theme].each_value { |val| val.freeze.each_value(&:freeze) }
|
|
98
99
|
VAR.freeze
|
|
99
100
|
end
|
|
100
|
-
|
|
101
|
-
module_function
|
|
102
|
-
|
|
103
|
-
def as_a(obj, *meth, flat: nil, compact: false, &blk)
|
|
104
|
-
return [] if obj.nil?
|
|
105
|
-
|
|
106
|
-
unless obj.is_a?(::Array)
|
|
107
|
-
obj = if obj.respond_to?(:to_ary)
|
|
108
|
-
obj.to_ary
|
|
109
|
-
elsif obj.respond_to?(:to_a) && !obj.is_a?(::Hash) && (val = obj.to_a).is_a?(::Array)
|
|
110
|
-
val
|
|
111
|
-
else
|
|
112
|
-
[obj]
|
|
113
|
-
end
|
|
114
|
-
end
|
|
115
|
-
obj = flat.is_a?(::Numeric) ? obj.flatten(flat) : obj.flatten if flat
|
|
116
|
-
obj = obj.compact if compact
|
|
117
|
-
obj = obj.map(&meth.shift) until meth.empty?
|
|
118
|
-
return obj unless block_given?
|
|
119
|
-
|
|
120
|
-
obj.select(&blk)
|
|
121
|
-
end
|
|
122
101
|
end
|
|
123
102
|
end
|