Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (37 sloc) 1.69 KB


What files changed since last time?

With dependency management and super fast hashing (Murmur3).

Build Status


gem install change


@change ="/absolute/path")
@change.d        # { :add => [], :mod => [], :rem => [] }
@change.d(true)  # reload

Change uses a YAML file stored in the root directory called .change.yml to maintain state.

Calling @change.d? does the following:

  • Check if there is an entry for path in .change.yml
    • If yes, read file size and compare with entry
      • If file size matches, compare Murmur hash
    • If no, record file size and Murmur hash
  • Look up path in dependency tree
    • If found, also mark all dependency parent paths as changed


To group dependencies, Change uses the concept of a "session":

@change ="/absolute/path")
@change.s(:some_id)         # start session with id
@change.r("relative/path")  # record dependency
@change.s(nil)              # stop session

If you use @change.d? within a session, it will return true if any dependencies have changed. Change recalls the dependencies from the last session to achieve this.

  # returns true if any dependencies have changed
  # dependencies are recalled from LAST :some_id session

Recall files that were modified during the last execution of this session:

@change.d_  # returns: { :add => [], :mod => [], :rem => [] }
Jump to Line
Something went wrong with that request. Please try again.