module RubyToUML::PathTransformer

Public Class Methods

transform_files_and_or_directories_paths_to_file_paths(paths) click to toggle source
# File lib/ruby_to_uml/path_transformer.rb, line 5
def self.transform_files_and_or_directories_paths_to_file_paths(paths)
  paths.map { |path| resolve_absolute_path(path) }
      .map { |path| path.file? ? path : resolve_children(path) }
      .flatten
      .map(&:to_s)
      .filter { |path| path.match?(/\.rb$/) }
      .sort
end

Private Class Methods

resolve_absolute_path(path) click to toggle source
# File lib/ruby_to_uml/path_transformer.rb, line 17
def resolve_absolute_path(path)
  Pathname.new(File.expand_path(path, Dir.pwd))
end
resolve_children(path) click to toggle source
# File lib/ruby_to_uml/path_transformer.rb, line 21
def resolve_children(path)
  path.children.map do |child|
    if child.file?
      child
    elsif child.directory?
      resolve_children(child)
    end
  end
end