Class: Indocker::ImageDSL
- Inherits:
-
Object
- Object
- Indocker::ImageDSL
show all
- Defined in:
- lib/indocker/image/image_dsl.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(context) ⇒ ImageDSL
Returns a new instance of ImageDSL.
4
5
6
7
|
# File 'lib/indocker/image/image_dsl.rb', line 4
def initialize(context)
@context = context
@directives = []
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
9
10
11
12
13
|
# File 'lib/indocker/image/image_dsl.rb', line 9
def method_missing(method, *args)
@context.send(method)
rescue
super
end
|
Instance Attribute Details
#directives ⇒ Object
Returns the value of attribute directives.
2
3
4
|
# File 'lib/indocker/image/image_dsl.rb', line 2
def directives
@directives
end
|
Instance Method Details
#before_build(&block) ⇒ Object
62
63
64
|
# File 'lib/indocker/image/image_dsl.rb', line 62
def before_build(&block)
instance_exec &block
end
|
#copy(copy_actions) ⇒ Object
39
40
41
42
43
44
|
# File 'lib/indocker/image/image_dsl.rb', line 39
def copy(copy_actions)
@directives << Indocker::DockerDirectives::Copy.new(
context: @context,
copy_actions: copy_actions
)
end
|
#copy_compile(copy_actions) ⇒ Object
46
47
48
49
50
51
52
|
# File 'lib/indocker/image/image_dsl.rb', line 46
def copy_compile(copy_actions)
@directives << Indocker::DockerDirectives::Copy.new(
context: @context,
copy_actions: copy_actions,
compile: true
)
end
|
#docker_cp(container_name, &block) ⇒ Object
66
67
68
|
# File 'lib/indocker/image/image_dsl.rb', line 66
def docker_cp(container_name, &block)
@directives << Indocker::PrepareDirectives::DockerCp.new(container_name, @context.build_dir, &block)
end
|
#entrypoint(*args) ⇒ Object
#partial(name, opts = {}) ⇒ Object
19
20
21
|
# File 'lib/indocker/image/image_dsl.rb', line 19
def partial(name, opts = {})
@directives << Indocker::Directives::Partial.new(name, @context, opts)
end
|
#set_arg(key, value) ⇒ Object
15
16
17
|
# File 'lib/indocker/image/image_dsl.rb', line 15
def set_arg(key, value)
@context.set_value(key, value)
end
|