????JFIF??x?x????'403WebShell
403Webshell
Server IP : 104.21.96.1  /  Your IP : 216.73.216.145
Web Server : LiteSpeed
System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : tempvsty ( 647)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/ruby33/share/gems/gems/bundler-2.5.22/lib/bundler/vendor/pub_grub/lib/pub_grub/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/ruby33/share/gems/gems/bundler-2.5.22/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb
module Bundler::PubGrub
  class Term
    attr_reader :package, :constraint, :positive

    def initialize(constraint, positive)
      @constraint = constraint
      @package = @constraint.package
      @positive = positive
    end

    def to_s(allow_every: false)
      if positive
        @constraint.to_s(allow_every: allow_every)
      else
        "not #{@constraint}"
      end
    end

    def hash
      constraint.hash ^ positive.hash
    end

    def eql?(other)
      positive == other.positive &&
        constraint.eql?(other.constraint)
    end

    def invert
      self.class.new(@constraint, !@positive)
    end
    alias_method :inverse, :invert

    def intersect(other)
      raise ArgumentError, "packages must match" if package != other.package

      if positive? && other.positive?
        self.class.new(constraint.intersect(other.constraint), true)
      elsif negative? && other.negative?
        self.class.new(constraint.union(other.constraint), false)
      else
        positive = positive? ? self : other
        negative = negative? ? self : other
        self.class.new(positive.constraint.intersect(negative.constraint.invert), true)
      end
    end

    def difference(other)
      intersect(other.invert)
    end

    def relation(other)
      if positive? && other.positive?
        constraint.relation(other.constraint)
      elsif negative? && other.positive?
        if constraint.allows_all?(other.constraint)
          :disjoint
        else
          :overlap
        end
      elsif positive? && other.negative?
        if !other.constraint.allows_any?(constraint)
          :subset
        elsif other.constraint.allows_all?(constraint)
          :disjoint
        else
          :overlap
        end
      elsif negative? && other.negative?
        if constraint.allows_all?(other.constraint)
          :subset
        else
          :overlap
        end
      else
        raise
      end
    end

    def normalized_constraint
      @normalized_constraint ||= positive ? constraint : constraint.invert
    end

    def satisfies?(other)
      raise ArgumentError, "packages must match" unless package == other.package

      relation(other) == :subset
    end

    def positive?
      @positive
    end

    def negative?
      !positive?
    end

    def empty?
      @empty ||= normalized_constraint.empty?
    end

    def inspect
      "#<#{self.class} #{self}>"
    end
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit