Class: Ehbrs::Tools::Runner::Fs::UsedSpace::PathUnverbose
- Defined in:
- lib/ehbrs/tools/runner/fs/used_space.rb
Instance Method Summary collapse
- #bytes_label(number) ⇒ Object
- #check_result ⇒ Object
- #output_line ⇒ Object
- #run ⇒ Object
- #time_label(time) ⇒ Object
Instance Method Details
#bytes_label(number) ⇒ Object
149 150 151 |
# File 'lib/ehbrs/tools/runner/fs/used_space.rb', line 149 def bytes_label(number) number.if_present('-') { |v| ::Filesize.from("#{v} B").pretty } end |
#check_result ⇒ Object
143 144 145 146 147 |
# File 'lib/ehbrs/tools/runner/fs/used_space.rb', line 143 def check_result return nil unless runner.check? observer.check_current_value ? 'Recorded'.green : 'Unchanged'.light_black end |
#output_line ⇒ Object
138 139 140 141 |
# File 'lib/ehbrs/tools/runner/fs/used_space.rb', line 138 def output_line [path.to_s.cyan, last_change_time, last_value, current_value, check_result] .compact_blank.join('|') end |
#run ⇒ Object
134 135 136 |
# File 'lib/ehbrs/tools/runner/fs/used_space.rb', line 134 def run self.puts output_line end |
#time_label(time) ⇒ Object
153 154 155 |
# File 'lib/ehbrs/tools/runner/fs/used_space.rb', line 153 def time_label(time) time.if_present('-') { |t| t.strftime('%d/%m/%y %H:%M') } end |