Module: Juicer::CacheBuster::Revision

Defined in:
lib/juicer/cache_buster.rb

Class Method Summary collapse

Class Method Details

.git(filename) ⇒ Object



159
160
161
162
163
164
# File 'lib/juicer/cache_buster.rb', line 159

def self.git(filename)
  version = %x{git log --pretty=format:%H -1 -- #{filename} 2> /dev/null}
  version = %x{git log --pretty=format:%H -1 2> /dev/null} if version == '' || version == nil
  version = 'unknown' if version == '' || version == nil
  return version
end

.mtime(filename) ⇒ Object



166
167
168
# File 'lib/juicer/cache_buster.rb', line 166

def self.mtime(filename)
  File.mtime(filename).to_i
end