Class: Buildizer::Target::Patch

Inherits:
Base
  • Object
show all
Defined in:
lib/buildizer/target/patch.rb

Instance Attribute Summary

Attributes inherited from Base

#build_image, #builder, #cache_image, #os, #params, #test_image

Instance Method Summary collapse

Methods inherited from Base

#_package_cloud_path, #base_package_name, #build_image_name, #build_image_tag, #cache_image_name, #container_package_archive_name, #container_package_archive_path, #container_package_path, #image_build_path, #image_extra_path, #maintainer_email, #method_missing, #package_cloud, #package_version, #package_version_tag, #test_env, #test_image_name

Constructor Details

#initialize(builder, os, patch: [], patch_version: nil, **kwargs, &blk) ⇒ Patch

Returns a new instance of Patch.



4
5
6
7
8
9
10
11
# File 'lib/buildizer/target/patch.rb', line 4

def initialize(builder, os, patch: [], patch_version: nil, **kwargs, &blk)
  super(builder, os, **kwargs) do
    params[:patch] = patch
    params[:patch_version] = patch_version

    yield if block_given?
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Buildizer::Target::Base

Instance Method Details

#container_package_nameObject



21
22
23
# File 'lib/buildizer/target/patch.rb', line 21

def container_package_name
  "#{package_name}-#{patch_version}"
end

#image_work_pathObject



17
18
19
# File 'lib/buildizer/target/patch.rb', line 17

def image_work_path
  builder.work_path.join('patch').join(package_name).join(patch_version).join(name)
end

#package_version_tag_param_nameObject



25
26
27
# File 'lib/buildizer/target/patch.rb', line 25

def package_version_tag_param_name
  :patch_version
end

#patch_versionObject



13
14
15
# File 'lib/buildizer/target/patch.rb', line 13

def patch_version
  params[:patch_version].nil? ? nil : params[:patch_version].to_s
end