Sha256: 0e3f24b49ca8f038dab5331adf50bdd96b9391ee5457a5cc1a8016c7f229f169
Contents?: true
Size: 1.75 KB
Versions: 1
Compression:
Stored size: 1.75 KB
Contents
require 'eac_launcher/paths/real' require 'eac_launcher/stereotypes' module EacLauncher module Paths class Logical include ::EacRubyUtils::SimpleCache class << self def from_h(context, h) parent_path = h[:parent_path] ? from_h(context, h[:parent_path]) : nil new(context, parent_path, h[:real], h[:logical]) end end attr_reader :context, :real, :logical, :parent_path def initialize(context, parent_path, real, logical) @context = context @parent_path = parent_path @real = ::EacLauncher::Paths::Real.new(real) @logical = logical end def to_s logical end def to_h { logical: logical, real: real.to_s, parent_path: parent_path ? parent_path.to_h : nil } end def project? stereotypes.any? end def children r = [] Dir.entries(warped).each do |c| c_path = ::File.join(warped, c) next unless ::File.directory?(c_path) next if c.start_with?('.') r << build_child(c) end r end def included? !context.settings.excluded_paths.include?(logical) end private def stereotypes_uncached ::EacLauncher::Stereotype.stereotypes.select { |s| s.match?(self) } end def build_child(name) ::EacLauncher::Paths::Logical.new( context, self, ::File.join(warped, name), ::File.join(logical, name) ) end def warped_uncached if is_a?(::EacLauncher::Instances::Base) stereotypes.each do |s| return s.warp_class.new(self) if s.warp_class end end real end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
eac_launcher-0.6.0 | lib/eac_launcher/paths/logical.rb |