rubygem/lib/zeus/load_tracking.rb
def track_features_loaded_by
        old_features = $LOADED_FEATURES.dup

        # Catch exceptions so we can determine the features
        # that were being loaded at the time of the exception.
        err_features = []
        begin
          yield
        rescue SyntaxError => err
          # SyntaxErrors are a bit weird in that the file containing
          # the error is not in the backtrace, only the error message.
          match = /\A([^:]+):\d+: syntax error/.match(err.message)
          err_features << match[1] if match
          raise
        rescue ScriptError => err
          raise
        rescue => err
          raise
        ensure
          if err && err.backtrace
            err_features += err.backtrace.map { |b| b.split(':').first }
                           .select { |f| f.start_with?('/') }
                           .take_while { |f| f != __FILE__ }
          end

          notify_features(Set.new($LOADED_FEATURES) + err_features - old_features)
        end
      end
# Internal: This should only be called by Zeus code
This should only be called by Zeus code
This should only be called by Zeus code
def track_features_loaded_by
        old_features = $LOADED_FEATURES.dup
        err_features = []
        begin
          yield
        rescue SyntaxError => err
          match = /\A([^:]+):\d+: syntax error/.match(err.message)
          err_features << match[1] if match
          raise
        rescue ScriptError => err
          raise
        rescue => err
          raise
        ensure
          if err && err.backtrace
            err_features += err.backtrace.map { |b| b.split(':').first }
                           .select { |f| f.start_with?('/') }
                           .take_while { |f| f != __FILE__ }
          end
          notify_features(Set.new($LOADED_FEATURES) + err_features - old_features)
        end
      end
def track_features_loaded_by old_features = $LOADED_FEATURES . dup err_features = [ ] begin yield rescue SyntaxError => err match = / \A ([^:]+): \d +: syntax error / . match ( err . message ) err_features << match [ 1 ] if match raise rescue ScriptError => err raise rescue => err raise ensure if err && err . backtrace err_features += err . backtrace . map { | b | b . split ( ':' ) . first } . select { | f | f . start_with? ( '/' ) } . take_while { | f | f != __FILE__ } end notify_features ( Set . new ( $LOADED_FEATURES ) + err_features - old_features ) end end
Internal: This should only be called by Zeus code
Internal : This should only be called by Zeus code
# Catch exceptions so we can determine the features # that were being loaded at the time of the exception. # SyntaxErrors are a bit weird in that the file containing # the error is not in the backtrace, only the error message.