Module: SharedHooks

Defined in:
lib/rspec/openapi/shared_hooks.rb

Class Method Summary collapse

Class Method Details

.find_extractorObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/rspec/openapi/shared_hooks.rb', line 4

def self.find_extractor
  if defined?(Rails) && Rails.respond_to?(:application) && Rails.application
    RSpec::OpenAPI::Extractors::Rails
  elsif defined?(Hanami) && Hanami.respond_to?(:app) && Hanami.app?
    RSpec::OpenAPI::Extractors::Hanami
    # elsif defined?(Roda)
    #   some Roda extractor
  else
    RSpec::OpenAPI::Extractors::Rack
  end
end