Sha256: b2fa8abf5ea0b5d6d8905c283da23ab16988dd8c6d0b2facd14144c6b3701a00

Contents?: true

Size: 566 Bytes

Versions: 60

Compression:

Stored size: 566 Bytes

Contents

module Rack::App::CLI::Fetcher

  require 'rack/app/cli/fetcher/server'

  extend self

  module ExitPrevent

    def abort(*args)
    end

  end

  def rack_app
    @rack_app ||= (server_based_lookup || rack_app_with_most_endpoints)
  end

  protected

  def server_based_lookup
     Rack::App::CLI::Fetcher::Server.new(:config => 'config.ru').get_rack_app
  end

  def rack_app_with_most_endpoints
    ObjectSpace.each_object(Class).select{|klass|
      klass < Rack::App
    }.uniq.sort_by{ |rack_app|
      rack_app.router.endpoints.length
    }.last
  end

end

Version data entries

60 entries across 60 versions & 2 rubygems

Version Path
rack-app-11.0.2 lib/rack/app/cli/fetcher.rb
rack-app-11.0.1 lib/rack/app/cli/fetcher.rb
rack-app-11.0.0 lib/rack/app/cli/fetcher.rb
rack-app-10.0.0 lib/rack/app/cli/fetcher.rb
rack-app-9.0.0 lib/rack/app/cli/fetcher.rb
rack-app-8.1.0 lib/rack/app/cli/fetcher.rb
rack-app-8.0.1 lib/rack/app/cli/fetcher.rb
rack-app-8.0.0 lib/rack/app/cli/fetcher.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-app-7.7.0/lib/rack/app/cli/fetcher.rb
rack-app-7.7.0 lib/rack/app/cli/fetcher.rb
rack-app-7.6.5 lib/rack/app/cli/fetcher.rb
rack-app-7.6.4 lib/rack/app/cli/fetcher.rb
rack-app-7.6.3 lib/rack/app/cli/fetcher.rb
rack-app-7.6.2 lib/rack/app/cli/fetcher.rb
rack-app-7.6.1 lib/rack/app/cli/fetcher.rb
rack-app-7.6.0 lib/rack/app/cli/fetcher.rb
rack-app-7.5.2 lib/rack/app/cli/fetcher.rb
rack-app-7.5.1 lib/rack/app/cli/fetcher.rb
rack-app-7.5.0 lib/rack/app/cli/fetcher.rb
rack-app-7.4.0 lib/rack/app/cli/fetcher.rb