squared 0.5.2 → 0.5.3
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 +36 -0
- data/README.ruby.md +4 -2
- data/lib/squared/common/format.rb +6 -4
- data/lib/squared/common/prompt.rb +3 -3
- data/lib/squared/common/shell.rb +1 -2
- data/lib/squared/common/utils.rb +9 -0
- data/lib/squared/version.rb +1 -1
- data/lib/squared/workspace/application.rb +14 -10
- data/lib/squared/workspace/project/base.rb +157 -113
- data/lib/squared/workspace/project/docker.rb +21 -24
- data/lib/squared/workspace/project/git.rb +25 -27
- data/lib/squared/workspace/project/node.rb +63 -21
- data/lib/squared/workspace/project/python.rb +15 -11
- data/lib/squared/workspace/project/ruby.rb +83 -48
- data/lib/squared/workspace/project/support/class.rb +2 -4
- data/lib/squared/workspace/series.rb +4 -4
- data/lib/squared/workspace/support/base.rb +17 -0
- data/lib/squared/workspace/support.rb +1 -0
- data/lib/squared/workspace.rb +0 -8
- data/squared.gemspec +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54118de98db0adf55417ad35cbc3c118bba709c8bbb98b9d74acccaf7a30621e
|
4
|
+
data.tar.gz: 13f6ac344ecdc68f724c10a967f0eba1de6cd0332157abe0c9079db9dba1b9d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfbfbd1b2a5fcd376fceafe53fa77789726704d6cdf7f3d919c6381e04f89e2fc3888adfb38e819bbeba7bb51cd7f7f0c08e4fe797d16ee688752dddb9ad6b68
|
7
|
+
data.tar.gz: 4ffd9c7e92c7d357c6e877fa78ca850b202585721001a2c58dbc5851eac292abad59ab67f12fc8eab5ef7706bf3cd1d8db7aaf4ee9b169f0cebf38dfe1016b99
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,39 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.5.3] - 2025-07-27
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- See `0.4.16`.
|
8
|
+
|
9
|
+
## [0.4.16] - 2025-07-27
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Git command blame was implemented.
|
14
|
+
- Project property only for task filtering was implemented.
|
15
|
+
- Node command copy uses NPM pack to refresh development packages.
|
16
|
+
- Docker command bake action check was implemented.
|
17
|
+
- Ruby uses gem specification for name and version.
|
18
|
+
- Ruby constructor parameter gemspec was implemented.
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
|
22
|
+
- Project boolean property readers were converted into accessors.
|
23
|
+
- Workspace hash singleton methods were relocated under Support.
|
24
|
+
- Project property version uses setter method for validation.
|
25
|
+
- Node command publish will prompt when tag is not semantic.
|
26
|
+
- Gem command push without args uses gemspec to locate archive.
|
27
|
+
- Prompts will exit process without raising a generic error.
|
28
|
+
|
29
|
+
### Fixed
|
30
|
+
|
31
|
+
- Gem command exec did not separate command and arguments.
|
32
|
+
- Project warning messages were not displayed for errors.
|
33
|
+
- Python command outdated did not load virtual env in Windows.
|
34
|
+
- Python virtual env original options are not modified.
|
35
|
+
- Node could not compare semantic versions above double digits.
|
36
|
+
|
3
37
|
## [0.5.2] - 2025-07-16
|
4
38
|
|
5
39
|
### Changed
|
@@ -874,9 +908,11 @@
|
|
874
908
|
|
875
909
|
- Changelog was created.
|
876
910
|
|
911
|
+
[0.5.3]: https://github.com/anpham6/squared/releases/tag/v0.5.3-ruby
|
877
912
|
[0.5.2]: https://github.com/anpham6/squared/releases/tag/v0.5.2-ruby
|
878
913
|
[0.5.1]: https://github.com/anpham6/squared/releases/tag/v0.5.1-ruby
|
879
914
|
[0.5.0]: https://github.com/anpham6/squared/releases/tag/v0.5.0-ruby
|
915
|
+
[0.4.16]: https://github.com/anpham6/squared/releases/tag/v0.4.16-ruby
|
880
916
|
[0.4.15]: https://github.com/anpham6/squared/releases/tag/v0.4.15-ruby
|
881
917
|
[0.4.14]: https://github.com/anpham6/squared/releases/tag/v0.4.14-ruby
|
882
918
|
[0.4.13]: https://github.com/anpham6/squared/releases/tag/v0.4.13-ruby
|
data/README.ruby.md
CHANGED
@@ -66,6 +66,7 @@ require "squared/app" # All workspace related mod
|
|
66
66
|
# log = /workspaces/logger
|
67
67
|
# emc = /workspaces/e-mc
|
68
68
|
# pir = /workspaces/pi-r
|
69
|
+
# pir2 = /workspaces/pi-r2
|
69
70
|
# squared = /workspaces/squared
|
70
71
|
# cli = /workspaces/squared/publish/sqd-cli
|
71
72
|
# sqd-serve = /workspaces/squared/publish/sqd-serve
|
@@ -83,10 +84,11 @@ Workspace::Application
|
|
83
84
|
.add("pathname", run: "rake compile", copy: "rake install", test: "rake test", group: "default", env: { # Ruby (with C extensions)
|
84
85
|
"CFLAGS" => "-fPIC -O1"
|
85
86
|
})
|
86
|
-
.add("optparse", doc: "rake rdoc", group: "default") # Uses bundler/gem_tasks (without C extensions)
|
87
|
+
.add("optparse", doc: "rake rdoc", gemspec: "optparse.gemspec", group: "default") # Uses bundler/gem_tasks (without C extensions)
|
87
88
|
.add("logger", copy: { from: "lib", glob: "**/*.rb", into: "~/.rvm/gems/ruby-3.4.0/gems/logger-1.6.1" }, clean: ["tmp/"]) # autodetect: true | "rvm" | "rbenv" | "asdf" | "bundler"
|
88
89
|
.add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node) # Node
|
89
90
|
.add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
|
91
|
+
.add("pi-r2", "pir2", copy: { from: :npm, also: %i[squared express], files: ["LICENSE", ["README.md.ruby", "README.md"]] }) # Uses dist files from NPM package spec
|
90
92
|
.add("squared", script: ["build:stage1", "build:stage2"], group: "app") do # Copy target (main)
|
91
93
|
# Repo (global)
|
92
94
|
as(:run, "build:dev", "dev") # npm run build:dev -> npm run dev
|
@@ -108,7 +110,7 @@ Workspace::Application
|
|
108
110
|
variable_set :depend, false
|
109
111
|
variable_set :clean, ["build/sqd/"]
|
110
112
|
end
|
111
|
-
.with(:docker,
|
113
|
+
.with(:docker, only: ["build", "compose"]) do
|
112
114
|
.add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared",
|
113
115
|
args: "--ssh=default",
|
114
116
|
secrets: ["id=github,env=GITHUB_TOKEN"],
|
@@ -124,7 +124,7 @@ module Squared
|
|
124
124
|
def check_style(args, empty: true)
|
125
125
|
ret = []
|
126
126
|
colors = __get__(:colors)
|
127
|
-
|
127
|
+
Array(args).flatten.compact.each do |val|
|
128
128
|
if !val.is_a?(::Numeric)
|
129
129
|
val = val.to_sym
|
130
130
|
ret << val if colors.key?(val) || TEXT_STYLE.include?(val)
|
@@ -135,7 +135,9 @@ module Squared
|
|
135
135
|
ret << "-0.#{b}".to_f unless b.to_i > 255
|
136
136
|
end
|
137
137
|
end
|
138
|
-
|
138
|
+
return if ret.empty? && !empty
|
139
|
+
|
140
|
+
ret
|
139
141
|
end
|
140
142
|
|
141
143
|
def apply_style(data, key, args, empty: true)
|
@@ -222,7 +224,7 @@ module Squared
|
|
222
224
|
n = 0
|
223
225
|
max = ->(v) { n = [n, v.max_by(&:size).size].max }
|
224
226
|
set = lambda do |v|
|
225
|
-
ret =
|
227
|
+
ret = Array(v).map(&:to_s)
|
226
228
|
max.call(ret)
|
227
229
|
ret
|
228
230
|
end
|
@@ -246,7 +248,7 @@ module Squared
|
|
246
248
|
ret = sub_style(ret, styles: border) if border
|
247
249
|
ret
|
248
250
|
end
|
249
|
-
sub =
|
251
|
+
sub = sub.is_a?(::Hash) ? [sub] : Array(sub)
|
250
252
|
pr = lambda do |line|
|
251
253
|
s = line.ljust(n)
|
252
254
|
sub.each { |h| s = sub_style(s, **h) }
|
@@ -90,9 +90,9 @@ module Squared
|
|
90
90
|
end
|
91
91
|
attempts -= 1
|
92
92
|
next if attempts > 0
|
93
|
-
break unless force
|
94
93
|
|
95
|
-
exit 1
|
94
|
+
exit 1 if force
|
95
|
+
break
|
96
96
|
end
|
97
97
|
rescue Interrupt
|
98
98
|
puts
|
@@ -125,7 +125,7 @@ module Squared
|
|
125
125
|
end
|
126
126
|
ret = (prompt.call || '').strip
|
127
127
|
multiline.each { |val| break if ret.delete_suffix!(val) } if multiline.is_a?(::Enumerable)
|
128
|
-
|
128
|
+
exit 1 if force && ret.empty?
|
129
129
|
ret
|
130
130
|
else
|
131
131
|
prompt.call
|
data/lib/squared/common/shell.rb
CHANGED
@@ -86,8 +86,7 @@ module Squared
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def shell_split(val, join: nil, **kwargs)
|
89
|
-
ret = val.shellsplit
|
90
|
-
ret.map! { |opt| shell_escape(opt, double: true, option: true, **kwargs) }
|
89
|
+
ret = val.shellsplit.map! { |opt| shell_escape(opt, double: true, option: true, **kwargs) }
|
91
90
|
return ret unless join
|
92
91
|
|
93
92
|
ret.join(join.is_a?(::String) ? join : ' ')
|
data/lib/squared/common/utils.rb
CHANGED
@@ -93,6 +93,15 @@ module Squared
|
|
93
93
|
Time.now.utc.strftime(s).to_i - Time.parse(val).utc.strftime(s).to_i
|
94
94
|
end
|
95
95
|
|
96
|
+
def rand_s(size)
|
97
|
+
if RUBY_VERSION >= '3.1'
|
98
|
+
require 'random/formatter'
|
99
|
+
Random.new.alphanumeric(size)
|
100
|
+
else
|
101
|
+
(0...size).map { rand(97..122).chr }.join
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
96
105
|
def env(key, default = nil, suffix: nil, strict: false, equals: nil, ignore: nil)
|
97
106
|
ret = env_value(key, suffix: suffix, strict: strict)
|
98
107
|
return ret == equals.to_s unless equals.nil?
|
data/lib/squared/version.rb
CHANGED
@@ -92,7 +92,7 @@ module Squared
|
|
92
92
|
@prefix = prefix
|
93
93
|
@series = Application.series_wrap(self)
|
94
94
|
@project = {}
|
95
|
-
@kind =
|
95
|
+
@kind = Support.hashlist
|
96
96
|
@extensions = []
|
97
97
|
@envname = env_key(@main).freeze
|
98
98
|
@pipe = env_pipe(pipe, (ARG[:OUT] && env(ARG[:OUT])) || 1, root: @home)
|
@@ -106,20 +106,20 @@ module Squared
|
|
106
106
|
else
|
107
107
|
@theme = {}
|
108
108
|
end
|
109
|
-
@chain =
|
109
|
+
@chain = Support.hashlist
|
110
110
|
@script = {
|
111
|
-
group:
|
112
|
-
ref:
|
111
|
+
group: Support.hashobj,
|
112
|
+
ref: Support.hashobj,
|
113
113
|
group!: {},
|
114
114
|
ref!: {}
|
115
115
|
}.freeze
|
116
116
|
@events = {
|
117
|
-
group:
|
118
|
-
ref:
|
117
|
+
group: Support.hashobj,
|
118
|
+
ref: Support.hashobj
|
119
119
|
}.freeze
|
120
120
|
@pass = {
|
121
|
-
group:
|
122
|
-
ref:
|
121
|
+
group: Support.hashobj,
|
122
|
+
ref: Support.hashobj,
|
123
123
|
global: {},
|
124
124
|
pattern: []
|
125
125
|
}.freeze
|
@@ -625,12 +625,16 @@ module Squared
|
|
625
625
|
Rake::Win32.windows?
|
626
626
|
end
|
627
627
|
|
628
|
+
def mri?
|
629
|
+
RUBY_ENGINE == 'ruby'
|
630
|
+
end
|
631
|
+
|
628
632
|
def jruby?
|
629
633
|
RUBY_ENGINE == 'jruby'
|
630
634
|
end
|
631
635
|
|
632
|
-
def
|
633
|
-
|
636
|
+
def truffleruby?
|
637
|
+
RUBY_ENGINE == 'truffleruby'
|
634
638
|
end
|
635
639
|
|
636
640
|
def docker?
|