Class: BaseChip::Git

Inherits:
Object
  • Object
show all
Defined in:
lib/base_chip/git.rb

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Git

Returns a new instance of Git.



19
20
21
# File 'lib/base_chip/git.rb', line 19

def initialize(root)
  @root = root
end

Instance Method Details

#changedObject



22
23
24
25
26
27
28
29
30
# File 'lib/base_chip/git.rb', line 22

def changed
  files = `cd #{@root} && git status`.split(/\n/)
  files.delete_if do |f|
    f !~ /#\t/
  end
  files.map! do |f|
    f.gsub(/#\s+(modified|new file):\s+/,'')
  end
end