lib/grumlin.rb in grumlin-0.15.3 vs lib/grumlin.rb in grumlin-0.15.4

- old
+ new

@@ -1,10 +1,12 @@ # frozen_string_literal: true require "securerandom" require "oj" +require "yaml" +# TODO: use Oj directly Oj.mimic_JSON Oj.add_to_json require "async" require "async/pool" @@ -106,14 +108,10 @@ @client_concurrency = 5 @client_factory = ->(url, parent) { Grumlin::Client.new(url, parent: parent) } end end - def self.supported_steps - @supported_steps ||= (Grumlin::AnonymousStep::SUPPORTED_STEPS + Grumlin::Expressions::U::SUPPORTED_STEPS).sort.uniq - end - @pool_mutex = Mutex.new class << self def configure yield config @@ -142,9 +140,13 @@ pool = Thread.current.thread_variable_get(:grumlin_default_pool) pool.wait while pool.busy? pool.close Thread.current.thread_variable_set(:grumlin_default_pool, nil) end + end + + def definitions + @definitions ||= YAML.safe_load(File.read(File.join(__dir__, "definitions.yml")), symbolize_names: true) end end end loader.setup