Class: Ftpeter::Backend::Git
- Inherits:
-
Object
- Object
- Ftpeter::Backend::Git
- Defined in:
- lib/ftpeter/backend/git.rb
Instance Attribute Summary collapse
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
Instance Method Summary collapse
-
#initialize(last) ⇒ Git
constructor
A new instance of Git.
Constructor Details
#initialize(last) ⇒ Git
Returns a new instance of Git.
7 8 9 10 11 12 13 14 15 |
# File 'lib/ftpeter/backend/git.rb', line 7 def initialize(last) # build up diff since last version files = `git log #{last}... --name-status --oneline`.split("\n") deleted = files.grep(/^[RD]/).map { |l| l.gsub(/^[RD]\s+/, '') }.uniq changed = files.grep(/^[ACMR]/).map { |l| l.gsub(/^[ACMR]\s+/, '') }.uniq added = files.grep(/^[A]/).map { |l| l.gsub(/^[A]\s+/, '') }.uniq @changes = Ftpeter::Changes.new(deleted, changed, added) end |
Instance Attribute Details
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
5 6 7 |
# File 'lib/ftpeter/backend/git.rb', line 5 def changes @changes end |