squared 0.4.15 → 0.4.16
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 +29 -0
- data/README.ruby.md +4 -2
- 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 -23
- data/lib/squared/workspace/project/git.rb +25 -27
- data/lib/squared/workspace/project/node.rb +67 -25
- data/lib/squared/workspace/project/python.rb +12 -8
- data/lib/squared/workspace/project/ruby.rb +80 -47
- 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: 42a856b40866dc4f90ff4def50a0d8ef6f7134ce5cd8f0c40064b55aea2735a4
|
4
|
+
data.tar.gz: 1ee4f68f6f3a40ed0d45fac5fbb7e3817787f9c86be7770331edbaff541e7ad1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffb1e276cc3fa97d5de20158a5d0833c8cd140506cc8ee2fd61e0c19fe446e12edba1dca5cc0cda49a4e5d0e393bae4db1fa8f5320aa8bfb892c1dd8608d31ae
|
7
|
+
data.tar.gz: e6460b7953fd893b7560a051d93e86630faf134d831e173d25924562775186a6f46dd0a9cb13014a4adc8c2ff3ed734719925653ccd9ef140e4fa572e36db15c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,33 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.4.16] - 2025-07-27
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Git command blame was implemented.
|
8
|
+
- Project property only for task filtering was implemented.
|
9
|
+
- Node command copy uses NPM pack to refresh development packages.
|
10
|
+
- Docker command bake action check was implemented.
|
11
|
+
- Ruby uses gem specification for name and version.
|
12
|
+
- Ruby constructor parameter gemspec was implemented.
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- Project boolean property readers were converted into accessors.
|
17
|
+
- Workspace hash singleton methods were relocated under Support.
|
18
|
+
- Project property version uses setter method for validation.
|
19
|
+
- Node command publish will prompt when tag is not semantic.
|
20
|
+
- Gem command push without args uses gemspec to locate archive.
|
21
|
+
- Prompts will exit process without raising a generic error.
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
|
25
|
+
- Gem command exec did not separate command and arguments.
|
26
|
+
- Project warning messages were not displayed for errors.
|
27
|
+
- Python command outdated did not load virtual env in Windows.
|
28
|
+
- Python virtual env original options are not modified.
|
29
|
+
- Node could not compare semantic versions above double digits.
|
30
|
+
|
3
31
|
## [0.4.15] - 2025-07-16
|
4
32
|
|
5
33
|
### Added
|
@@ -833,6 +861,7 @@
|
|
833
861
|
|
834
862
|
- Changelog was created.
|
835
863
|
|
864
|
+
[0.4.16]: https://github.com/anpham6/squared/releases/tag/v0.4.16-ruby
|
836
865
|
[0.4.15]: https://github.com/anpham6/squared/releases/tag/v0.4.15-ruby
|
837
866
|
[0.4.14]: https://github.com/anpham6/squared/releases/tag/v0.4.14-ruby
|
838
867
|
[0.4.13]: https://github.com/anpham6/squared/releases/tag/v0.4.13-ruby
|
data/README.ruby.md
CHANGED
@@ -65,6 +65,7 @@ require "squared/app" # All workspace related mod
|
|
65
65
|
# log = /workspaces/logger
|
66
66
|
# emc = /workspaces/e-mc
|
67
67
|
# pir = /workspaces/pi-r
|
68
|
+
# pir2 = /workspaces/pi-r2
|
68
69
|
# squared = /workspaces/squared
|
69
70
|
# cli = /workspaces/squared/publish/sqd-cli
|
70
71
|
# sqd-serve = /workspaces/squared/publish/sqd-serve
|
@@ -82,10 +83,11 @@ Workspace::Application
|
|
82
83
|
.add("pathname", run: "rake compile", copy: "rake install", test: "rake test", group: "default", env: { # Ruby (with C extensions)
|
83
84
|
"CFLAGS" => "-fPIC -O1"
|
84
85
|
})
|
85
|
-
.add("optparse", doc: "rake rdoc", group: "default") # Uses bundler/gem_tasks (without C extensions)
|
86
|
+
.add("optparse", doc: "rake rdoc", gemspec: "optparse.gemspec", group: "default") # Uses bundler/gem_tasks (without C extensions)
|
86
87
|
.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"
|
87
88
|
.add("e-mc", "emc", copy: { from: "publish", scope: "@e-mc", also: [:pir, "squared-express/"] }, ref: :node) # Node
|
88
89
|
.add("pi-r", "pir", copy: { from: "publish", scope: "@pi-r" }, clean: ["publish/**/*.js", "tmp/"]) # Trailing slash required for directories
|
90
|
+
.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
|
89
91
|
.add("squared", script: ["build:stage1", "build:stage2"], group: "app") do # Copy target (main)
|
90
92
|
# Repo (global)
|
91
93
|
as(:run, "build:dev", "dev") # npm run build:dev -> npm run dev
|
@@ -107,7 +109,7 @@ Workspace::Application
|
|
107
109
|
variable_set :depend, false
|
108
110
|
variable_set :clean, ["build/sqd/"]
|
109
111
|
end
|
110
|
-
.with(:docker,
|
112
|
+
.with(:docker, only: ["build", "compose"]) do
|
111
113
|
.add("squared", "docker", file: "Dockerfile", context: ".", tag: "latest", registry: "localhost:5000", username: "squared",
|
112
114
|
args: "--ssh=default",
|
113
115
|
secrets: ["id=github,env=GITHUB_TOKEN"],
|
@@ -73,9 +73,9 @@ module Squared
|
|
73
73
|
end
|
74
74
|
attempts -= 1
|
75
75
|
next if attempts > 0
|
76
|
-
break unless force
|
77
76
|
|
78
|
-
exit 1
|
77
|
+
exit 1 if force
|
78
|
+
break
|
79
79
|
end
|
80
80
|
rescue Interrupt
|
81
81
|
puts
|
@@ -109,7 +109,7 @@ module Squared
|
|
109
109
|
end
|
110
110
|
ret = (prompt.call || '').strip
|
111
111
|
multiline.each { |val| break if ret.delete_suffix!(val) } if multiline.is_a?(::Enumerable)
|
112
|
-
|
112
|
+
exit 1 if force && ret.empty?
|
113
113
|
ret
|
114
114
|
else
|
115
115
|
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, quote: false, force: false, join: nil)
|
89
|
-
ret = val.shellsplit
|
90
|
-
ret.map! { |opt| shell_escape(opt, quote: quote, force: force, double: true, option: true) }
|
89
|
+
ret = val.shellsplit.map! { |opt| shell_escape(opt, quote: quote, force: force, double: true, option: true) }
|
91
90
|
return ret unless join
|
92
91
|
|
93
92
|
ret.join(join.is_a?(::String) ? join : ' ')
|
data/lib/squared/common/utils.rb
CHANGED
@@ -105,6 +105,15 @@ module Squared
|
|
105
105
|
Time.now.utc.strftime(s).to_i - Time.parse(val).utc.strftime(s).to_i
|
106
106
|
end
|
107
107
|
|
108
|
+
def rand_s(size)
|
109
|
+
if RUBY_VERSION >= '3.1'
|
110
|
+
require 'random/formatter'
|
111
|
+
Random.new.alphanumeric(size)
|
112
|
+
else
|
113
|
+
(0...size).map { rand(97..122).chr }.join
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
108
117
|
def env(key, default = nil, suffix: nil, strict: false, equals: nil, ignore: nil)
|
109
118
|
ret = env_value(key, suffix: suffix, strict: strict)
|
110
119
|
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
|
@@ -630,12 +630,16 @@ module Squared
|
|
630
630
|
Rake::Win32.windows?
|
631
631
|
end
|
632
632
|
|
633
|
+
def mri?
|
634
|
+
RUBY_ENGINE == 'ruby'
|
635
|
+
end
|
636
|
+
|
633
637
|
def jruby?
|
634
638
|
RUBY_ENGINE == 'jruby'
|
635
639
|
end
|
636
640
|
|
637
|
-
def
|
638
|
-
|
641
|
+
def truffleruby?
|
642
|
+
RUBY_ENGINE == 'truffleruby'
|
639
643
|
end
|
640
644
|
|
641
645
|
def docker?
|