Class: GitHealthCheck::Packfile

Inherits:
Object
  • Object
show all
Defined in:
lib/git-health-check/packfile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePackfile

Returns a new instance of Packfile.



12
13
14
# File 'lib/git-health-check/packfile.rb', line 12

def initialize
  @git_lib = GitHealthCheck::GitLib.new
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



4
5
6
# File 'lib/git-health-check/packfile.rb', line 4

def count
  @count
end

#garbageObject (readonly)

Returns the value of attribute garbage.



10
11
12
# File 'lib/git-health-check/packfile.rb', line 10

def garbage
  @garbage
end

#in_packObject (readonly)

Returns the value of attribute in_pack.



6
7
8
# File 'lib/git-health-check/packfile.rb', line 6

def in_pack
  @in_pack
end

#pack_countObject (readonly)

Returns the value of attribute pack_count.



7
8
9
# File 'lib/git-health-check/packfile.rb', line 7

def pack_count
  @pack_count
end

#prune_packableObject (readonly)

Returns the value of attribute prune_packable.



9
10
11
# File 'lib/git-health-check/packfile.rb', line 9

def prune_packable
  @prune_packable
end

#sizeObject (readonly)

Returns the value of attribute size.



5
6
7
# File 'lib/git-health-check/packfile.rb', line 5

def size
  @size
end

#size_of_packObject (readonly)

Returns the value of attribute size_of_pack.



8
9
10
# File 'lib/git-health-check/packfile.rb', line 8

def size_of_pack
  @size_of_pack
end

Instance Method Details

#packfile_statsObject



16
17
18
19
20
21
# File 'lib/git-health-check/packfile.rb', line 16

def packfile_stats
  stats = @git_lib.count_objects
  @count, @size, @in_pack, @pack_count, @size_of_pack, @prune_packable, @garbage = stats.split("\n").map do |stat|
    stat.scan /\d+/
  end
end