Busted

Requires MRI Ruby 2.1.0dev

Find code that busts the Ruby cache.

  • Report when code invalidates Ruby's internal cache
  • Uses RubyVM.stat

Usage

Any Cache

Busted.cache? do
  class Pizza
  end
end
#=> true

Method Cache

Busted.method_cache? do
  def pizza
  end
end
#=> true

Constant Cache

Busted.constant_cache? do
  PIZZA = "pizza"
end
#=> true

Class Cache

Busted.class_cache? do
  class Beer
  end
end
#=> true

No Cache Busted

Busted.cache? do
  beer = "beer"
end
#=> false

Installation

Requires MRI Ruby 2.1.0dev

Add this line to your application's Gemfile:

gem "busted"

And then execute:

$ bundle

Or install it yourself as:

$ gem install busted

Contributing

Check out this guide if you'd like to contribute.

License

This project is licensed under the MIT License.

Standing On The Shoulders Of Giants

A big thank you to Charlie Somerville and Aman Gupta for helping flesh out RubyVM.stat and committing it to Ruby core!