Class: Ehbrs::Runner::Fs::UsedSpace::PathUnverbose

Inherits:
PathBase
  • Object
show all
Defined in:
lib/ehbrs/runner/fs/used_space.rb

Instance Method Summary collapse

Instance Method Details

#bytes_label(number) ⇒ Object



150
151
152
# File 'lib/ehbrs/runner/fs/used_space.rb', line 150

def bytes_label(number)
  number.if_present('-') { |v| ::Filesize.from("#{v} B").pretty }
end

#check_resultObject



144
145
146
147
148
# File 'lib/ehbrs/runner/fs/used_space.rb', line 144

def check_result
  return nil unless runner.check?

  observer.check_current_value ? 'Recorded'.green : 'Unchanged'.light_black
end

#output_lineObject



139
140
141
142
# File 'lib/ehbrs/runner/fs/used_space.rb', line 139

def output_line
  [path.to_s.cyan, last_change_time, last_value, current_value, check_result]
    .reject(&:blank?).join('|')
end

#runObject



135
136
137
# File 'lib/ehbrs/runner/fs/used_space.rb', line 135

def run
  self.puts output_line
end

#time_label(time) ⇒ Object



154
155
156
# File 'lib/ehbrs/runner/fs/used_space.rb', line 154

def time_label(time)
  time.if_present('-') { |t| t.strftime('%d/%m/%y %H:%M') }
end