squared 0.2.13 → 0.3.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 +54 -158
- data/README.ruby.md +150 -68
- data/lib/squared/common/base.rb +5 -6
- data/lib/squared/common/class.rb +27 -2
- data/lib/squared/common/format.rb +13 -15
- data/lib/squared/common/prompt.rb +1 -1
- data/lib/squared/common/shell.rb +11 -13
- data/lib/squared/common/system.rb +14 -21
- data/lib/squared/common/utils.rb +24 -13
- data/lib/squared/config.rb +4 -5
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +69 -41
- data/lib/squared/workspace/project/base.rb +356 -172
- data/lib/squared/workspace/project/git.rb +556 -359
- data/lib/squared/workspace/project/node.rb +250 -114
- data/lib/squared/workspace/project/python.rb +101 -78
- data/lib/squared/workspace/project/ruby.rb +182 -172
- data/lib/squared/workspace/repo.rb +10 -5
- data/lib/squared/workspace/series.rb +10 -4
- data/squared.gemspec +0 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ffee6667b4033ad1987ad90e83c912134bfbc449efbbe1d6c90e3370fd568d1
|
4
|
+
data.tar.gz: 5ded113c3c6058688db13120068f35983decfcf772af8f67318a073bf65c7e9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddbfe113d51f8f89fbc20c950b6de97a9800a8c76dffb04a1ba8e56708a7c3142b1007e1678368df662e9b340ff567d93aeb781656e92a262fa1a417f05f7bb7
|
7
|
+
data.tar.gz: ee09e3e0766d396c644ee7be9ef0e88461fec646e57e4e5c58949042d3a87697215f8069781ef1116d12cf0cdda10b62ab609ded409da954f28a85d6489c12f6
|
data/CHANGELOG.md
CHANGED
@@ -1,155 +1,67 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [0.
|
4
|
-
|
5
|
-
### Fixed
|
6
|
-
|
7
|
-
- Project graph did not ignore circular references.
|
8
|
-
|
9
|
-
## [0.1.10] - 2025-07-16
|
10
|
-
|
11
|
-
### Fixed
|
12
|
-
|
13
|
-
- Module namespaces were not combined in the right order.
|
14
|
-
- Workspace group tasks were not registered.
|
15
|
-
|
16
|
-
## [0.2.12] - 2025-07-05
|
17
|
-
|
18
|
-
### Fixed
|
19
|
-
|
20
|
-
- See `0.1.9`.
|
21
|
-
|
22
|
-
## [0.1.9] - 2025-07-05
|
3
|
+
## [0.3.0] - 2025-02-07
|
23
4
|
|
24
5
|
### Added
|
25
6
|
|
26
|
-
-
|
27
|
-
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
-
|
43
|
-
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
-
|
50
|
-
- Log messages were written to terminal twice when emphasized.
|
51
|
-
- Node outdated interactive for major would sometimes deactivate.
|
52
|
-
- Node outdated interactive for major was mislabeled as minor.
|
53
|
-
|
54
|
-
## [0.2.10] - 2025-04-27
|
55
|
-
|
56
|
-
### Fixed
|
57
|
-
|
58
|
-
- Project run and script tasks did not fire first and last callbacks.
|
59
|
-
- Git command clone did not read booleans for recurse-submodules.
|
60
|
-
|
61
|
-
## [0.1.7] - 2025-04-27
|
62
|
-
|
63
|
-
### Fixed
|
64
|
-
|
65
|
-
- Project directory context method option pass was inverted.
|
66
|
-
- Shell options with spaces and without quotes were not escaped.
|
67
|
-
- Git task status did not display branch information.
|
68
|
-
- Ruby copy method argument include was ignored when used directly.
|
69
|
-
- Git commit could not push branch without same name as remote.
|
70
|
-
|
71
|
-
## [0.2.9] - 2025-04-17
|
7
|
+
- NPM command publish was implemented.
|
8
|
+
- Globally created tasks can be excluded.
|
9
|
+
- Application method pass for project references was created.
|
10
|
+
- Gem command push was implemented.
|
11
|
+
- Gem command build was implemented.
|
12
|
+
- Gem command exec was implemented.
|
13
|
+
- Gem command check was implemented.
|
14
|
+
- NPM command install was implemented.
|
15
|
+
- NPM command dedupe was implemented.
|
16
|
+
- NPM command update was implemented.
|
17
|
+
- Double quotes can be used for shell option values.
|
18
|
+
- Global build commands can be aliased to alternate commands.
|
19
|
+
- Graph can be run with certain projects excluded.
|
20
|
+
- Workspace home folder can be set through ENV.
|
21
|
+
- Global task command lint was created.
|
22
|
+
- NPM command pack was implemented.
|
23
|
+
- Git command checkout and reset action commit was implemented.
|
24
|
+
- Application method script with pass-through args was created.
|
25
|
+
- Project build options can be overwritten with ENV build types.
|
26
|
+
- Pip install action editable was implemented.
|
27
|
+
- Git command log was implemented.
|
28
|
+
- Node package managers can update as depend with NODE_UPDATE.
|
29
|
+
- NPM install commands were grouped under package namespace.
|
30
|
+
- Node global task command update was created.
|
72
31
|
|
73
32
|
### Changed
|
74
33
|
|
75
|
-
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
-
|
80
|
-
- Git
|
81
|
-
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
### Fixed
|
100
|
-
|
101
|
-
- Paths that conflict with git options can be quoted.
|
102
|
-
- Bundle command update did not append package names.
|
103
|
-
- Git result status type was truncated.
|
104
|
-
- Log messages were concatenated without separator.
|
105
|
-
- Python pip environment options used undefined session.
|
106
|
-
- Regexp "o" modifier was not used properly.
|
107
|
-
- Rake did not run individual project Rakefile.
|
108
|
-
- Ruby commands did not delimit exec arguments.
|
109
|
-
|
110
|
-
## [0.2.6] - 2025-03-06
|
111
|
-
|
112
|
-
### Fixed
|
113
|
-
|
114
|
-
- Git rebase did not include flag with pull command.
|
115
|
-
|
116
|
-
## [0.2.5] - 2025-02-25
|
117
|
-
|
118
|
-
### Fixed
|
119
|
-
|
120
|
-
- See `0.1.5`.
|
121
|
-
|
122
|
-
## [0.1.5] - 2025-02-25
|
123
|
-
|
124
|
-
### Fixed
|
125
|
-
|
126
|
-
- Node copy method ignored include argument when called directly.
|
127
|
-
- Logger is not initialized when using only Git base class.
|
128
|
-
- Hide warnings about readline during execution.
|
129
|
-
- Logger is not initialized when using only base class.
|
130
|
-
- Merging ENV build options were double escaped.
|
131
|
-
|
132
|
-
## [0.2.4] - 2025-02-12
|
133
|
-
|
134
|
-
### Fixed
|
135
|
-
|
136
|
-
- Git status did not show ignored or untracked files.
|
137
|
-
- Caller locations were not compatible with Ruby 2.4.
|
34
|
+
- Global project command options use a private namespace hash.
|
35
|
+
- Global git command options use a private namespace hash.
|
36
|
+
- Base command options can be constructed from a hash.
|
37
|
+
- Git refs and files with complete options were implemented.
|
38
|
+
- Git tag action list with complete options was implemented.
|
39
|
+
- Git stash per action with complete options was implemented.
|
40
|
+
- Git diff with complete options was implemented.
|
41
|
+
- Git checkout action path with complete options was implemented.
|
42
|
+
- Git reset with complete options was implemented.
|
43
|
+
- Git restore with complete options was implemented.
|
44
|
+
- Git show with complete options was implemented.
|
45
|
+
- Git rev-parse with complete options was implemented.
|
46
|
+
- Git rebase with complete options was implemented.
|
47
|
+
- Ruby class kwargs opts was converted to optional parameter.
|
48
|
+
- Git methods use second parameter for command line options.
|
49
|
+
- Project base methods can run multiple commands per task.
|
50
|
+
- Project base methods except clean use same run wrapper.
|
51
|
+
- Bundle install uses a separate isolated method.
|
52
|
+
- Git branch action set negate symbol was inconsistent.
|
53
|
+
- Workspace applications have name suffixed ENV settings.
|
54
|
+
|
55
|
+
### Fixed
|
56
|
+
|
57
|
+
- ENV command options did not take precedence to inline options.
|
138
58
|
|
139
59
|
## [0.2.3] - 2025-02-05
|
140
60
|
|
141
61
|
### Fixed
|
142
62
|
|
143
|
-
- Project hash options duplicated dash prefix.
|
144
|
-
|
145
|
-
## [0.1.4] - 2025-02-05
|
146
|
-
|
147
|
-
### Fixed
|
148
|
-
|
149
|
-
- Build options with array args were not recognized.
|
150
|
-
- Base clean command did not enumerate non-string values.
|
151
|
-
- Git command refs did not include ref option.
|
152
|
-
- Pip upgrade did not append package names.
|
63
|
+
- Project hash options duplicated dash prefix.
|
64
|
+
- Pip upgrade did not append package names.
|
153
65
|
|
154
66
|
## [0.2.2] - 2025-01-19
|
155
67
|
|
@@ -241,7 +153,7 @@
|
|
241
153
|
- Node tasks without any action are not displayed.
|
242
154
|
- Git fetch commands that do not apply to pull are rejected.
|
243
155
|
|
244
|
-
## [0.1.3] -
|
156
|
+
## [0.1.3] - 2024-01-02
|
245
157
|
|
246
158
|
### Fixed
|
247
159
|
|
@@ -270,7 +182,7 @@
|
|
270
182
|
- Workspace did not check base project for Windows filename.
|
271
183
|
- Regexp for SemVer did not recognize package names.
|
272
184
|
|
273
|
-
## [0.1.1] -
|
185
|
+
## [0.1.1] - 2025-12-14
|
274
186
|
|
275
187
|
### Added
|
276
188
|
|
@@ -320,27 +232,11 @@
|
|
320
232
|
|
321
233
|
- Changelog was created.
|
322
234
|
|
323
|
-
[0.
|
324
|
-
[0.2.12]: https://github.com/anpham6/squared/releases/tag/v0.2.12-ruby
|
325
|
-
[0.2.11]: https://github.com/anpham6/squared/releases/tag/v0.2.11-ruby
|
326
|
-
[0.2.10]: https://github.com/anpham6/squared/releases/tag/v0.2.10-ruby
|
327
|
-
[0.2.9]: https://github.com/anpham6/squared/releases/tag/v0.2.9-ruby
|
328
|
-
[0.2.8]: https://github.com/anpham6/squared/releases/tag/v0.2.8-ruby
|
329
|
-
[0.2.7]: https://github.com/anpham6/squared/releases/tag/v0.2.7-ruby
|
330
|
-
[0.2.6]: https://github.com/anpham6/squared/releases/tag/v0.2.6-ruby
|
331
|
-
[0.2.5]: https://github.com/anpham6/squared/releases/tag/v0.2.5-ruby
|
332
|
-
[0.2.4]: https://github.com/anpham6/squared/releases/tag/v0.2.4-ruby
|
235
|
+
[0.3.0]: https://github.com/anpham6/squared/releases/tag/v0.3.0-ruby
|
333
236
|
[0.2.3]: https://github.com/anpham6/squared/releases/tag/v0.2.3-ruby
|
334
237
|
[0.2.2]: https://github.com/anpham6/squared/releases/tag/v0.2.2-ruby
|
335
238
|
[0.2.1]: https://github.com/anpham6/squared/releases/tag/v0.2.1-ruby
|
336
239
|
[0.2.0]: https://github.com/anpham6/squared/releases/tag/v0.2.0-ruby
|
337
|
-
[0.1.10]: https://github.com/anpham6/squared/releases/tag/v0.1.10-ruby
|
338
|
-
[0.1.9]: https://github.com/anpham6/squared/releases/tag/v0.1.9-ruby
|
339
|
-
[0.1.8]: https://github.com/anpham6/squared/releases/tag/v0.1.8-ruby
|
340
|
-
[0.1.7]: https://github.com/anpham6/squared/releases/tag/v0.1.7-ruby
|
341
|
-
[0.1.6]: https://github.com/anpham6/squared/releases/tag/v0.1.6-ruby
|
342
|
-
[0.1.5]: https://github.com/anpham6/squared/releases/tag/v0.1.5-ruby
|
343
|
-
[0.1.4]: https://github.com/anpham6/squared/releases/tag/v0.1.4-ruby
|
344
240
|
[0.1.3]: https://github.com/anpham6/squared/releases/tag/v0.1.3-ruby
|
345
241
|
[0.1.2]: https://github.com/anpham6/squared/releases/tag/v0.1.2-ruby
|
346
242
|
[0.1.1]: https://github.com/anpham6/squared/releases/tag/v0.1.1-ruby
|
data/README.ruby.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# squared 0.
|
1
|
+
# squared 0.3
|
2
2
|
|
3
3
|
* [source](https://github.com/anpham6/squared)
|
4
4
|
* [manifest](https://github.com/anpham6/squared-repo)
|
@@ -6,10 +6,11 @@
|
|
6
6
|
|
7
7
|
## Version Compatibility
|
8
8
|
|
9
|
-
| Date | squared | Min | Max |
|
10
|
-
| :--------: | ------: | -----: | -----: |
|
11
|
-
| 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 |
|
12
|
-
| 2025-01-07 | 0.2.0 | 2.4.0 | 3.4.0 |
|
9
|
+
| Date | squared | Min | Max | Git |
|
10
|
+
| :--------: | ------: | -----: | -----: | -----: |
|
11
|
+
| 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 | 2.39 |
|
12
|
+
| 2025-01-07 | 0.2.0 | 2.4.0 | 3.4.0 | 2.39 |
|
13
|
+
| 2025-02-07 | 0.3.0 | 2.4.0 | 3.4.1 | 2.39 |
|
13
14
|
|
14
15
|
The range chart indicates the latest Ruby tested against at the time of release.
|
15
16
|
|
@@ -84,6 +85,10 @@ Workspace::Application
|
|
84
85
|
.add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node) # Node
|
85
86
|
.add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
|
86
87
|
.add("squared", script: ["build:stage1", "build:stage2"], group: "app") do # Copy target (main)
|
88
|
+
# Repo (global)
|
89
|
+
as(:run, "build:dev", "dev") # npm run build:dev -> npm run dev
|
90
|
+
as(:run, { "build:dev": "dev", "build:prod": "prod" })
|
91
|
+
|
87
92
|
add("publish/sqd-cli", "cli", exclude: [:git]) # rake cli:build
|
88
93
|
add("publish/sqd-serve") # rake sqd-serve:build
|
89
94
|
add("publish/sqd-admin", group: "sqd", exclude: [:base])
|
@@ -97,8 +102,9 @@ Workspace::Application
|
|
97
102
|
variable_set :depend, false
|
98
103
|
variable_set :clean, ["build/sqd/"]
|
99
104
|
end
|
105
|
+
.pass("pull", group: "default") { test? || doc? } # pathname:pull | optparse:pull
|
100
106
|
.style("banner", 255.255) # 256 colors (fg | fg.bg | -0.bg)
|
101
|
-
.build(default: "build", parallel: ["pull", "fetch", "rebase", "copy", "clean", /^outdated:/]) do |workspace|
|
107
|
+
.build(default: "build", parallel: ["pull", "fetch", "rebase", "copy", "clean", /^outdated:/], pass: ['publish']) do |workspace|
|
102
108
|
workspace
|
103
109
|
.enable_aixterm
|
104
110
|
.style({
|
@@ -143,41 +149,41 @@ The task is only active when the project directory is empty or does not exist.
|
|
143
149
|
Workspace::Application
|
144
150
|
.new(main: "squared")
|
145
151
|
.git(
|
146
|
-
"emc": "https://github.com/anpham6/e-mc",
|
147
|
-
"pir": {
|
148
|
-
uri: "https://github.com/anpham6/pi-r",
|
149
|
-
options: {
|
150
|
-
"origin": "github",
|
151
|
-
"recurse-submodules": false,
|
152
|
-
"shallow-exclude": ["v0.0.1", "v0.0.2"]
|
152
|
+
"emc": "https://github.com/anpham6/e-mc", # rake emc:clone
|
153
|
+
"pir": { # rake pir:clone
|
154
|
+
uri: "https://github.com/anpham6/pi-r", #
|
155
|
+
options: { #
|
156
|
+
"origin": "github", # --origin='github'
|
157
|
+
"recurse-submodules": false, # --no-recurse-submodules
|
158
|
+
"shallow-exclude": ["v0.0.1", "v0.0.2"] # --shallow-exclude='v0.0.1' --shallow-exclude='v0.0.2'
|
153
159
|
}
|
154
160
|
}
|
155
161
|
)
|
156
|
-
.git("squared", "/path/to/squared", options: { local: true })
|
162
|
+
.git("squared", "/path/to/squared", options: { local: true }) # Relative paths resolve from workspace root
|
157
163
|
.git(
|
158
164
|
{
|
159
|
-
emc: { uri: "e-mc", options: { "depth": 2 } },
|
160
|
-
pir: "pi-r"
|
165
|
+
emc: { uri: "e-mc", options: { "depth": 2 } }, # https://github.com/anpham6/e-mc
|
166
|
+
pir: "pi-r" # Maps task alias to repository folder
|
161
167
|
},
|
162
|
-
base: "https://github.com/anpham6",
|
163
|
-
repo: ["squared", "android-docs", "chrome-docs"],
|
164
|
-
options: {
|
168
|
+
base: "https://github.com/anpham6", # Required
|
169
|
+
repo: ["squared", "android-docs", "chrome-docs"], # https://github.com/anpham6/squared
|
170
|
+
options: { # Only "repo"
|
165
171
|
"depth": 1,
|
166
172
|
"quiet": true
|
167
173
|
}
|
168
174
|
)
|
169
|
-
.with(:node) do
|
170
|
-
add("e-mc", "emc")
|
171
|
-
add("pi-r", "pir")
|
172
|
-
add("squared")
|
175
|
+
.with(:node) do # rake clone:node
|
176
|
+
add("e-mc", "emc") # https://github.com/anpham6/e-mc
|
177
|
+
add("pi-r", "pir") # https://github.com/anpham6/pi-r
|
178
|
+
add("squared") # https://github.com/anpham6/squared
|
173
179
|
end
|
174
|
-
.with(:python) do
|
180
|
+
.with(:python) do # rake clone:python
|
175
181
|
add("android-docs")
|
176
182
|
add("chrome-docs")
|
177
183
|
end
|
178
|
-
.git("https://github.com/anpham6")
|
179
|
-
.git("https://github.com/anpham6", ["emc", "pir"])
|
180
|
-
.build(parallel: ["clone"])
|
184
|
+
.git("https://github.com/anpham6") # Uses already defined root projects
|
185
|
+
.git("https://github.com/anpham6", ["emc", "pir"]) # Targets any defined project
|
186
|
+
.build(parallel: ["clone"]) # rake clone + rake clone:sync
|
181
187
|
```
|
182
188
|
|
183
189
|
### Graph
|
@@ -191,17 +197,21 @@ Workspace::Application
|
|
191
197
|
add("chrome-docs", "chrome", graph: "android")
|
192
198
|
end
|
193
199
|
.with(:node) do
|
194
|
-
graph(["build", "copy"], on: {
|
200
|
+
graph(["build", "copy"], on: { # Overrides "git"
|
195
201
|
first: proc { puts "1" },
|
196
202
|
last: proc { puts "2" }
|
197
203
|
})
|
204
|
+
script("build:dev") # npm run build:dev
|
205
|
+
# OR
|
206
|
+
run([nil, "build:dev", { "PATH" => "~/.bin" }, "--workspace", "--silent"]) # PATH="~/.bin" npm run build:dev --workspace -- --silent
|
207
|
+
|
198
208
|
add("e-mc", "emc") do
|
199
|
-
first("build", "emc:clean", "emc:depend")
|
200
|
-
last("build", out: "123") { |out: nil| puts out }
|
201
|
-
error("build") { |err: nil| log.debug err }
|
209
|
+
first("build", "emc:clean", "emc:depend") # rake emc:clean && rake emc:depend && rake emc:build && echo "123"
|
210
|
+
last("build", out: "123") { |out: nil| puts out } #
|
211
|
+
error("build") { |err: nil| log.debug err } #
|
202
212
|
end
|
203
213
|
add("pi-r", "pir", graph: "emc", first: {
|
204
|
-
build: proc { puts self.name }
|
214
|
+
build: proc { puts self.name } # puts "pir"
|
205
215
|
})
|
206
216
|
add("squared-express", "express", graph: "pir")
|
207
217
|
add("squared", graph: ["chrome", "express"]) do
|
@@ -210,11 +220,22 @@ Workspace::Application
|
|
210
220
|
end
|
211
221
|
end
|
212
222
|
.with(:ruby) do
|
213
|
-
|
223
|
+
run("gem build") # gem build
|
224
|
+
# OR
|
225
|
+
run(["gem build", "--force", { "RUBY_VERSION" => "3.4.0" }]) # RUBY_VERSION="3.4.0" gem build --force
|
226
|
+
# OR
|
227
|
+
run(["gem pristine", ["gem build", "gem cleanup"], nil, "--debug"]) # gem pristine --debug && gem build --debug && gem cleanup --debug
|
228
|
+
# OR
|
229
|
+
run([ # PATH="~/.bin" GEM_HOME="~/.gems/ruby-3.4.0" (merged)
|
230
|
+
["gem pristine", "--all", { "PATH" => "~/.bin" }, "--silent"], # gem pristine --silent --all
|
231
|
+
["gem build", { strict: true }, { "GEM_HOME" => "~/.gems/ruby-3.4.0" }] # gem build --strict
|
232
|
+
])
|
233
|
+
|
234
|
+
add("pathname", test: ["rake test", { jobs: ENV["RAKE_JOBS"] }]) # rake test --jobs 4
|
214
235
|
add("fileutils", graph: "pathname")
|
215
|
-
add("optparse")
|
236
|
+
add("optparse", run: "gem build", env: { "PATH" => "~/.bin" }, opts: "-v") # PATH="~/.bin" gem build -v
|
216
237
|
add("rake", graph: ["fileutils", "optparse"])
|
217
|
-
banner(command: false)
|
238
|
+
banner(command: false) # Always hide banner
|
218
239
|
end
|
219
240
|
.build
|
220
241
|
```
|
@@ -229,6 +250,9 @@ rake graph:node # same
|
|
229
250
|
rake rake:graph # pathname + fileutils + optparse + rake
|
230
251
|
rake graph:ruby # same
|
231
252
|
rake graph # graph:node + graph:ruby
|
253
|
+
|
254
|
+
rake squared:graph:run[express,pir] # emc + pir + express + squared
|
255
|
+
rake squared:graph:run[node,-emc] # pir + express + squared
|
232
256
|
```
|
233
257
|
|
234
258
|
### Batch
|
@@ -288,10 +312,12 @@ rake squared:outdated:workspace # cli + sqd-serve + sqd-admin
|
|
288
312
|
Task:
|
289
313
|
|
290
314
|
* run
|
315
|
+
* script
|
291
316
|
* depend
|
292
317
|
* graph
|
293
|
-
* test
|
294
318
|
* doc
|
319
|
+
* lint
|
320
|
+
* test
|
295
321
|
* clean
|
296
322
|
|
297
323
|
Non-task:
|
@@ -332,51 +358,107 @@ Common::PATH.merge!({
|
|
332
358
|
### Build
|
333
359
|
|
334
360
|
```ruby
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
# :env
|
342
|
-
#
|
343
|
-
BUILD_${NAME}
|
344
|
-
BUILD_${NAME}_OPTS
|
345
|
-
BUILD_${NAME}_ENV
|
346
|
-
BUILD_${NAME}
|
347
|
-
|
348
|
-
|
349
|
-
|
361
|
+
Workspace::Application
|
362
|
+
.new
|
363
|
+
.add("squared", run: "gcc a.c -o a.o", opts: { __debug__: { g: true, O2: true, c: nil }, c: true, j: 4 }) # gcc a.c -o a.o -c -j4
|
364
|
+
|
365
|
+
BUILD_TYPE # global
|
366
|
+
|
367
|
+
# :env :run :opts :type
|
368
|
+
# LD_LIBRARY_PATH="path/to/lib" CFLAGS="-Wall" gcc a.c -o a.o -g -O2
|
369
|
+
BUILD_${NAME} # gcc a.c -o a.o
|
370
|
+
BUILD_${NAME}_OPTS # -g
|
371
|
+
BUILD_${NAME}_ENV # {"LD_LIBRARY_PATH":"path/to/lib","CFLAGS":"-Wall"} (hash/json)
|
372
|
+
BUILD_${NAME}_TYPE # debug
|
373
|
+
|
374
|
+
# :env :opts :script :args
|
375
|
+
# NODE_ENV="production" NO_COLOR="1" npm run --loglevel=error --workspaces=false build:dev -- --quiet
|
376
|
+
BUILD_${NAME} # build:dev
|
377
|
+
BUILD_${NAME}_OPTS # --loglevel=error --workspaces=false
|
378
|
+
BUILD_${NAME}_ENV # {"NODE_ENV":"production","NO_COLOR":"1"} (hash/json)
|
379
|
+
BUILD_${NAME}_DEV # pattern,0,1 (:dev)
|
380
|
+
BUILD_${NAME}_PROD # pattern,0,1 (:prod)
|
381
|
+
SCRIPT_${NAME}_OPTS # --quiet
|
382
|
+
|
383
|
+
BUILD_${NAME}=0 # skip project
|
350
384
|
```
|
351
385
|
|
352
|
-
|
386
|
+
### Graph
|
387
|
+
|
388
|
+
```ruby
|
389
|
+
GRAPH_${NAME} # depend,build => squared:depend + squared:build
|
390
|
+
GRAPH_${NAME}_PASS # -emc,pir,express => pir + express
|
391
|
+
```
|
353
392
|
|
354
393
|
### Logger
|
355
394
|
|
395
|
+
These global options also can target the project suffix `${NAME}`. (e.g. LOG_FILE_EMC)
|
396
|
+
|
356
397
|
```ruby
|
357
|
-
LOG_FILE
|
398
|
+
LOG_FILE # %Y-%m-%d.log
|
358
399
|
# OR
|
359
|
-
LOG_AUTO
|
400
|
+
LOG_AUTO # year,y,month,m,day,d,1
|
360
401
|
# Optional
|
361
|
-
LOG_DIR
|
362
|
-
LOG_LEVEL
|
363
|
-
LOG_COLUMNS
|
402
|
+
LOG_DIR # exist?
|
403
|
+
LOG_LEVEL # See gem "logger"
|
404
|
+
LOG_COLUMNS # terminal width (default: 80)
|
364
405
|
```
|
365
406
|
|
366
407
|
### Repo
|
367
408
|
|
409
|
+
These global options also can target the application main suffix `${NAME}`. (e.g. REPO_ROOT_SQUARED)
|
410
|
+
|
411
|
+
```ruby
|
412
|
+
REPO_ROOT # parent dir
|
413
|
+
REPO_HOME # project dir (main)
|
414
|
+
REPO_BUILD # run,script
|
415
|
+
REPO_GROUP # string
|
416
|
+
REPO_REF # e.g. ruby,node
|
417
|
+
REPO_DEV # pattern,0,1
|
418
|
+
REPO_PROD # pattern,0,1
|
419
|
+
REPO_WARN # 0,1
|
420
|
+
REPO_SYNC # 0,1
|
421
|
+
REPO_MANIFEST # e.g. latest,nightly,prod
|
422
|
+
REPO_TIMEOUT # confirm dialog (seconds)
|
423
|
+
```
|
424
|
+
|
425
|
+
## Git
|
426
|
+
|
427
|
+
Most project classes will inherit from `Git` which enables these tasks:
|
428
|
+
|
429
|
+
| Task | Git | Command |
|
430
|
+
| :--------- | :--------------- | :-------------------------------------------- |
|
431
|
+
| branch | branch | create set delete move copy list edit current |
|
432
|
+
| checkout | checkout | commit branch track detach path |
|
433
|
+
| commit | commit | add all amend amend-orig |
|
434
|
+
| diff | diff | head cached branch files between contain |
|
435
|
+
| fetch | fetch | origin remote |
|
436
|
+
| files | ls-files | cached modified deleted others ignored |
|
437
|
+
| pull | pull | origin remote |
|
438
|
+
| rebase | rebase | branch onto send |
|
439
|
+
| refs | ls-remote --refs | heads tags remote |
|
440
|
+
| reset | reset | commit index patch mode |
|
441
|
+
| restore | restore | source worktree staged overlay |
|
442
|
+
| rev | rev | commit branch output parseopt |
|
443
|
+
| show | show | format oneline |
|
444
|
+
| stash | stash | push pop apply drop list |
|
445
|
+
| tag | tag | add delete list |
|
446
|
+
|
447
|
+
You can disable all of them at once using the `exclude` property.
|
448
|
+
|
368
449
|
```ruby
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
450
|
+
Workspace::Application
|
451
|
+
.new
|
452
|
+
.add("squared", exclude: :git)
|
453
|
+
```
|
454
|
+
|
455
|
+
You can disable one or more of them using the `pass` property as a *string*.
|
456
|
+
|
457
|
+
```ruby
|
458
|
+
Workspace::Application
|
459
|
+
.new
|
460
|
+
.add("squared", pass: ["pull"], ref: :node)
|
461
|
+
.pass("pull", ref: :node) { read_packagemanager(:private) }
|
380
462
|
```
|
381
463
|
|
382
464
|
## LICENSE
|
data/lib/squared/common/base.rb
CHANGED
@@ -6,10 +6,12 @@ module Squared
|
|
6
6
|
ARG = {
|
7
7
|
PIPE: 1,
|
8
8
|
OUT: nil,
|
9
|
-
VERBOSE: nil,
|
10
9
|
FAIL: false,
|
10
|
+
HOME: nil,
|
11
11
|
COMMON: true,
|
12
|
+
VERBOSE: nil,
|
12
13
|
BANNER: true,
|
14
|
+
QUOTE: "'",
|
13
15
|
SPACE: ' => ',
|
14
16
|
GRAPH: ['│', '─', '├', '└', '┬'],
|
15
17
|
VIEW: 'view',
|
@@ -53,7 +55,6 @@ module Squared
|
|
53
55
|
hash: %i[green black!],
|
54
56
|
array: %i[blue black!],
|
55
57
|
number: [:magenta],
|
56
|
-
boolean: [:magenta],
|
57
58
|
undefined: %i[red italic]
|
58
59
|
},
|
59
60
|
logger: {
|
@@ -94,15 +95,13 @@ module Squared
|
|
94
95
|
return [] if obj.nil?
|
95
96
|
|
96
97
|
unless obj.is_a?(::Array)
|
97
|
-
obj = if obj.respond_to?(:
|
98
|
-
obj.to_ary
|
99
|
-
elsif obj.respond_to?(:to_a) && !obj.is_a?(::Hash) && (val = obj.to_a).is_a?(::Array)
|
98
|
+
obj = if obj.respond_to?(:to_a) && !obj.is_a?(::Hash) && (val = obj.to_a).is_a?(::Array)
|
100
99
|
val
|
101
100
|
else
|
102
101
|
[obj]
|
103
102
|
end
|
104
103
|
end
|
105
|
-
obj = flat.is_a?(::Numeric) ?
|
104
|
+
obj = obj.flatten(flat.is_a?(::Numeric) ? flat : nil) if flat
|
106
105
|
obj = obj.compact if compact
|
107
106
|
obj = obj.map(&meth) if meth
|
108
107
|
block_given? ? obj.select(&blk) : obj
|