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

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

Instance Method Summary collapse

Methods inherited from WithPersistence

#changing_value?, #check_current_value

Instance Method Details

#calculate_valueObject



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

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



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

def path
  label
end