Class: Nib::History::Compose

Inherits:
Object
  • Object
show all
Defined in:
lib/nib/history/compose.rb

Defined Under Namespace

Classes: Service, Services, Volumes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCompose

Returns a new instance of Compose.



7
8
9
10
11
12
# File 'lib/nib/history/compose.rb', line 7

def initialize
  @volume_name = 'nib_history'
  @dir = "#{Dir.tmpdir}/#{Dir.pwd.split('/').last}"

  FileUtils.mkdir_p(dir)
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



5
6
7
# File 'lib/nib/history/compose.rb', line 5

def dir
  @dir
end

#volume_nameObject (readonly)

Returns the value of attribute volume_name.



5
6
7
# File 'lib/nib/history/compose.rb', line 5

def volume_name
  @volume_name
end

Instance Method Details

#configObject



18
19
20
21
22
# File 'lib/nib/history/compose.rb', line 18

def config
  original_config
    .merge('services' => services_config)
    .merge('volumes' => volumes_config)
end

#pathObject



14
15
16
# File 'lib/nib/history/compose.rb', line 14

def path
  file.path
end