Sha256: f4b0ce12bdb4373bbc0b201f4bdb6facbca8dd67272d0d352494bff8b269dbb7

Contents?: true

Size: 408 Bytes

Versions: 90

Compression:

Stored size: 408 Bytes

Contents

require 'itamae-mitsurin/handler/base'

module ItamaeMitsurin
  module Handler
    def self.from_type(type)
      first_time = true

      class_name = type.split('_').map(&:capitalize).join
      self.const_get(class_name)
    rescue NameError
      require "itamae-mitsurin/handler/#{type}"

      if first_time
        first_time = false
        retry
      else
        raise
      end
    end
  end
end

Version data entries

90 entries across 47 versions & 1 rubygems

Version Path
itamae-mitsurin-0.11 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.11 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.10 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.10 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.9 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.9 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.8 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.8 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.7 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.7 lib/itamae-mitsurin/handler.rb