frachtraum 0.0.6 → 0.0.7
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 +8 -8
- data/lib/frachtraum/bsd.rb +2 -2
- data/lib/frachtraum/cli.rb +12 -2
- data/lib/frachtraum.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTEyNjVhODE2MWZkNTBhYWIxMzRiMzliY2MyMTUwZWNhYmIxNjk4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTg2NTZjZDBhZmNhZDcwNWYwZWRmOTVjODk5OGIwNjQxNmE1NzVkNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWZlMjJiYTdkOWNhYzcyZTY2YjVhZThhZWM0OGQ5OWUxMWJjZTViZWU2Y2Q3
|
10
|
+
MDIwYWVlY2RjODI3ZjRiOGQxNjA3ZTVmYTA3MzU4YjBjMzEzOTgwOWU4ZjJh
|
11
|
+
MDg5MTQwMmE1OTAwNjQ5MjFmYTc5MTUxOWNmYTRlZDY3OTM4Yzc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODY5NTM5ZDVlYzY5Y2U3ZjA4OWQwZTA1ZDY2YmQyZDgwNzkxYWFmNjE1NjRl
|
14
|
+
ODM0N2Q5YmY4MThlNTA0MWY0NWZjYmVmM2Y0ZWVjOGMzODkwMGExZjUwNmJj
|
15
|
+
OWQzNTQwYmEzM2U2ODVhM2VhNGMwYzUyMzM4MTYzZjAzMzkyNTY=
|
data/lib/frachtraum/bsd.rb
CHANGED
@@ -19,14 +19,14 @@ module Frachtraum
|
|
19
19
|
else
|
20
20
|
puts Rainbow("FAILED!").red + " --> #{output}"
|
21
21
|
end
|
22
|
-
end # each
|
22
|
+
end # volumes.each
|
23
23
|
|
24
24
|
# mount timemachine targets as well
|
25
25
|
Frachtraum::TIMEMACHINE_TARGETS.each do |tmtarget|
|
26
26
|
print "mounting tm #{tmtarget}...".ljust(OUTPUT_DOTS_LEN,".")
|
27
27
|
|
28
28
|
output = %x( zfs mount #{tmtarget} 2>&1 )
|
29
|
-
if $?.success? puts Rainbow("DONE").green
|
29
|
+
if $?.success? then puts Rainbow("DONE").green
|
30
30
|
else puts Rainbow("FAILED!").red + " --> #{output}" end
|
31
31
|
end
|
32
32
|
|
data/lib/frachtraum/cli.rb
CHANGED
@@ -118,11 +118,21 @@ module Frachtraum
|
|
118
118
|
|
119
119
|
report_rows = []
|
120
120
|
report_data = Frachtraum.report
|
121
|
+
|
121
122
|
report_data.keys.each do |volume|
|
122
123
|
volume_h = report_data[volume]
|
124
|
+
|
125
|
+
# display available output red if there is less then 10% space left on volume
|
126
|
+
available_str =
|
127
|
+
if volume_h[:available].to_i <= 0.1 * volume_h[:total].to_i && volume_h[:total].to_i != 0
|
128
|
+
Rainbow(Frachtraum.pretty_SI_bytes(volume_h[:available].to_i)).red
|
129
|
+
else
|
130
|
+
Frachtraum.pretty_SI_bytes(volume_h[:available].to_i)
|
131
|
+
end
|
132
|
+
|
123
133
|
report_rows << [ volume,
|
124
134
|
Frachtraum.pretty_SI_bytes(volume_h[:used].to_i),
|
125
|
-
Frachtraum.pretty_SI_bytes(volume_h[:available].to_i),
|
135
|
+
available_str, #Frachtraum.pretty_SI_bytes(volume_h[:available].to_i),
|
126
136
|
Frachtraum.pretty_SI_bytes(volume_h[:total].to_i),
|
127
137
|
volume_h[:compression],
|
128
138
|
volume_h[:compressratio]
|
@@ -132,9 +142,9 @@ module Frachtraum
|
|
132
142
|
# TODO
|
133
143
|
table = Terminal::Table.new :headings => ["VOLUMES", "USED", "AVAILABLE", "TOTAL", "COMPRESSION", "COMPRESSRATIO"], :rows => report_rows
|
134
144
|
|
145
|
+
table.align_column(1, :right)
|
135
146
|
table.align_column(2, :right)
|
136
147
|
table.align_column(3, :right)
|
137
|
-
table.align_column(4, :right)
|
138
148
|
|
139
149
|
puts table
|
140
150
|
self.capacity
|
data/lib/frachtraum.rb
CHANGED