Class: DockerAlias::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/docker_alias/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



6
7
8
9
10
11
12
13
# File 'lib/docker_alias/configuration.rb', line 6

def initialize
  @repo = ''
  @tag = 'latest'
  @cache_buster_key = 'CACHE_BUSTER_'
  @options = []
  @enviroments = {}
  @port_maps = []
end

Instance Attribute Details

#cache_buster_keyObject

Returns the value of attribute cache_buster_key.



3
4
5
# File 'lib/docker_alias/configuration.rb', line 3

def cache_buster_key
  @cache_buster_key
end

#enviromentsObject



27
28
29
30
31
32
33
# File 'lib/docker_alias/configuration.rb', line 27

def enviroments
  envs = []
  @enviroments.each do |key, value|
    envs << "-e #{key}=#{value}"
  end
  envs.join(" ")
end

#optionsObject



19
20
21
# File 'lib/docker_alias/configuration.rb', line 19

def options
  @options.join(" ")
end

#port_mapsObject



23
24
25
# File 'lib/docker_alias/configuration.rb', line 23

def port_maps
  @port_maps.map{ |x| "-p #{x}" }.join(" ")
end

#repoObject

Returns the value of attribute repo.



3
4
5
# File 'lib/docker_alias/configuration.rb', line 3

def repo
  @repo
end

#tagObject

Returns the value of attribute tag.



3
4
5
# File 'lib/docker_alias/configuration.rb', line 3

def tag
  @tag
end

Instance Method Details

#build_nameObject



15
16
17
# File 'lib/docker_alias/configuration.rb', line 15

def build_name
  "#{@repo}:#{@tag}"
end