firespring_dev_commands 2.1.29.pre.alpha.1 → 2.1.29.pre.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baa5ac0c4b177560aa4b26d69a90e73922c0d08f1754998810e4340506ca4c4f
|
4
|
+
data.tar.gz: e5fc7ec49280a1a12b960d95f8c1247372d463ca55d4df175064d60337fad6fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c72a389ad590e3359ee71f2be1824d806bc5fc82e8ec8154d3c268ee39a1bca8c68e810e15b38f1d04542c809bf7bdbe623639c4e9202fcb40e7825e5e423e4
|
7
|
+
data.tar.gz: 15a2b5e3560c8f813f501c0e41094571149cf35003cb2733a66e1de45c127074fdad3371de92aab18aaeb6831c9ae013e52f41d03a59813fc6cb3e20b8e169b6
|
@@ -196,5 +196,16 @@ module Dev
|
|
196
196
|
center_str = string.length / 2
|
197
197
|
string.rjust(center_dash + center_str - 1, pad).ljust(len - 1, pad)
|
198
198
|
end
|
199
|
+
|
200
|
+
# Print the given filesize using the most appropriate units
|
201
|
+
def filesize(size)
|
202
|
+
return '0.0 B' if size.to_i.zero?
|
203
|
+
|
204
|
+
units = %w(B KB MB GB TB Pb EB)
|
205
|
+
exp = (Math.log(size) / Math.log(1024)).to_i
|
206
|
+
exp = 6 if exp > 6
|
207
|
+
|
208
|
+
format('%.1f %s', size.to_f / (1024**exp), units[exp])
|
209
|
+
end
|
199
210
|
end
|
200
211
|
end
|
@@ -103,7 +103,7 @@ module Dev
|
|
103
103
|
LOG.info "\nDeleted #{type.capitalize}"
|
104
104
|
deleted_items = info["#{type}Deleted"] || []
|
105
105
|
deleted_items.each { |it| LOG.info " #{it}" }
|
106
|
-
LOG.info "Total reclaimed space: #{filesize(info['SpaceReclaimed'])}"
|
106
|
+
LOG.info "Total reclaimed space: #{Dev::Common.new.filesize(info['SpaceReclaimed'])}"
|
107
107
|
end
|
108
108
|
|
109
109
|
# Print the given filesize using the most appropriate units
|
@@ -275,7 +275,7 @@ module Dev
|
|
275
275
|
arch = "#{arch}/#{variant}" if variant
|
276
276
|
id = image.info&.dig('id')&.split(':')&.last&.slice(0..11)
|
277
277
|
created = timesince(Time.at(image.info&.dig('Created')))
|
278
|
-
size = filesize(image.info&.dig('Size'))
|
278
|
+
size = Dev::Common.new.filesize(image.info&.dig('Size'))
|
279
279
|
|
280
280
|
repo_urls = image.info&.dig('RepoTags')
|
281
281
|
repo_urls ||= ["#{image.info&.dig('RepoDigests')&.first&.split(':')&.first&.split('@')&.first}:<none>"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.29.pre.alpha.
|
4
|
+
version: 2.1.29.pre.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03
|
11
|
+
date: 2024-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|