Skip to content

Commit

Permalink
Make yard clear usage configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineGirard committed Nov 4, 2021
1 parent 2bc70a6 commit 1a080ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.0
2 changes: 1 addition & 1 deletion lib/swagger_yard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def requires_type(tag)
# @return [YARD] objects representing class/methods and tags from the file
#
def yard_objects_from_file(file_path, *types)
::YARD::Registry.clear
::YARD::Registry.clear unless config.use_yard_cache
::YARD.parse(file_path)
::YARD::Registry.all(*types).select {|co| co.file == file_path }
end
Expand Down
2 changes: 2 additions & 0 deletions lib/swagger_yard/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Configuration
attr_accessor :path_discovery_function
attr_accessor :security_definitions
attr_accessor :include_private
attr_accessor :use_yard_cache

# openapi-compatible names
alias openapi_version swagger_version
Expand All @@ -22,6 +23,7 @@ def initialize
@security_definitions = {}
@external_schema = {}
@include_private = true
@use_yard_cache = true
end

def external_schema(mappings = nil)
Expand Down

0 comments on commit 1a080ab

Please sign in to comment.