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-1.0.3 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-1.0.2 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-1.0.1 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-1.0.0 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.50 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.50 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.49 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.49 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.48 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.48 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.47 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.47 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.46 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.46 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.45 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.45 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.44 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.44 test/test_itamae-mitsurin/test_handler.rb
itamae-mitsurin-0.43 lib/itamae-mitsurin/handler.rb
itamae-mitsurin-0.43 test/test_itamae-mitsurin/test_handler.rb