@@ -42,32 +42,35 @@ def initialize(context)
4242 @droplet = context [ :droplet ]
4343 end
4444
45- # If the component should be used when staging an application
45+ # @!macro [new] base_component_detect
46+ # If the component should be used when staging an application
4647 #
47- # @return [Array<String>, String, nil] If the component should be used when staging the application, a +String+ or
48- # an +Array<String>+ that uniquely identifies the component (e.g.
49- # +open_jdk=1.7.0_40+). Otherwise, +nil+.
48+ # @return [Array<String>, String, nil] If the component should be used when staging the application, a +String+ or
49+ # an +Array<String>+ that uniquely identifies the component (e.g.
50+ # +open_jdk=1.7.0_40+). Otherwise, +nil+.
5051 def detect
5152 fail "Method 'detect' must be defined"
5253 end
5354
54- # Modifies the application's file system. The component is expected to transform the application's file system in
55- # whatever way is necessary (e.g. downloading files or creating symbolic links) to support the function of the
56- # component. Status output written to +STDOUT+ is expected as part of this invocation.
55+ # @!macro [new] base_component_compile
56+ # Modifies the application's file system. The component is expected to transform the application's file system in
57+ # whatever way is necessary (e.g. downloading files or creating symbolic links) to support the function of the
58+ # component. Status output written to +STDOUT+ is expected as part of this invocation.
5759 #
58- # @return [void]
60+ # @return [void]
5961 def compile
6062 fail "Method 'compile' must be defined"
6163 end
6264
63- # Modifies the application's runtime configuration. The component is expected to transform members of the +context+
64- # (e.g. +@java_home+, +@java_opts+, etc.) in whatever way is necessary to support the function of the component.
65+ # @!macro [new] base_component_release
66+ # Modifies the application's runtime configuration. The component is expected to transform members of the +context+
67+ # (e.g. +@java_home+, +@java_opts+, etc.) in whatever way is necessary to support the function of the component.
6568 #
66- # Container components are also expected to create the command required to run the application. These components
67- # are expected to read the +context+ values and take them into account when creating the command.
69+ # Container components are also expected to create the command required to run the application. These components
70+ # are expected to read the +context+ values and take them into account when creating the command.
6871 #
69- # @return [void, String] components other than containers are not expected to return any value. Container
70- # components are expected to return the command required to run the application.
72+ # @return [void, String] components other than containers are not expected to return any value. Container
73+ # components are expected to return the command required to run the application.
7174 def release
7275 fail "Method 'release' must be defined"
7376 end
@@ -98,6 +101,7 @@ def download(version, uri, name = @component_name, &block)
98101 # @param [String] jar_name the name to save the jar as
99102 # @param [Pathname] target_directory the directory to store the JAR file in. Defaults to the component's sandbox.
100103 # @param [String] name an optional name for the download. Defaults to +@component_name+.
104+ # @return [void]
101105 def download_jar ( version , uri , jar_name , target_directory = @droplet . sandbox , name = @component_name )
102106 download ( version , uri , name ) do |file |
103107 FileUtils . mkdir_p target_directory
@@ -111,6 +115,7 @@ def download_jar(version, uri, jar_name, target_directory = @droplet.sandbox, na
111115 # @param [String] uri the uri of the download
112116 # @param [Pathname] target_directory the directory to expand the TAR file to. Defaults to the component's sandbox.
113117 # @param [String] name an optional name for the download and expansion. Defaults to +@component_name+.
118+ # @return [void]
114119 def download_tar ( version , uri , target_directory = @droplet . sandbox , name = @component_name )
115120 download ( version , uri , name ) do |file |
116121 with_timing "Expanding #{ name } to #{ target_directory . relative_path_from ( @droplet . root ) } " do
@@ -125,6 +130,7 @@ def download_tar(version, uri, target_directory = @droplet.sandbox, name = @comp
125130 # @param [Boolean] strip_top_level whether to strip the top-level directory when expanding. Defaults to +true+.
126131 # @param [Pathname] target_directory the directory to expand the ZIP file to. Defaults to the component's sandbox.
127132 # @param [String] name an optional name for the download. Defaults to +@component_name+.
133+ # @return [void]
128134 def download_zip ( version , uri , strip_top_level = true , target_directory = @droplet . sandbox , name = @component_name )
129135 download ( version , uri , name ) do |file |
130136 with_timing "Expanding #{ name } to #{ target_directory . relative_path_from ( @droplet . root ) } " do
@@ -146,6 +152,7 @@ def download_zip(version, uri, strip_top_level = true, target_directory = @dropl
146152 # Wrap the execution of a block with timing information
147153 #
148154 # @param [String] caption the caption to print when timing starts
155+ # @return [void]
149156 def with_timing ( caption )
150157 start_time = Time . now
151158 print " #{ caption } "
0 commit comments