Skip to content

Commit

Permalink
Merge pull request #1082 from xaviershay/issue-863
Browse files Browse the repository at this point in the history
Recommended approach for finding and verifying code that invalidates the message cache.
  • Loading branch information
myronmarston committed Sep 23, 2013
2 parents 9362e65 + 5952538 commit b5fe6e5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ignores
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib/rspec/core/example_group.rb: subclass = Class.new(parent) ### This only occurs when an example group is subclasses, at spec define time.
lib/rspec/core/example_group.rb: # TODO 2010-05-05: Because we don't know if const_set is thread-safe ### It's a comment
21 changes: 21 additions & 0 deletions method_cache_busters.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# set -x

# This list is from https://charlie.bz/blog/things-that-clear-rubys-method-cache

IGNORE_FILE=/tmp/cache_busters_ignore
cat ignores | ruby -ne 'puts $_.split(/\s+###/)[0]' > $IGNORE_FILE

egrep 'def [a-z]*\..*' -R lib | grep -v "def self" | grep -v -f $IGNORE_FILE
grep undef -R lib | grep -v -f $IGNORE_FILE
grep alias_method -R lib
grep remove_method -R lib | grep -v -f $IGNORE_FILE
grep const_set -R lib | grep -v -f $IGNORE_FILE
grep remove_const -R lib | grep -v -f $IGNORE_FILE
egrep '\bextend\b' -R lib | grep -v -f $IGNORE_FILE
grep 'Class.new' -R lib | grep -v -f $IGNORE_FILE
grep private_constant -R lib | grep -v -f $IGNORE_FILE
grep public_constant -R lib | grep -v -f $IGNORE_FILE
grep "Marshal.load" -R lib | grep -v -f $IGNORE_FILE
grep "OpenStruct.new" -R lib | grep -v -f $IGNORE_FILE

0 comments on commit b5fe6e5

Please sign in to comment.