Module: Ian::Utils
Instance Method Summary collapse
- #determine_installed_size(path) ⇒ Object
-
#guess_maintainer ⇒ Object
try to guess the maintainer by reading the git config file.
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_maintainer ⇒ Object
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 |