Sha256: 17a13cfb13e8e8cdf1009df69488ae544cb45702622be115f8f7d0c000c1ad3b

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

# frozen_string_literal: true

module Capybara
  module Thruster
    class DependencyChecker
      def self.call
        new.call
      end

      def call
        unless thruster_installed?
          warn "*********************************************************"
          warn "Warning: capybara-thruster requires either 'thruster' or 'anycable-thruster' gem."
          warn "Please install one of them to ensure proper functionality."
          warn "*********************************************************"
        end
      end

      private

      def thruster_installed?
        gem_installed?("thruster") || gem_installed?("anycable-thruster")
      end

      def gem_installed?(name)
        Gem::Specification.find_all_by_name(name).any?
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capybara-thruster-0.1.1 lib/capybara/dependency_checker.rb