Skip to content

Commit

Permalink
Merge pull request #73 from yhirano55/cache_clearable
Browse files Browse the repository at this point in the history
Add MethodSource.clear_cache
  • Loading branch information
banister authored Nov 17, 2021
2 parents e7ec137 + 2d7ea44 commit 81d039c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/method_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ def self.lines_for(file_name, name=nil)
raise SourceNotFoundError, "Could not load source for #{name}: #{e.message}"
end

# Clear cache.
def self.clear_cache
@lines_for_file = {}
end

# @deprecated — use MethodSource::CodeHelpers#complete_expression?
def self.valid_expression?(str)
complete_expression?(str)
Expand Down

0 comments on commit 81d039c

Please sign in to comment.