Class: Mona::Project
Defined Under Namespace
Classes: Builder, Factory, FindRoot, Initializer
Constant Summary collapse
- DEFAULT_OPTIONS =
{ configs_dir: 'configs', package_dirname: 'package', packages_lookup_subdir: ".", loader: Mona::Loaders::Base, tasks: [] }
Instance Attribute Summary collapse
-
#configs_dir ⇒ Object
readonly
Returns the value of attribute configs_dir.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#loader ⇒ Object
readonly
Returns the value of attribute loader.
-
#package_dirname ⇒ Object
readonly
Returns the value of attribute package_dirname.
-
#packages ⇒ Object
readonly
Returns the value of attribute packages.
-
#packages_lookup_subdir ⇒ Object
readonly
Returns the value of attribute packages_lookup_subdir.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Instance Method Summary collapse
-
#initialize(root_path:, env:, loader: nil, configs_dir: nil, package_dirname: nil, packages_lookup_subdir: nil, tasks: nil) ⇒ Project
constructor
A new instance of Project.
- #set_packages(packages) ⇒ Object
Methods included from Mixins
Constructor Details
#initialize(root_path:, env:, loader: nil, configs_dir: nil, package_dirname: nil, packages_lookup_subdir: nil, tasks: nil) ⇒ Project
Returns a new instance of Project.
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/mona/project.rb', line 26 def initialize(root_path:, env:, loader: nil, configs_dir: nil, package_dirname: nil, packages_lookup_subdir: nil, tasks: nil) @root_path = root_path @env = env @packages = [] @loader = loader || DEFAULT_OPTIONS.fetch(:loader).new(@root_path) @tasks = tasks || DEFAULT_OPTIONS.fetch(:tasks) @configs_dir = configs_dir || DEFAULT_OPTIONS.fetch(:configs_dir) @package_dirname = package_dirname || DEFAULT_OPTIONS.fetch(:package_dirname) @packages_lookup_subdir = packages_lookup_subdir || DEFAULT_OPTIONS.fetch(:packages_lookup_subdir) nil end |
Instance Attribute Details
#configs_dir ⇒ Object (readonly)
Returns the value of attribute configs_dir.
4 5 6 |
# File 'lib/mona/project.rb', line 4 def configs_dir @configs_dir end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
4 5 6 |
# File 'lib/mona/project.rb', line 4 def env @env end |
#loader ⇒ Object (readonly)
Returns the value of attribute loader.
4 5 6 |
# File 'lib/mona/project.rb', line 4 def loader @loader end |
#package_dirname ⇒ Object (readonly)
Returns the value of attribute package_dirname.
4 5 6 |
# File 'lib/mona/project.rb', line 4 def package_dirname @package_dirname end |
#packages ⇒ Object (readonly)
Returns the value of attribute packages.
4 5 6 |
# File 'lib/mona/project.rb', line 4 def packages @packages end |
#packages_lookup_subdir ⇒ Object (readonly)
Returns the value of attribute packages_lookup_subdir.
4 5 6 |
# File 'lib/mona/project.rb', line 4 def packages_lookup_subdir @packages_lookup_subdir end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
4 5 6 |
# File 'lib/mona/project.rb', line 4 def root_path @root_path end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
4 5 6 |
# File 'lib/mona/project.rb', line 4 def tasks @tasks end |
Instance Method Details
#set_packages(packages) ⇒ Object
40 41 42 |
# File 'lib/mona/project.rb', line 40 def set_packages(packages) @packages = packages end |