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

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

Instance Method Summary collapse

Instance Method Details

#bytes_label(number) ⇒ Object



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

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

#check_resultObject



143
144
145
146
147
# File 'lib/ehbrs/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_lineObject



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

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

#runObject



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

def run
  self.puts output_line
end

#time_label(time) ⇒ Object



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

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