Skip to content

Commit

Permalink
Hide these under flag
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed Apr 17, 2024
1 parent 0c2575c commit d40c398
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions lib/rspec/openapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,28 @@
require 'rspec/openapi/extractors'
require 'rspec/openapi/extractors/rack'

begin
require 'hanami'
rescue LoadError
warn 'Hanami not detected'
else
require 'rspec/openapi/extractors/hanami'
end
if ENV['OPENAPI']
DEBUG_ENABLED = ["", "1", "true"].include?(ENV["DEBUG"]&.downcase)

Check notice

Code scanning / Rubocop

Checks if uses of quotes match the configured preference. Note

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Check notice

Code scanning / Rubocop

Checks if uses of quotes match the configured preference. Note

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Check notice

Code scanning / Rubocop

Checks if uses of quotes match the configured preference. Note

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Check notice

Code scanning / Rubocop

Checks if uses of quotes match the configured preference. Note

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

begin
require 'rails'
rescue LoadError
warn 'Rails not detected'
else
require 'rspec/openapi/extractors/rails'
end
begin
require 'hanami'
rescue LoadError
warn 'Hanami not detected' if DEBUG_ENABLED
else
require 'rspec/openapi/extractors/hanami'
end

require 'rspec/openapi/minitest_hooks' if Object.const_defined?('Minitest')
require 'rspec/openapi/rspec_hooks' if ENV['OPENAPI'] && Object.const_defined?('RSpec')
begin
require 'rails'
rescue LoadError
warn 'Rails not detected' if DEBUG_ENABLED
else
require 'rspec/openapi/extractors/rails'
end

require 'rspec/openapi/minitest_hooks' if Object.const_defined?('Minitest')
require 'rspec/openapi/rspec_hooks' if Object.const_defined?('RSpec')
end

module RSpec::OpenAPI
@path = 'doc/openapi.yaml'
Expand Down

0 comments on commit d40c398

Please sign in to comment.