Method: Template::Spec.hash_for_spec_path

Defined in:
lib/template/spec.rb

.hash_for_spec_path(spec_path) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/template/spec.rb', line 29

def self.hash_for_spec_path(spec_path)
  relative_spec = spec_path.gsub(Klipp::Configuration.root_dir, '')
  {
      name: File.basename(spec_path, '.klippspec'),
      repo: relative_spec.split(File::SEPARATOR).map { |x| x=="" ? File::SEPARATOR : x }[1..-1].first
  }
end