Class: Script

Inherits:
Object
  • Object
show all
Defined in:
lib/spinjector/entity/script.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, source_code, shell_path, input_paths, output_paths, input_file_list_paths, output_file_list_paths, dependency_file, execution_position, show_env_vars_in_log, always_out_of_date) ⇒ Script

Returns a new instance of Script.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/spinjector/entity/script.rb', line 6

def initialize(
    name,
    source_code,
    shell_path,
    input_paths,
    output_paths,
    input_file_list_paths,
    output_file_list_paths,
    dependency_file,
    execution_position,
    show_env_vars_in_log,
    always_out_of_date
)
    @name = name
    @source_code = source_code
    @shell_path = shell_path
    @input_paths = input_paths
    @output_paths = output_paths
    @input_file_list_paths = input_file_list_paths
    @output_file_list_paths = output_file_list_paths
    @dependency_file = dependency_file
    @execution_position = execution_position
    @show_env_vars_in_log = show_env_vars_in_log
    @always_out_of_date = always_out_of_date
    verify()
end

Instance Attribute Details

#always_out_of_dateObject (readonly)

Returns the value of attribute always_out_of_date.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def always_out_of_date
  @always_out_of_date
end

#dependency_fileObject (readonly)

Returns the value of attribute dependency_file.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def dependency_file
  @dependency_file
end

#execution_positionObject (readonly)

Returns the value of attribute execution_position.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def execution_position
  @execution_position
end

#input_file_list_pathsObject (readonly)

Returns the value of attribute input_file_list_paths.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def input_file_list_paths
  @input_file_list_paths
end

#input_pathsObject (readonly)

Returns the value of attribute input_paths.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def input_paths
  @input_paths
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def name
  @name
end

#output_file_list_pathsObject (readonly)

Returns the value of attribute output_file_list_paths.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def output_file_list_paths
  @output_file_list_paths
end

#output_pathsObject (readonly)

Returns the value of attribute output_paths.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def output_paths
  @output_paths
end

#shell_pathObject (readonly)

Returns the value of attribute shell_path.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def shell_path
  @shell_path
end

#show_env_vars_in_logObject (readonly)

Returns the value of attribute show_env_vars_in_log.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def show_env_vars_in_log
  @show_env_vars_in_log
end

#source_codeObject (readonly)

Returns the value of attribute source_code.



4
5
6
# File 'lib/spinjector/entity/script.rb', line 4

def source_code
  @source_code
end

Instance Method Details

#verifyObject



33
34
35
# File 'lib/spinjector/entity/script.rb', line 33

def verify
    verify_execution_position()
end

#verify_execution_positionObject



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/spinjector/entity/script.rb', line 37

def verify_execution_position
    case execution_position
    when :before_compile, :before_headers
        true
    when :after_compile, :after_headers
        false
    when :after_all,
        false
    else
        raise ArgumentError, "Unknown execution position `#{execution_position}`"
    end
end