Class: Mona::Package
Defined Under Namespace
Classes: Builder, DependencyBypasser, Factory, FindRoot, Indexer, Initializer, List, Repo
Constant Summary collapse
- DEFAULT_ENV =
:_default_
Instance Attribute Summary collapse
-
#configs ⇒ Object
readonly
Returns the value of attribute configs.
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
Instance Method Summary collapse
- #entrypoint_file ⇒ Object
- #get_dependencies(env = nil) ⇒ Object
- #get_dependency_envs ⇒ Object
-
#initialize(name:, root_path:, package_dirname:, dependencies:) ⇒ Package
constructor
A new instance of Package.
- #specs_path ⇒ Object
- #workdir_path ⇒ Object
Methods included from Mixins
Constructor Details
#initialize(name:, root_path:, package_dirname:, dependencies:) ⇒ Package
Returns a new instance of Package.
17 18 19 20 21 22 23 24 |
# File 'lib/mona/package.rb', line 17 def initialize(name:, root_path:, package_dirname:, dependencies:) @name = name @root_path = root_path @package_dirname = package_dirname @dependencies = dependencies nil end |
Instance Attribute Details
#configs ⇒ Object (readonly)
Returns the value of attribute configs.
4 5 6 |
# File 'lib/mona/package.rb', line 4 def configs @configs end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
4 5 6 |
# File 'lib/mona/package.rb', line 4 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/mona/package.rb', line 4 def name @name end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
4 5 6 |
# File 'lib/mona/package.rb', line 4 def root_path @root_path end |
Instance Method Details
#entrypoint_file ⇒ Object
44 45 46 |
# File 'lib/mona/package.rb', line 44 def entrypoint_file File.join( self.workdir_path, "#{name}.rb" ) end |
#get_dependencies(env = nil) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/mona/package.rb', line 29 def get_dependencies(env = nil) default_deps = @dependencies.fetch(DEFAULT_ENV, []) env_deps = @dependencies.fetch(env, []) default_deps | env_deps end |
#get_dependency_envs ⇒ Object
36 37 38 |
# File 'lib/mona/package.rb', line 36 def get_dependency_envs @dependencies.keys end |
#specs_path ⇒ Object
48 49 50 |
# File 'lib/mona/package.rb', line 48 def specs_path File.join( self.root_path, '/spec/' ) end |
#workdir_path ⇒ Object
40 41 42 |
# File 'lib/mona/package.rb', line 40 def workdir_path File.join( self.root_path, @package_dirname ) end |