Sha256: 5aaaf5406408fddb2de2aea9d95e0ca221716f73007ce538931087fdbcbbab49

Contents?: true

Size: 799 Bytes

Versions: 52

Compression:

Stored size: 799 Bytes

Contents

class Rack::App::CLI::Fetcher::Server < Rack::Server

  def get_rack_app
    app_class = self.app
    last_app = nil
    until app_class.is_a?(Class) && app_class <= Rack::App
      raise if app_class.__id__ == last_app.__id__

      app_class.instance_variables.each do |ivar|
        value = app_class.instance_variable_get(ivar)
        if value.respond_to?(:call) and not [Method, Proc, UnboundMethod].include?(value.class)
          app_class = value
        end
      end

      last_app = app_class
    end
    app_class
  rescue
  end

  Abort = Class.new(StandardError)

  def app
    super
  rescue Abort
    Class.new(Rack::App)
  end

  def abort(*messages)
    raise(Abort)
  end

  class Options
    def parse!(argv)
      {}
    end
  end

  def opt_parser
    Options.new
  end

end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-app-7.7.0/lib/rack/app/cli/fetcher/server.rb
rack-app-7.7.0 lib/rack/app/cli/fetcher/server.rb
rack-app-7.6.5 lib/rack/app/cli/fetcher/server.rb
rack-app-7.6.4 lib/rack/app/cli/fetcher/server.rb
rack-app-7.6.3 lib/rack/app/cli/fetcher/server.rb
rack-app-7.6.2 lib/rack/app/cli/fetcher/server.rb
rack-app-7.6.1 lib/rack/app/cli/fetcher/server.rb
rack-app-7.6.0 lib/rack/app/cli/fetcher/server.rb
rack-app-7.5.2 lib/rack/app/cli/fetcher/server.rb
rack-app-7.5.1 lib/rack/app/cli/fetcher/server.rb
rack-app-7.5.0 lib/rack/app/cli/fetcher/server.rb
rack-app-7.4.0 lib/rack/app/cli/fetcher/server.rb
rack-app-7.3.2 lib/rack/app/cli/fetcher/server.rb
rack-app-7.3.1 lib/rack/app/cli/fetcher/server.rb
rack-app-7.3.0 lib/rack/app/cli/fetcher/server.rb
rack-app-7.2.2 lib/rack/app/cli/fetcher/server.rb
rack-app-7.2.1 lib/rack/app/cli/fetcher/server.rb
rack-app-7.2.0 lib/rack/app/cli/fetcher/server.rb
rack-app-7.1.0 lib/rack/app/cli/fetcher/server.rb
rack-app-7.0.0 lib/rack/app/cli/fetcher/server.rb