Class: RubySkills::Resolver

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_skills/resolver.rb

Overview

Turns a declared skill into a local directory that can be installed.

Local skills are resolved from Manifest::Skill#path. Remote skills are cloned from GitHub into a temporary directory.

Examples:

Resolve a declared skill

skill = RubySkills::Manifest::Skill.new(
  name: "rails-performance",
  path: "./skills/rails-performance"
)
RubySkills::Resolver.new.resolve(skill)

See Also:

Since:

  • 0.1.0

Defined Under Namespace

Classes: ResolvedSkill

Instance Method Summary collapse

Instance Method Details

#resolve(skill) ⇒ ResolvedSkill

Resolve a skill from a local path or a remote repository.

Parameters:

Returns:

Raises:

Since:

  • 0.1.0



41
42
43
44
45
46
47
48
49
50
# File 'lib/ruby_skills/resolver.rb', line 41

def resolve(skill)
  if skill.path
    resolve_local(skill)
  elsif skill.github
    resolve_remote(skill)
  else
    raise RubySkills::Error,
          "Unable to resolve #{skill.name}"
  end
end