class Morion::FileRef

Constants

EXTENSION_REGEX
FILENAME_REGEX

Attributes

extension[RW]
filename[RW]
folder_path[RW]
path[RW]
relative_path[RW]

Public Class Methods

new(path, current_path) click to toggle source
# File lib/morion/file_ref.rb, line 8
def initialize(path, current_path)
  @path = path
  @current_path = current_path
  @filename = @path.match(FILENAME_REGEX)[1]
  @extension = filename.match(EXTENSION_REGEX)[0]
  @relative_path = @path.gsub(@current_path, '')
  @folder_path = @relative_path.match(%r{(.*)/.*})[1]
end