Class: Pathname

Inherits:
Object
  • Object
show all
Defined in:
lib/launchr/extend/pathname.rb

Instance Method Summary collapse

Instance Method Details

#chown_R(user, group) ⇒ Object



9
10
11
12
# File 'lib/launchr/extend/pathname.rb', line 9

def chown_R user, group
  require 'fileutils'
  FileUtils.chown_R user, group, self.to_s
end

#groupObject



18
19
20
# File 'lib/launchr/extend/pathname.rb', line 18

def group
  Etc.getgrgid(self.stat.gid).name
end

#include?(partial) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/launchr/extend/pathname.rb', line 5

def include? partial
  self.to_s.include? partial.to_s
end

#touchObject



22
23
24
25
# File 'lib/launchr/extend/pathname.rb', line 22

def touch
  require 'fileutils'
  FileUtils.touch self.to_s
end

#userObject



14
15
16
# File 'lib/launchr/extend/pathname.rb', line 14

def user
  Etc.getpwuid(self.stat.uid).name
end