squared 0.5.11 → 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.
@@ -3,35 +3,9 @@
3
3
  module Squared
4
4
  module Workspace
5
5
  module Support
6
- class << self
7
- def hashobj
8
- Hash.new { |data, key| data[key] = {} }
9
- end
10
-
11
- def hashlist
12
- Hash.new { |data, key| data[key] = [] }
13
- end
14
-
15
- def hashdup(data, pass: [])
16
- ret = {}
17
- data.each do |key, val|
18
- ret[key] = case val
19
- when Hash
20
- if pass.include?(val)
21
- val
22
- else
23
- pass << val
24
- hashdup(val, pass: pass)
25
- end
26
- when Proc, Method
27
- val
28
- else
29
- val.dup
30
- end
31
- end
32
- ret
33
- end
34
- end
6
+ RunData = Struct.new('RunData', :run, :block)
7
+ ChainData = Struct.new('ChainData', :action, :step, :with, :before, :after, :sync)
8
+ BannerData = Struct.new('BannerData', :command, :order, :styles, :border)
35
9
  end
36
10
  end
37
11
  end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Squared
4
+ module Workspace
5
+ module Support
6
+ module Variables
7
+ private
8
+
9
+ def hashobj
10
+ Hash.new { |data, key| data[key] = {} }
11
+ end
12
+
13
+ def hashlist
14
+ Hash.new { |data, key| data[key] = [] }
15
+ end
16
+
17
+ def hashdup(data, compact: false, freeze: false, target: {}, pass: {})
18
+ data.each do |key, val|
19
+ next if val.nil? && compact
20
+
21
+ target[key] = case val
22
+ when Hash
23
+ if pass.key?(val)
24
+ pass[val]
25
+ else
26
+ hashdup(val, compact: compact, freeze: freeze, target: pass[val] = {}, pass: pass)
27
+ end
28
+ when Enumerable
29
+ compact ? val.compact : val.dup
30
+ when Proc, Method
31
+ val
32
+ else
33
+ val.dup
34
+ end
35
+ target[key].freeze if freeze && val.frozen?
36
+ end
37
+ target
38
+ end
39
+ end
40
+
41
+ class << Support
42
+ include Variables
43
+
44
+ public(*Variables.private_instance_methods(false))
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'support/base'
4
- require_relative 'support/data'
4
+ require_relative 'support/variables'
@@ -6,7 +6,7 @@ module Squared
6
6
  include Common
7
7
 
8
8
  def resolve(*args)
9
- ret = args.map do |id|
9
+ ret = args.map! do |id|
10
10
  if id.is_a?(Symbol)
11
11
  project id
12
12
  else
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squared
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Pham
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-10-18 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -102,7 +101,7 @@ files:
102
101
  - lib/squared/workspace/series.rb
103
102
  - lib/squared/workspace/support.rb
104
103
  - lib/squared/workspace/support/base.rb
105
- - lib/squared/workspace/support/data.rb
104
+ - lib/squared/workspace/support/variables.rb
106
105
  - squared.gemspec
107
106
  homepage: https://github.com/anpham6/squared-ruby
108
107
  licenses:
@@ -111,7 +110,6 @@ metadata:
111
110
  homepage_uri: https://github.com/anpham6/squared-ruby
112
111
  source_code_uri: https://github.com/anpham6/squared-ruby
113
112
  documentation_uri: https://squared.readthedocs.io
114
- post_install_message:
115
113
  rdoc_options: []
116
114
  require_paths:
117
115
  - lib
@@ -126,8 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
124
  - !ruby/object:Gem::Version
127
125
  version: '0'
128
126
  requirements: []
129
- rubygems_version: 3.2.33
130
- signing_key:
127
+ rubygems_version: 3.7.2
131
128
  specification_version: 4
132
129
  summary: Rake task generator for managing multi-language workspaces.
133
130
  test_files: []
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Squared
4
- module Workspace
5
- module Support
6
- RunData = Struct.new('RunData', :run, :block)
7
- ChainData = Struct.new('ChainData', :action, :step, :with, :before, :after, :sync)
8
- BannerData = Struct.new('BannerData', :command, :order, :styles, :border)
9
- end
10
- end
11
- end