Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
What files changed since last time?
Ruby
tree: 3e57a782ca

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
ext/change
lib
spec
.gitignore
Gemfile
LICENSE
README.md
Rakefile
change.gemspec

README.md

Change

What files changed since last time?

With dependency management and super fast hashing (Murmur3).

Requirements

gem install change

Changed?

@change = Change.new("/absolute/path")
@change.d?("relative/path")

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

Dependencies

Sometimes you want to say "if this file changes, then these other files should change as well".

@change = Change.new("/absolute/path")
@change.d(:some_id)         # set id (must be symbol)
@change.d("relative/path")  # add dependency
@change.d(null)             # unset id (must run this when finished)

If you use @change.d? after an id is set, it will return true if any dependencies from the last execution changed.

Tell Change to record which files were modified while an id was set during last execution:

@change = Change.new("/absolute/path", :record => true)
@change.d(:some_id)  # set id (must be symbol)
@change.d            # modified files from last session (hash)
@change.d(null)      # unset id (must run this when finished)
Something went wrong with that request. Please try again.