class EacLauncher::Paths::Real
Public Class Methods
new(path)
click to toggle source
Calls superclass method
# File lib/eac_launcher/paths/real.rb, line 6 def initialize(path) raise "Argument path is not a string: \"#{path}\"|#{path.class}" unless path.is_a?(String) super(path) end
Public Instance Methods
basename()
click to toggle source
# File lib/eac_launcher/paths/real.rb, line 16 def basename ::File.basename(self) end
dirname()
click to toggle source
# File lib/eac_launcher/paths/real.rb, line 20 def dirname return nil if self == '/' self.class.new(::File.dirname(self)) end
find_file_with_extension(extension)
click to toggle source
# File lib/eac_launcher/paths/real.rb, line 26 def find_file_with_extension(extension) r = find_files_with_extension(extension) return r.first if r.any? raise "Extension \"#{extension}\" not found in directory \"#{self}\"" end
find_files_with_extension(extension)
click to toggle source
# File lib/eac_launcher/paths/real.rb, line 33 def find_files_with_extension(extension) r = [] ::Dir.entries(self).each do |i| r << ::File.expand_path(i, self) if i =~ /#{::Regexp.quote(extension)}\z/ end r end
subpath(relative_path)
click to toggle source
# File lib/eac_launcher/paths/real.rb, line 12 def subpath(relative_path) ::EacLauncher::Paths::Real.new(::File.expand_path(relative_path, self)) end