mirror of https://github.com/tomgi/git_stats.git
to_s methods for debugging
This commit is contained in:
parent
e48fab4fed
commit
f727869402
|
@ -15,6 +15,10 @@ module GitStats
|
|||
@activity ||= Activity.new(commits)
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{self.class} #@name <#@email>"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
|
@ -13,6 +13,10 @@ module GitStats
|
|||
def in_repo
|
||||
Dir.chdir(@repo.path) { yield }
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{self.class} #@command"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -14,6 +14,10 @@ module GitStats
|
|||
def short_stat
|
||||
@short_stat ||= ShortStat.new(self)
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{self.class} #@hash"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -38,6 +38,10 @@ module GitStats
|
|||
@project_name ||= Pathname(path).basename.to_s
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{self.class} #@path"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
|
@ -18,6 +18,10 @@ module GitStats
|
|||
@deletions = stat_line[/(\d+) deletions?/, 1].to_i
|
||||
end
|
||||
end
|
||||
|
||||
def to_s
|
||||
"#{self.class} #@commit"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
module HashInitializable
|
||||
def initialize(params)
|
||||
def initialize(params = {})
|
||||
params.each { |k, v| instance_variable_set("@#{k}", v) }
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue