Class: RubyYacht::Hook

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_yacht/dsl/hook.rb

Overview

This class provides a hook that a user or plugin can provide to customize the app images.

You can configure this with RubyYacht::Hook::DSL

Defined Under Namespace

Classes: DSL

Constant Summary collapse

EVENT_TIMES =

The permitted values for the event_time attribute.

[:before, :after, :during]
EVENT_TYPES =

The permitted values for the event_type attribute.

[:startup, :build_checkout, :install_libraries]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandObject

The command that we should run for this hook.


26
27
28
# File 'lib/ruby_yacht/dsl/hook.rb', line 26

def command
  @command
end

#copied_file_pathObject

The path to the file that we should copy into the image for this hook.


23
24
25
# File 'lib/ruby_yacht/dsl/hook.rb', line 23

def copied_file_path
  @copied_file_path
end

#event_timeObject

When this hook should take effect, relative to the event.


14
15
16
# File 'lib/ruby_yacht/dsl/hook.rb', line 14

def event_time
  @event_time
end

#event_typeObject

The type of event that this hook is attached to.


17
18
19
# File 'lib/ruby_yacht/dsl/hook.rb', line 17

def event_type
  @event_type
end

#server_typeObject

The type of server that this hook applies to.


20
21
22
# File 'lib/ruby_yacht/dsl/hook.rb', line 20

def server_type
  @server_type
end

Instance Method Details

#copied_file_nameObject

The name of the file containing the code for this hook.


29
30
31
32
# File 'lib/ruby_yacht/dsl/hook.rb', line 29

def copied_file_name
  return '' unless copied_file_path
  File.basename(copied_file_path)
end