Initial Revision
[ohcount] / lib / ohcount / language_breakdown.rb
1 class Ohcount::LanguageBreakdown
2
3         def ==(other)
4                 return self.name == other.name && self.code == other.code && self.comment == other.comment && self.blanks == other.blanks
5         end
6
7         def abbr(s, len=80)
8                 s.size > len ? s[0..(len-3)] + "..." : s
9         end
10
11         def inspect
12                 return "<[#{ self.name }]-code(#{ abbr(self.code).gsub("\n", "\\n") })/comment(#{ abbr(self.comment) })/blanks:#{ self.blanks }>"
13         end
14
15 end