Class: Ehbrs::Tools::Self::Observers::UsedSpace

Inherits:
WithPersistence show all
Defined in:
lib/ehbrs/tools/self/observers/used_space.rb

Instance Method Summary collapse

Methods inherited from WithPersistence

#changing_value?, #check_current_value

Instance Method Details

#calculate_valueObject



12
13
14
15
16
17
# File 'lib/ehbrs/tools/self/observers/used_space.rb', line 12

def calculate_value
  env = ::EacRubyUtils::Envs.local
  env.command('du', '-sb', path.to_s).pipe(
    env.command('cut', '-f', '-1')
  ).execute!.strip.to_i
end

#pathObject



8
9
10
# File 'lib/ehbrs/tools/self/observers/used_space.rb', line 8

def path
  label
end