Class: Suspect::FileTree::Git::Snapshot

Inherits:
Object
  • Object
show all
Defined in:
lib/suspect/file_tree/git/snapshot.rb

Instance Method Summary collapse

Constructor Details

#initialize(client = ::Suspect::FileTree::Git::Client.new) ⇒ Snapshot

Returns a new instance of Snapshot.



7
8
9
# File 'lib/suspect/file_tree/git/snapshot.rb', line 7

def initialize(client = ::Suspect::FileTree::Git::Client.new)
  @client = client
end

Instance Method Details

#branchObject



11
12
13
# File 'lib/suspect/file_tree/git/snapshot.rb', line 11

def branch
  without_new_line(client.branch)
end

#commit_hashObject



23
24
25
# File 'lib/suspect/file_tree/git/snapshot.rb', line 23

def commit_hash
  without_new_line(client.commit_hash)
end

#filesObject



15
16
17
# File 'lib/suspect/file_tree/git/snapshot.rb', line 15

def files
  lines_to_files(client.files)
end

#modified_filesObject



19
20
21
# File 'lib/suspect/file_tree/git/snapshot.rb', line 19

def modified_files
  lines_to_files(client.modified_files)
end

#patchObject



27
28
29
# File 'lib/suspect/file_tree/git/snapshot.rb', line 27

def patch
  client.diff
end