Class: Avm::Launcher::Paths::Logical
- Inherits:
-
Object
- Object
- Avm::Launcher::Paths::Logical
- Defined in:
- lib/avm/launcher/paths/logical.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build_child(name) ⇒ Avm::Launcher::Paths::Logical
- #children ⇒ Object
- #included? ⇒ Boolean
- #project? ⇒ Boolean
- #to_h ⇒ Object
- #to_s ⇒ Object
Class Method Details
.from_h(context, hash) ⇒ Object
10 11 12 13 |
# File 'lib/avm/launcher/paths/logical.rb', line 10 def from_h(context, hash) parent_path = hash[:parent_path] ? from_h(context, hash[:parent_path]) : nil new(context, parent_path, hash[:real], hash[:logical]) end |
Instance Method Details
#build_child(name) ⇒ Avm::Launcher::Paths::Logical
36 37 38 39 40 41 42 43 |
# File 'lib/avm/launcher/paths/logical.rb', line 36 def build_child(name) ::Avm::Launcher::Paths::Logical.new( context, self, ::File.join(warped, name), ::File.join(logical, name) ) end |
#children ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/avm/launcher/paths/logical.rb', line 45 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 |
#included? ⇒ Boolean
57 58 59 |
# File 'lib/avm/launcher/paths/logical.rb', line 57 def included? context.settings.excluded_paths.exclude?(logical) end |
#project? ⇒ Boolean
30 31 32 |
# File 'lib/avm/launcher/paths/logical.rb', line 30 def project? stereotypes.any? end |
#to_h ⇒ Object
26 27 28 |
# File 'lib/avm/launcher/paths/logical.rb', line 26 def to_h { logical: logical, real: real.to_s, parent_path: parent_path&.to_h } end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/avm/launcher/paths/logical.rb', line 22 def to_s logical end |