Class: CobraCommander::Dependencies::YarnWorkspace
- Inherits:
-
Object
- Object
- CobraCommander::Dependencies::YarnWorkspace
- Defined in:
- lib/cobra_commander/dependencies/yarn_workspace.rb
Overview
Yarn workspace components source for an umbrella
Instance Attribute Summary collapse
-
#packages ⇒ Object
readonly
Returns the value of attribute packages.
Instance Method Summary collapse
- #components ⇒ Object
- #dependencies ⇒ Object
-
#initialize(root_path) ⇒ YarnWorkspace
constructor
A new instance of YarnWorkspace.
- #path ⇒ Object
Constructor Details
#initialize(root_path) ⇒ YarnWorkspace
14 15 16 17 18 19 |
# File 'lib/cobra_commander/dependencies/yarn_workspace.rb', line 14 def initialize(root_path) @repo = Yarn::PackageRepo.new @root_package = Yarn::Package.new(root_path) @repo.load_linked_specs(@root_package) load_workspace_packages end |
Instance Attribute Details
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
12 13 14 |
# File 'lib/cobra_commander/dependencies/yarn_workspace.rb', line 12 def packages @packages end |
Instance Method Details
#components ⇒ Object
29 30 31 32 33 |
# File 'lib/cobra_commander/dependencies/yarn_workspace.rb', line 29 def components @repo.specs.map do |spec| { path: spec.path, name: untag(spec.name), dependencies: spec.dependencies.keys.map(&method(:untag)) } end end |
#dependencies ⇒ Object
25 26 27 |
# File 'lib/cobra_commander/dependencies/yarn_workspace.rb', line 25 def dependencies (workspace_spec.keys | @root_package.dependencies.keys).map(&method(:untag)) end |
#path ⇒ Object
21 22 23 |
# File 'lib/cobra_commander/dependencies/yarn_workspace.rb', line 21 def path @root_package.path end |