lib/legion/extensions/builders/runners.rb in legionio-0.2.0 vs lib/legion/extensions/builders/runners.rb in legionio-0.3.0
- old
+ new
@@ -1,26 +1,25 @@
-# frozen_string_literal: true
-
require_relative 'base'
module Legion
module Extensions
module Builder
module Runners
include Legion::Extensions::Builder::Base
attr_reader :runners
+
def build_runners
@runners = {}
lex_class.const_set('Runners', Module.new) unless lex_class.const_defined?('Runners')
require_files(runner_files)
build_runner_list
end
def build_runner_list
runner_files.each do |file|
runner_name = file.split('/').last.sub('.rb', '')
- runner_class = lex_class.to_s + '::Runners::' + runner_name.split('_').collect(&:capitalize).join
+ runner_class = "#{lex_class}::Runners::#{runner_name.split('_').collect(&:capitalize).join}"
loaded_runner = Kernel.const_get(runner_class)
@runners[runner_name.to_sym] = {
extension: lex_class.to_s.downcase,
extension_name: extension_name,
extension_class: lex_class,