Module: Cog::Config::ProjectConfig
- Included in:
- Cog::Config
- Defined in:
- lib/cog/config/project_config.rb
Overview
Cog::Config methods related to projects
Instance Attribute Summary collapse
-
#project_cogfile_path ⇒ String
readonly
Path to the project’s DSL::Cogfile.
-
#project_generator_path ⇒ String?
readonly
Directory in which to place project generators.
-
#project_path ⇒ String
readonly
Directory in which to place generated output.
-
#project_plugin_path ⇒ String?
readonly
Directory in which to place project plugins.
-
#project_root ⇒ String
readonly
Directory in which the project’s DSL::Cogfile is found.
-
#project_template_path ⇒ String?
readonly
Directory in which to place project templates.
Instance Method Summary collapse
-
#project? ⇒ Boolean
Whether or not we operating in the context of a project.
-
#supported_project_files ⇒ Array<String>
List of paths to files in the #project_path which are written in a supported language.
Instance Attribute Details
#project_cogfile_path ⇒ String (readonly)
Returns path to the project’s DSL::Cogfile.
8 9 10 |
# File 'lib/cog/config/project_config.rb', line 8 def project_cogfile_path @project_cogfile_path end |
#project_generator_path ⇒ String? (readonly)
Returns directory in which to place project generators.
17 18 19 |
# File 'lib/cog/config/project_config.rb', line 17 def project_generator_path @project_generator_path end |
#project_path ⇒ String (readonly)
Returns directory in which to place generated output. For example, the destination
parameter of Generator#stamp is relative to this path.
11 12 13 |
# File 'lib/cog/config/project_config.rb', line 11 def project_path @project_path end |
#project_plugin_path ⇒ String? (readonly)
Returns directory in which to place project plugins.
20 21 22 |
# File 'lib/cog/config/project_config.rb', line 20 def project_plugin_path @project_plugin_path end |
#project_root ⇒ String (readonly)
Returns directory in which the project’s DSL::Cogfile is found.
14 15 16 |
# File 'lib/cog/config/project_config.rb', line 14 def project_root @project_root end |
#project_template_path ⇒ String? (readonly)
Returns directory in which to place project templates.
23 24 25 |
# File 'lib/cog/config/project_config.rb', line 23 def project_template_path @project_template_path end |
Instance Method Details
#project? ⇒ Boolean
Returns whether or not we operating in the context of a project.
26 27 28 |
# File 'lib/cog/config/project_config.rb', line 26 def project? !@project_root.nil? end |
#supported_project_files ⇒ Array<String>
Returns list of paths to files in the #project_path which are written in a supported language.
31 32 33 34 35 36 37 38 |
# File 'lib/cog/config/project_config.rb', line 31 def supported_project_files if project? exts = Cog.language_extensions.join ',' Dir.glob "#{Cog.project_path}/**/*.{#{exts}}" else [] end end |