From 7c9a75f1581d23174c5ac8dde5f4bad7cd585e79 Mon Sep 17 00:00:00 2001 From: shigemk2 <i.am.shige@gmail.com> Date: Sun, 21 May 2017 16:21:12 +0900 Subject: [PATCH] Fix typo: registory to registry --- lib/autoload/kuroko2/workflow/node.rb | 12 ++++++------ lib/kuroko2/engine.rb | 2 +- spec/settings_spec.rb | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/autoload/kuroko2/workflow/node.rb b/lib/autoload/kuroko2/workflow/node.rb index 7c5b01f0..5582ea23 100644 --- a/lib/autoload/kuroko2/workflow/node.rb +++ b/lib/autoload/kuroko2/workflow/node.rb @@ -2,7 +2,7 @@ module Kuroko2 module Workflow class Node PATH_REGEXP = %r(\A(?:/|(?:/\d+-[a-z0-9_]+)+)\z) - TASK_REGISTORY = { + TASK_REGISTRY = { root: Task::Sequence, noop: Task::Noop, sequence: Task::Sequence, @@ -28,20 +28,20 @@ class Node def self.register(key: nil, klass:) key ||= klass.to_s.demodulize.underscore.to_sym - unless TASK_REGISTORY.has_key?(key) - TASK_REGISTORY.store(key, klass) + unless TASK_REGISTRY.has_key?(key) + TASK_REGISTRY.store(key, klass) else - Kuroko2.logger.warn("Unable to add '#{klass}' to task registory. '#{TASK_REGISTORY[key]}' is already registered.") + Kuroko2.logger.warn("Unable to add '#{klass}' to task registry. '#{TASK_REGISTRY[key]}' is already registered.") end end def self.deregister(key) - TASK_REGISTORY.delete(key) + TASK_REGISTRY.delete(key) end def initialize(type, option = nil) @type = type.to_sym - @task_klass = TASK_REGISTORY.fetch(@type, nil) + @task_klass = TASK_REGISTRY.fetch(@type, nil) @option = option.try(:strip) @parent = nil @children = [] diff --git a/lib/kuroko2/engine.rb b/lib/kuroko2/engine.rb index 10c1721e..e169497c 100644 --- a/lib/kuroko2/engine.rb +++ b/lib/kuroko2/engine.rb @@ -31,7 +31,7 @@ class Engine < ::Rails::Engine if Kuroko2.config.custom_tasks Kuroko2.config.custom_tasks.each do |key, klass| - unless Workflow::Node::TASK_REGISTORY.has_key?(key) + unless Workflow::Node::TASK_REGISTRY.has_key?(key) Workflow::Node.register( key: key.to_sym, klass: Workflow::Task.const_get(klass, false) diff --git a/spec/settings_spec.rb b/spec/settings_spec.rb index b90e986a..1131d754 100644 --- a/spec/settings_spec.rb +++ b/spec/settings_spec.rb @@ -3,7 +3,7 @@ module Kuroko2 describe 'Check if settings is loaded' do it 'loads custom tasks' do - expect(Workflow::Node::TASK_REGISTORY).to have_key(:custom_task1) + expect(Workflow::Node::TASK_REGISTRY).to have_key(:custom_task1) expect(Workflow::ScriptParser.new('custom_task1:').parse).to be_a(Workflow::Node) end end