Module: JamfRubyExtensions::Pathname::Predicates

Included in:
Pathname
Defined in:
lib/jamf/ruby_extensions/pathname/predicates.rb

Instance Method Summary collapse

Instance Method Details

#j_include?(other) ⇒ Boolean

does a path include another? i.e. is 'other' a descendant of self ?

Returns:

  • (Boolean)


40
41
42
43
44
# File 'lib/jamf/ruby_extensions/pathname/predicates.rb', line 40

def j_include?(other)
  eps = expand_path.to_s
  oeps = other.expand_path.to_s
  oeps != eps && oeps.start_with?(eps)
end

#j_real_file?Boolean

Is this a real file rather than a symlink?

Returns:

  • (Boolean)

See Also:

  • FileTest.real_file


34
35
36
# File 'lib/jamf/ruby_extensions/pathname/predicates.rb', line 34

def j_real_file?
  FileTest.real_file? self
end