Class: HelixRuntime::ParentProject

Inherits:
Object
  • Object
show all
Defined in:
lib/helix_runtime/parent_project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ ParentProject

Returns a new instance of ParentProject.



6
7
8
# File 'lib/helix_runtime/parent_project.rb', line 6

def initialize(root)
  @root = find_root(root)
end

Instance Attribute Details

#rootObject

Returns the value of attribute root.



4
5
6
# File 'lib/helix_runtime/parent_project.rb', line 4

def root
  @root
end

Instance Method Details

#ensure_built!Object



16
17
18
# File 'lib/helix_runtime/parent_project.rb', line 16

def ensure_built!
  projects.each(&:ensure_built!)
end

#outdated_build?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/helix_runtime/parent_project.rb', line 20

def outdated_build?
  projects.any?(&:outdated_build?)
end

#projectsObject



10
11
12
13
14
# File 'lib/helix_runtime/parent_project.rb', line 10

def projects
  @projects ||= Dir["#{root}/crates/*"]
                    .select{|f| File.exist?("#{f}/Cargo.toml") }
                    .map{|d| Project.new(d) }
end