Sha256: c0ae34d4a42ce1a556f3721e9706f5f5ad6b94ad5985851c5605c18a3700e778
Contents?: true
Size: 667 Bytes
Versions: 39
Compression:
Stored size: 667 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
39 entries across 39 versions & 1 rubygems