Skip to content

Commit cd68bca

Browse files
committed
Dynamic load target plugin gem
1 parent afaba01 commit cd68bca

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/matrixeval/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def all_variant_mounts
9393
end
9494

9595
def target_klass
96-
Matrixeval.targets[target_name] || Target
96+
Matrixeval.targets[target_name&.to_sym] || Target
9797
end
9898

9999
end

lib/matrixeval/runner.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def init
6161
end
6262

6363
def run_all_contexts
64+
load_plugin
65+
6466
DockerCompose::File.create_all
6567
Gitignore.update
6668
ExtraMountFiles.create
@@ -105,6 +107,8 @@ def run_all_contexts_in_parallel
105107
end
106108

107109
def run_a_specific_context
110+
load_plugin
111+
108112
DockerCompose::File.create_all
109113
Gitignore.update
110114
ExtraMountFiles.create
@@ -194,5 +198,10 @@ def turn_on_stty_opost
194198
system("stty opost")
195199
end
196200

201+
def load_plugin
202+
require "matrixeval/#{Config.target_name}"
203+
rescue LoadError
204+
end
205+
197206
end
198207
end

0 commit comments

Comments
 (0)