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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cf3c1ed045970581434b5e6571a75ccb21a8ea564d83b1f85c6deca107424d5
4
- data.tar.gz: 2300104c9cf7fcd5babbe2989c9a68af8f8b024546baf3969198df1973ab98fe
3
+ metadata.gz: 42a856b40866dc4f90ff4def50a0d8ef6f7134ce5cd8f0c40064b55aea2735a4
4
+ data.tar.gz: 1ee4f68f6f3a40ed0d45fac5fbb7e3817787f9c86be7770331edbaff541e7ad1
5
5
  SHA512:
6
- metadata.gz: 5983d6fa81ba44335c2af020292f6260a02ffd4c6a8c9c9213b68d50606a14aa33fd4df032a5abfcc0677d44f5e30e69d726b3c5dcc2ac0dfbb378bdd9fa0618
7
- data.tar.gz: dcd11eb155202c2dbbcb1d7a533516c4c0d16381caccb49a0b67612e915297242b7caa74d684afcb9db08530d68a1f0a693512189f8e6b7d9fe6579f2c5e444a
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, pass: ["unpack"]) do
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
- raise_error 'user cancelled' if force && ret.empty?
112
+ exit 1 if force && ret.empty?
113
113
  ret
114
114
  else
115
115
  prompt.call
@@ -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 : ' ')
@@ -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?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.4.15'
4
+ VERSION = '0.4.16'
5
5
  end
@@ -92,7 +92,7 @@ module Squared
92
92
  @prefix = prefix
93
93
  @series = Application.series_wrap(self)
94
94
  @project = {}
95
- @kind = Workspace.hashlist
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 = Workspace.hashlist
109
+ @chain = Support.hashlist
110
110
  @script = {
111
- group: Workspace.hashobj,
112
- ref: Workspace.hashobj,
111
+ group: Support.hashobj,
112
+ ref: Support.hashobj,
113
113
  group!: {},
114
114
  ref!: {}
115
115
  }.freeze
116
116
  @events = {
117
- group: Workspace.hashobj,
118
- ref: Workspace.hashobj
117
+ group: Support.hashobj,
118
+ ref: Support.hashobj
119
119
  }.freeze
120
120
  @pass = {
121
- group: Workspace.hashobj,
122
- ref: Workspace.hashobj,
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 jruby_win?
638
- jruby? && windows?
641
+ def truffleruby?
642
+ RUBY_ENGINE == 'truffleruby'
639
643
  end
640
644
 
641
645
  def docker?