Sha256: 90554796fb04d278b877f88d18304af52fbad0b4522e106f3e9a78eda88a457f
Contents?: true
Size: 645 Bytes
Versions: 10
Compression:
Stored size: 645 Bytes
Contents
# frozen_string_literal: true module Coverband class RackServerCheck def self.running? new(Kernel.caller_locations).running? end def initialize(stack) @stack = stack end def running? rack_server? || rails_server? end def rack_server? @stack.any? { |line| line.path.include?("lib/rack/") } end def rails_server? @stack.any? do |location| location.path.include?("rails/commands/commands_tasks.rb") && location.label == "server" || location.path.include?("rails/commands/server/server_command.rb") && location.label == "perform" end end end end
Version data entries
10 entries across 10 versions & 1 rubygems