Module: Babar

Defined in:
lib/babar.rb,
lib/babar/action.rb,
lib/babar/manifest.rb

Defined Under Namespace

Classes: Action, Manifest

Class Method Summary collapse

Class Method Details

.changed(offset = 0) ⇒ Object



11
12
13
14
# File 'lib/babar.rb', line 11

def self.changed offset=0
  commits = `git reflog -n #{offset + 2}`.lines.map { |l| l.split.first }
  changed = `git diff --name-only #{commits.first} #{commits.last}`.lines.map &:strip
end

.hookfileObject



16
17
18
19
20
# File 'lib/babar.rb', line 16

def self.hookfile
  ['Hookfile', File.expand_path('../../Hookfile', __FILE__)].find do |path|
    File.exists? path
  end
end

.runObject



5
6
7
8
9
# File 'lib/babar.rb', line 5

def self.run
  manifest = Manifest.new changed
  manifest.perform
  manifest.notify
end