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 Also known as: jss_include?

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

Returns:

  • (Boolean)


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

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 Also known as: jss_real_file?

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