Module: Ian::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/ian/utils.rb

Instance Method Summary collapse

Instance Method Details

#determine_installed_size(path) ⇒ Object



5
6
7
# File 'lib/ian/utils.rb', line 5

def determine_installed_size(path)
  %x[du #{path} -ks --exclude=".git" --exclude="pkg"].split.first
end

#guess_maintainerObject

try to guess the maintainer by reading the git config file



10
11
12
13
14
15
16
17
18
# File 'lib/ian/utils.rb', line 10

def guess_maintainer
  text = File.read(File.join(ENV['HOME'], ".gitconfig"))
  name = text.match(/name = (.*)$/)[1]
  email = text.match(/email = (.*)$/)[1]

  "#{name} <#{email}>"
rescue Errno::ENOENT
  return ""
end