Class: RubySkills::Config
- Inherits:
-
Object
- Object
- RubySkills::Config
- Defined in:
- lib/ruby_skills/config.rb
Overview
Resolves project paths and bootstraps a Ruby Skills workspace.
Paths for Skillfile, Skills.lock and the local skills directory
are derived from a project root.
Constant Summary collapse
- SKILLFILE =
Filename of the project skill manifest.
"Skillfile"- LOCKFILE =
Filename of the installed-skills lockfile.
"Skills.lock"- SKILLS_DIRECTORY =
Directory where installed skills are stored.
".ruby-skills"
Instance Method Summary collapse
-
#initialize(root: Dir.pwd) ⇒ Config
constructor
A new instance of Config.
-
#initialize_project! ⇒ void
Create the skills directory and a starter Skillfile when missing.
-
#lockfile_path ⇒ Pathname
Absolute path to the project lockfile.
-
#skillfile_path ⇒ Pathname
Absolute path to the project Skillfile.
-
#skills_path ⇒ Pathname
Absolute path to the local skills directory.
Constructor Details
Instance Method Details
#initialize_project! ⇒ void
This method returns an undefined value.
Create the skills directory and a starter Skillfile when missing.
31 32 33 34 |
# File 'lib/ruby_skills/config.rb', line 31 def initialize_project! create_skills_directory create_skillfile end |
#lockfile_path ⇒ Pathname
Returns absolute path to the project lockfile.
42 43 44 |
# File 'lib/ruby_skills/config.rb', line 42 def lockfile_path @root.join(LOCKFILE) end |
#skillfile_path ⇒ Pathname
Returns absolute path to the project Skillfile.
37 38 39 |
# File 'lib/ruby_skills/config.rb', line 37 def skillfile_path @root.join(SKILLFILE) end |
#skills_path ⇒ Pathname
Returns absolute path to the local skills directory.
47 48 49 |
# File 'lib/ruby_skills/config.rb', line 47 def skills_path @root.join(SKILLS_DIRECTORY) end |