Project

change

0.0
No commit activity in last 3 years
No release in over 3 years
What files changed since last time? With dependency management.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 1.0
 Project Readme

Change

What files changed since last time?

Build Status

Requirements

gem install change

Changed?

@change = Change.new("/absolute/path")
@change.d?("relative/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 hash
    • If no, record file size and hash
  • Look up path in dependency tree
    • If found, also mark all dependency parent paths as changed

Dependencies

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

@change = Change.new("/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.

@change.s(:some_id)
@change.d?('relative/path')
  # 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.s(:some_id)
@change.d_  # returns: { :add => [], :mod => [], :rem => [] }