squared 0.4.14 → 0.5.1

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: fafee0b2a60973f9363c71173b9de4ed4779090e2ef3c2331d3ecd9f3a2a9398
4
- data.tar.gz: 8eb5bfef9ec19b7985866ffd1f0b55a849ff7d27a895b76d29a1cd85553e717a
3
+ metadata.gz: 3aeb7a32f99a22618e2c6c497d6de2f911df5d126232c63ed986324fc5b31aa7
4
+ data.tar.gz: fb144ac3238fcaf22f1c8bf4218847f547db9d03904a45ef8f040501df1ecc9b
5
5
  SHA512:
6
- metadata.gz: 464952bd65f6c404a89ef8624549e04a7a4ec0cc2c0b211e73d0464cf1bcd8094f760449ab7e0e944fd390cf01029f14ef2b6a082ae67d1ad071d243821ee527
7
- data.tar.gz: d36b6c580ccabb5bde29585cdb4642c7a81dadfff59b5766fa76efece506983ed0335551fdd31a41eced8c6631967573a6ad4a19f22b912e61a93f6f10e334ec
6
+ metadata.gz: 6c026101681bf8869138b6882044b60dd3b515d2f61feee9529c4ed70f048c1ceca39538ebe4ac3985c974aeff36b22506d4f5429f9b6eb7ac7d5400a14e737b
7
+ data.tar.gz: c53bc01a5dbdb5653d67eab02b3bd93229b8cda4fef6d97da16826d70069ab03c085086c49a045281e2da732957a1e920595abd52374bbf76c898f7e63dfe39b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.1] - 2025-07-05
4
+
5
+ ### Changed
6
+
7
+ - Common method confirm will automatically append hint with defaults.
8
+
9
+ ### Fixed
10
+
11
+ - Gem command push did not prompt for gem to publish.
12
+
3
13
  ## [0.4.14] - 2025-07-05
4
14
 
5
15
  ### Added
@@ -62,6 +72,31 @@
62
72
  - Common method is used for Kernel shell commands.
63
73
  - Git did not highlight output for single commands.
64
74
 
75
+ ## [0.5.0] - 2025-06-16
76
+
77
+ ### Added
78
+
79
+ - Node command exec through NVM was implemented.
80
+ - Git command options were updated to version 2.49.
81
+
82
+ ### Changed
83
+
84
+ - Gem specification required Ruby version set to 2.5.
85
+ - Docker build options from ENV do not require dashes.
86
+ - Unused task descriptions are not generated.
87
+ - Class object shapes were declared in initialize.
88
+ - Project outdated interactive uses a more compact prompt.
89
+ - Workspace banner configuration uses a struct.
90
+
91
+ ### Removed
92
+
93
+ - Git commit hash identifier uses only a colon for a prefix.
94
+ - Common module for classes was delegated to support namespaces.
95
+
96
+ ### Fixed
97
+
98
+ - Project private variables external modification was revised.
99
+
65
100
  ## [0.4.13] - 2025-06-16
66
101
 
67
102
  ### Added
@@ -802,6 +837,8 @@
802
837
 
803
838
  - Changelog was created.
804
839
 
840
+ [0.5.1]: https://github.com/anpham6/squared/releases/tag/v0.5.1-ruby
841
+ [0.5.0]: https://github.com/anpham6/squared/releases/tag/v0.5.0-ruby
805
842
  [0.4.14]: https://github.com/anpham6/squared/releases/tag/v0.4.14-ruby
806
843
  [0.4.13]: https://github.com/anpham6/squared/releases/tag/v0.4.13-ruby
807
844
  [0.4.12]: https://github.com/anpham6/squared/releases/tag/v0.4.12-ruby
data/README.md CHANGED
@@ -140,13 +140,13 @@ rake clone # node + docs
140
140
  # PIPE_FAIL={0,1}
141
141
  # PORT=3000
142
142
  docker build -t squared --build-arg MANIFEST=prod --build-arg NODE_ENV=production .
143
- docker build -t node --build-arg NODE_TAG=22 --build-arg NODE_INSTALL=pnpm -f slim.Dockerfile .
143
+ docker build -t node --build-arg NODE_TAG=22 --build-arg NODE_INSTALL=pnpm -f Dockerfile.slim .
144
144
  NODE=22 docker buildx bake node
145
145
  # OR
