Class: DockerAlias::Configuration
- Inherits:
-
Object
- Object
- DockerAlias::Configuration
- Defined in:
- lib/docker_alias/configuration.rb
Instance Attribute Summary collapse
-
#cache_buster_key ⇒ Object
Returns the value of attribute cache_buster_key.
- #enviroments ⇒ Object
- #options ⇒ Object
- #port_maps ⇒ Object
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
- #build_name ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_' = [] @enviroments = {} @port_maps = [] end |
Instance Attribute Details
#cache_buster_key ⇒ Object
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 |
#enviroments ⇒ Object
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 |
#options ⇒ Object
19 20 21 |
# File 'lib/docker_alias/configuration.rb', line 19 def .join(" ") end |
#port_maps ⇒ Object
23 24 25 |
# File 'lib/docker_alias/configuration.rb', line 23 def port_maps @port_maps.map{ |x| "-p #{x}" }.join(" ") end |
#repo ⇒ Object
Returns the value of attribute repo.
3 4 5 |
# File 'lib/docker_alias/configuration.rb', line 3 def repo @repo end |
#tag ⇒ Object
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_name ⇒ Object
15 16 17 |
# File 'lib/docker_alias/configuration.rb', line 15 def build_name "#{@repo}:#{@tag}" end |