Class: Quaker::PathExtensions

Inherits:
Object
  • Object
show all
Defined in:
lib/quaker/path_extensions.rb

Instance Method Summary collapse

Instance Method Details

#expand(services) ⇒ Object



19
20
21
# File 'lib/quaker/path_extensions.rb', line 19

def expand services
  services.each {|name, spec| expand_service_volumes(spec) }
end

#expand_path(volumes_desc, build_path) ⇒ Object



3
4
5
6
7
# File 'lib/quaker/path_extensions.rb', line 3

def expand_path volumes_desc, build_path
  parts = volumes_desc.split(':')
  parts[0].gsub! /^\~/, build_path
  parts.join(':')
end

#expand_service_volumes(spec) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/quaker/path_extensions.rb', line 9

def expand_service_volumes spec
  build_path = spec['build']
  return unless build_path

  volumes = spec['volumes']
  return unless volumes

  spec['volumes'] = volumes.map{|v| expand_path(v, build_path) }
end