146
- docker build -t ruby --build-arg RUBY_TAG=3.4.0 --build-arg NODE_VERSION=22 --build-arg PIPE_FAIL=0 -f ruby.Dockerfile .
146
+ docker build -t ruby --build-arg RUBY_TAG=3.4.0 --build-arg NODE_VERSION=22 --build-arg PIPE_FAIL=0 -f Dockerfile.ruby .
147
147
  RUBY=3.4.0 docker buildx bake ruby
148
148
  # OR
149
- docker build -t nginx --build-arg NGINX_VERSION=1.27 --build-arg PORT=3000 --build-arg NODE_VERSION=20 -f nginx.Dockerfile .
149
+ docker build -t nginx --build-arg NGINX_VERSION=1.27 --build-arg PORT=3000 --build-arg NODE_VERSION=20 -f Dockerfile.nginx .
150
150
  NGINX=1.27 docker buildx bake nginx
151
151
 
152
152
  # Express
@@ -1359,4 +1359,4 @@ NOTE: Defining an element "**id**" will prevent it from being removed during the
1359
1359
 
1360
1360
  ## LICENSE
1361
1361
 
1362
- BSD 3-Clause
1362
+ BSD 3-Clause
data/README.ruby.md CHANGED
@@ -1,16 +1,17 @@
1
- # squared 0.4
1
+ # squared 0.5
2
2
 
3
3
  * [source](https://github.com/anpham6/squared)
4
4
  * [docs](https://squared.readthedocs.io)
5
5
 
6
6
  ## Version Compatibility
7
7
 
8
- | Date | squared | Min | Max | Git |
9
- | :--------: | ------: | -----: | -----: | -----: |
10
- | 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 | 2.39 |
11
- | 2025-01-07 | 0.2.0 | 2.4.0 | 3.4.0 | 2.39 |
12
- | 2025-02-07 | 0.3.0 | 2.4.0 | 3.4.1 | 2.39 |
13
- | 2025-03-06 | 0.4.0 | 2.4.0 | 3.4.2 | 2.39 |
8
+ | Date | squared | Min | Max |
9
+ | :--------: | ------: | -----: | -----: |
10
+ | 2024-12-07 | 0.1.0 | 2.4.0 | 3.3.6 |
11
+ | 2025-01-07 | 0.2.0 | | 3.4.0 |
12
+ | 2025-02-07 | 0.3.0 | | 3.4.1 |
13
+ | 2025-03-06 | 0.4.0 | | 3.4.2 |
14
+ | 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.3 |
14
15
 
15
16
  The range chart indicates the latest Ruby tested against at the time of release.
16
17
 
@@ -263,7 +264,7 @@ Workspace::Application
263
264
  add("squared") do
264
265
  revbuild(include: %w[src/ framework/ types/]) # Git revision build command (optional)
265
266
  chain "all", "revbuild", after: "express:build" # step: 4
266
- chain "publish", "bump:patch", "publish:latest", step: 0, sync: true # rake publish -> squared:bump:patch -> squared:publish:latest
267
+ chain "publish", "bump:patch", "publish:latest", step: 0, sync: true # rake publish
267
268
  end
268
269
  end
269
270
  .with(:python) do
@@ -275,12 +276,12 @@ Workspace::Application
275
276
  chain "all", "doc", with: "squared", before: "squared:revbuild" # Same
276
277
  end
277
278
  end
278
- .chain "all", "status", with: "squared", after: "android-docs" # Global tasks (e.g. without ":")
279
+ .chain("all", "status", with: "squared", after: "android-docs") # Global tasks (e.g. without ":")
279
280
  .build
280
281
  ```
281
282
 
282
283
  ```sh
283
- rake all # all[1-3-4]
284
+ rake all # all[1-3-4]
284
285
  rake all:print
285
286
  ```
286
287
 
@@ -537,7 +538,6 @@ Commands which use commit hashes are parsed using a ":" prefix as to not be conf
537
538
 
538
539
  ```sh
539
540
  rake squared:log:view[:af012345] # git log af012345
540
- rake squared:log:view[#{af012345}] # deprecated
541
541
  rake squared:log:view[H1,HEAD^5,all,lib,./H12345] # git log --all @~1 @^5 -- 'lib' 'H12345'
542
542
  ```
543
543
 
@@ -683,6 +683,9 @@ DOCKER_TAG=latest # all
683
683
  DOCKER_TAG_${NAME}=v0.1.0 # project only (override)
684
684
  DOCKER_ALL=1 # list every image/container
685
685
  DOCKER_Y=1 # confirm all
686
+
687
+ BUILD_SQUARED_OPTS="NODE_TAG=24 RUBY_VERSION=3.4.0" DOCKER_SQUARED_OPTS="--no-cache --label=v1" rake squared:build
688
+ docker build --no-cache --label=v1 --build-arg='NODE_TAG=24' --build-arg='RUBY_VERSION=3.4.0' .
686
689
  ```
687
690
 
688
691
  | Command | Flag | ENV |
@@ -100,7 +100,7 @@ module Squared
100
100
 
101
101
  module_function
102
102
 
103
- def as_a(obj, meth = nil, flat: nil, compact: false, &blk)
103
+ def as_a(obj, *meth, flat: nil, compact: false, &blk)
104
104
  return [] if obj.nil?
105
105
 
106
106
  unless obj.is_a?(::Array)
@@ -114,8 +114,10 @@ module Squared
114
114
  end
115
115
  obj = flat.is_a?(::Numeric) ? obj.flatten(flat) : obj.flatten if flat
116
116
  obj = obj.compact if compact
117
- obj = obj.map(&meth) if meth
118
- block_given? ? obj.select(&blk) : obj
117
+ obj = obj.map(&meth.shift) until meth.empty?
118
+ return obj unless block_given?
119
+
120
+ obj.select(&blk)
119
121
  end
120
122
  end
121
123
  end
@@ -41,7 +41,7 @@ module Squared
41
41
 
42
42
  def enable_aixterm
43
43
  unless (colors = __get__(:colors)).frozen?
44
- colors.merge!(AIX_TERM)
44
+ colors.update(AIX_TERM)
45
45
  end
46
46
  self
47
47
  end
@@ -8,27 +8,33 @@ module Squared
8
8
  def confirm(msg, default = nil, agree: 'Y', cancel: 'N', attempts: 5, timeout: 30)
9
9
  require 'readline'
10
10
  require 'timeout'
11
+ if agree == 'Y' && cancel == 'N' && !msg.match?(%r{\[(?:Yn|nY|Y/n|y/N)\]})
12
+ case default
13
+ when 'Y'
14
+ msg = "#{msg} [Y/n] "
15
+ when 'N'
16
+ msg = "#{msg} [y/N] "
17
+ end
18
+ end
11
19
  agree = /^#{Regexp.escape(agree)}$/i if agree.is_a?(::String)
12
20
  cancel = /^#{Regexp.escape(cancel)}$/i if cancel.is_a?(::String)
13
21
  Timeout.timeout(timeout) do
14
- begin
15
- while (ch = Readline.readline(msg))
16
- ch = ch.chomp
17
- case (ch.empty? ? default : ch)
18
- when agree
19
- return true
20
- when cancel
21
- return false
22
- end
23
- attempts -= 1
24
- exit 1 unless attempts > 0
22
+ while (ch = Readline.readline(msg))
23
+ ch = ch.chomp
24
+ case (ch.empty? ? default : ch)
25
+ when agree
26
+ return true
27
+ when cancel
28
+ return false
25
29
  end
26
- rescue Interrupt
27
- puts
28
- exit 0
29
- else
30
- false
30
+ attempts -= 1
31
+ exit 1 unless attempts > 0
31
32
  end
33
+ rescue Interrupt
34
+ puts
35
+ exit 0
36
+ else
37
+ false
32
38
  end
33
39
  end
34
40
 
@@ -43,7 +49,7 @@ module Squared
43
49
  next if grep&.none? { |pat| pat.match?(line) }
44
50
 
45
51
  items << val.chomp
46
- puts "#{items.size.to_s.rjust(2)}. #{val}"
52
+ puts '%2d. %s' % [items.size, val]
47
53
  end
48
54
  max = items.size
49
55
  raise_error 'empty selection list' if max == 0
@@ -56,33 +62,31 @@ module Squared
56
62
  end
57
63
  valid = ->(s) { s.match?(/^-?\d+$/) && s.to_i.between?(min, max) }
58
64
  Timeout.timeout(timeout) do
59
- begin
60
- while (ch = Readline.readline(msg))
61
- unless (ch = ch.strip).empty?
62
- if multiple
63
- a = ch.split(/\s*,\s*/)
64
- b = a.select { |s| valid.call(s) }.map!(&:to_i).sort
65
- next unless a.size == b.size
66
- return b unless items
67
- next if multiple.is_a?(::Numeric) && multiple != b.size
65
+ while (ch = Readline.readline(msg))
66
+ unless (ch = ch.strip).empty?
67
+ if multiple
68
+ a = ch.split(/\s*,\s*/)
69
+ b = a.select { |s| valid.call(s) }.map!(&:to_i).sort
70
+ next unless a.size == b.size
71
+ return b unless items
72
+ next if multiple.is_a?(::Numeric) && multiple != b.size
68
73
 
69
- return b.map! { |i| items[i - 1] }
70
- elsif valid.call(ch)
71
- return items ? items[ch.to_i - 1] : ch.to_i
72
- end
74
+ return b.map! { |i| items[i - 1] }
75
+ elsif valid.call(ch)
76
+ return items ? items[ch.to_i - 1] : ch.to_i
73
77
  end
74
- attempts -= 1
75
- next if attempts > 0
76
- break unless force
77
-
78
- exit 1
79
78
  end
80
- rescue Interrupt
81
- puts
82
- exit 0
83
- else
84
- multiple ? [] : nil
79
+ attempts -= 1
80
+ next if attempts > 0
81
+ break unless force
82
+
83
+ exit 1
85
84
  end
85
+ rescue Interrupt
86
+ puts
87
+ exit 0
88
+ else
89
+ multiple ? [] : nil
86
90
  end
87
91
  end
88
92
 
@@ -85,26 +85,31 @@ module Squared
85
85
  end}"
86
86
  end
87
87
 
88
- def shell_split(val, quote: false, force: false, join: nil)
88
+ def shell_split(val, join: nil, **kwargs)
89
89
  ret = val.shellsplit
90
- ret.map! { |opt| shell_escape(opt, quote: quote, force: force, double: true, option: true) }
90
+ ret.map! { |opt| shell_escape(opt, double: true, option: true, **kwargs) }
91
91
  return ret unless join
92
92
 
93
93
  ret.join(join.is_a?(::String) ? join : ' ')
94
94
  end
95
95
 
96
- def fill_option(val, double: false)
96
+ def line_width(lines)
97
+ ret = [lines.max_by(&:size).size, 80].max
98
+ [ret, Rake.application.terminal_width].min
99
+ end
100
+
101
+ def fill_option(val, **kwargs)
97
102
  return "-#{val}" if val.match?(/\A(?:[a-z]\d*|\d)\z/i)
98
103
 
99
- shell_escape(val.start_with?('-') ? val : "--#{val}", double: double)
104
+ shell_escape(val.start_with?('-') ? val : "--#{val}", **kwargs)
100
105
  end
101
106
 
102
- def quote_option(flag, val, option: true, double: false, merge: false)
103
- shell_option(flag, val, escape: false, option: option, double: double, merge: merge)
107
+ def quote_option(flag, val, **kwargs)
108
+ shell_option(flag, val, escape: false, **kwargs)
104
109
  end
105
110
 
106
- def basic_option(flag, val, merge: false)
107
- shell_option(flag, val, escape: false, force: false, merge: merge)
111
+ def basic_option(flag, val, **kwargs)
112
+ shell_option(flag, val, escape: false, force: false, **kwargs)
108
113
  end
109
114
  end
110
115
  end
@@ -29,27 +29,29 @@ module Squared
29
29
  raise $?.to_s
30
30
  end
31
31
 
32
- def copy_dir(src, dest, glob = ['**/*'], create: false, link: nil, force: false, pass: nil, verbose: true)
33
- src = Pathname.new(src)
34
- dest = Pathname.new(dest)
35
- raise "#{dest.cleanpath} (not found)" if !create && !dest.parent.exist?
32
+ def copy_dir(src, dest, glob = ['**/*'], create: false, link: nil, force: false, pass: nil, hidden: false,
33
+ verbose: true)
34
+ base = Pathname.new(src)
35
+ target = Pathname.new(dest)
36
+ raise "#{target.cleanpath} (not found)" if !create && !target.parent.exist?
36
37
 
37
38
  subdir = {}
38
- dest.mkpath if create
39
+ target.mkpath if create
40
+ flags = hidden ? [File::FNM_DOTMATCH] : []
39
41
  if pass
40
42
  exclude = []
41
- Array(pass).each { |val| exclude.concat(Dir.glob(src + val)) }
43
+ Array(pass).each { |val| exclude.concat(Dir.glob(val, *flags, base: base)) }
42
44
  end
43
45
  Array(glob).each do |val|
44
- Dir.glob(src + val) do |path|
45
- next if exclude&.include?(path) || (path = Pathname.new(path)).directory?
46
+ Dir.glob(val, *flags, base: base) do |file|
47
+ next if exclude&.include?(file) || (entry = base + file).directory?
46
48
 
47
- dir = dest.join(path.relative_path_from(src)).dirname
49
+ dir = target.join(file).dirname
48
50
  if (data = subdir[dir.to_s])
49
- data << path
51
+ data << entry
50
52
  else
51
53
  dir.mkpath
52
- subdir[dir.to_s] = [path]
54
+ subdir[dir.to_s] = [entry]
53
55
  end
54
56
  end
55
57
  end
@@ -57,23 +59,24 @@ module Squared
57
59
  soft = 0
58
60
  subdir.each do |dir, files|
59
61
  if link
60
- items = files.dup
61
- files.clear
62
- items.each do |file|
63
- if file.exist?
64
- if file.symlink?
65
- next unless force
62
+ files.dup.yield_self do |items|
63
+ files.clear
64
+ items.each do |file|
65
+ if file.exist?
66
+ if file.symlink?
67
+ next unless force
68
+ else
69
+ files << file
70
+ next
71
+ end
72
+ end
73
+ if link == 'hard'
74
+ FileUtils.ln(file, dir, force: force, verbose: false)
66
75
  else
67
- files << file
68
- next
76
+ FileUtils.ln_s(file, dir, force: force, verbose: false)
69
77
  end
78
+ soft += 1
70
79
  end
71
- if link == 'hard'
72
- FileUtils.ln(file, dir, force: force, verbose: false)
73
- else
74
- FileUtils.ln_s(file, dir, force: force, verbose: false)
75
- end
76
- soft += 1
77
80
  end
78
81
  end
79
82
  next if files.empty?
@@ -81,15 +84,16 @@ module Squared
81
84
  out = FileUtils.cp(files, dir, verbose: false)
82
85
  count += out.size
83
86
  end
84
- puts [dest.realpath, subdir.size, soft > 0 ? "#{count}+#{soft}" : count].join(' => ') if verbose
87
+ puts [target.realpath, subdir.size, soft > 0 ? "#{count}+#{soft}" : count].join(' => ') if verbose
85
88
  end
86
89
 
87
90
  def copy_guard(src, dest, link: nil, force: false, verbose: true)
88
91
  unless force
89
- if (path = Pathname.new(dest)).directory?
90
- src = Array(src).reject { |val| path.join(File.basename(val)).exist? }
92
+ target = Pathname.new(dest)
93
+ if target.directory?
94
+ src = Array(src).reject { |val| target.join(File.basename(val)).exist? }
91
95
  return if src.empty?
92
- elsif path.exist?
96
+ elsif target.exist?
93
97
  return
94
98
  end
95
99
  end
@@ -88,18 +88,6 @@ module Squared
88
88
  end
89
89
  end
90
90
 
91
- def time_offset(val = nil)
92
- val = DateTime.parse(val) if val.is_a?(::String)
93
- cur = DateTime.now
94
- ret = 0
95
- if (r = /^([+-])(\d+):(\d+):(\d+)$/.match((val || cur).strftime('%::z')))
96
- ret += (r[1] == '+' ? -1 : 1) * ((r[2].to_i * 60 * 60) + (r[3].to_i * 60) + r[4].to_i) * 1000
97
- end
98
- return ret unless val
99
-
100
- (cur.strftime('%Q').to_i + time_offset) - (val.strftime('%Q').to_i + ret)
101
- end
102
-
103
91
  def time_since(val, ms: true)
104
92
  s = ms ? '%s%L' : '%s'
105
93
  Time.now.utc.strftime(s).to_i - Time.parse(val).utc.strftime(s).to_i
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'set'
4
+
3
5
  require_relative 'common/base'
4
- require_relative 'common/class'
5
6
  require_relative 'common/format'
6
7
  require_relative 'common/prompt'
7
8
  require_relative 'common/shell'
@@ -26,7 +26,7 @@ module Squared
26
26
  def link(project, main = project.dependfile.basename, name = nil, **kwargs, &blk)
27
27
  return unless project.enabled?
28
28
 
29
- ret = Viewer.new(main, name, project: project, **kwargs)
29
+ ret = new(main, name, project: project, **kwargs)
30
30
  ret.instance_eval(&blk) if block_given?
31
31
  ret
32
32
  end
@@ -169,7 +169,7 @@ module Squared
169
169
  end
170
170
 
171
171
  def style(name, *args)
172
- apply_style(theme, name, args)
172
+ apply_style theme, name, args
173
173
  self
174
174
  end
175
175
 
@@ -212,7 +212,7 @@ module Squared
212
212
  file = nil
213
213
  ext[0] = mime
214
214
  elsif file
215
- keys.unshift(file)
215
+ keys.prepend(file)
216
216
  alt = basepath("#{main}.{#{ext.join(',')}}")
217
217
  file = Dir[alt].first
218
218
  else
@@ -242,15 +242,16 @@ module Squared
242
242
  [
243
243
  { pat: /\A((?:[^:]|(?<! ):(?! ))+)\z/, styles: theme[:banner] },
244
244
  { pat: /\A(.*?)(<[^>]+>)(.+)\z/m, styles: theme[:undefined], index: 2 },
245
- { pat: /\A(.+)( : (?!undefined).+)\z/m, styles: theme[:key] },
246
- { pat: /\A(.+ : )(-?[\d.]+)(\s*)\z/m, styles: theme[:number],
245
+ { pat: /\A((?~ : ))( : (?!undefined).+)\z/m, styles: theme[:key] },
246
+ { pat: /\A((?~: ): )(-?[\d.]+)(\s*)\z/m, styles: theme[:number],
247
247
  index: 2 },
248
- { pat: /\A(.+ : ")(.+)("\s*)\z/m, styles: theme[:string], index: 2 },
249
- { pat: /\A(.+ : \{)(.+)(\}\s*)\z/m, styles: theme[:hash], index: 2 },
250
- { pat: /\A(.+ : \[)(.+)(\]\s*)\z/m, styles: theme[:array], index: 2 },
251
- { pat: /\A(.+ : )(true|false)(\s*)\z/m, styles: theme[:boolean],
248
+ { pat: /\A((?~: ): ")(.+)("\s*)\z/m, styles: theme[:string], index: 2 },
249
+ { pat: /\A((?~: ): \{)(.+)(\}\s*)\z/m, styles: theme[:hash], index: 2 },
250
+ { pat: /\A((?~: ): \[)(.+)(\]\s*)\z/m, styles: theme[:array],
252
251
  index: 2 },
253
- { pat: /\A(.+ : (?!undefined))([^"\[{].*)\z/m, styles: theme[:value],
252
+ { pat: /\A((?~: ): )(true|false)(\s*)\z/m, styles: theme[:boolean],
253
+ index: 2 },
254
+ { pat: /\A((?~: ): (?!undefined))([^"\[{].*)\z/m, styles: theme[:value],
254
255
  index: 2 }
255
256
  ]
256
257
  end, border: theme[:border])
@@ -293,7 +294,7 @@ module Squared
293
294
  if stdin?
294
295
  puts out.map!(&:last).join("\n")
295
296
  else
296
- out.map! { |item| "#{item[0].ljust(pad)} : #{item[1]}" }
297
+ out.map! { |item| '%-*s : %s' % [pad, item[0], item[1]] }
297
298
  end
298
299
  end
299
300
 
@@ -309,7 +310,7 @@ module Squared
309
310
  return unless Rake::TaskManager.record_task_metadata
310
311
 
311
312
  val = "#{ext.first}[#{target ? '' : "file?=#{File.basename(main)}.#{ext.last},"}keys+]"
312
- args = *name.split(':').push(command, val)
313
+ args = *name.split(':').append(command, val)
313
314
  if project
314
315
  project.workspace.task_desc(*args)
315
316
  else
@@ -347,7 +348,7 @@ module Squared
347
348
  end
348
349
 
349
350
  def basepath(file)
350
- project ? project.basepath(file) : Pathname.new(file).realdirpath
351
+ project ? project.basepath(file) : Pathname.pwd + file
351
352
  end
352
353
  end
353
354
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Squared
4
- VERSION = '0.4.14'
4
+ VERSION = '0.5.1'
5
5
  end