Module: DocStat

Defined in:
lib/docstat.rb,
lib/version.rb,
lib/docstat/token.rb,
lib/docstat/container.rb

Defined Under Namespace

Classes: Container, Token

Constant Summary collapse

VERSION =
'1.0.4'

Class Method Summary collapse

Class Method Details

.process(docset_path) ⇒ Object

Parses a docset and returns a representation of the documented tokens within the library. The general structure is as follows:

{

'ratio': decimal
'containers': [
  {
    'name': 'class name',
    'ratio': decimal
    'tokens': [
      {
        'name': 'name of token',
        'type': 'property or message type',
        'abstract': 'description of token',
        'declaration': 'formal declaration',
        'returns': 'description of return value',
        'documented': boolean
      }, ...
    ]
  }, ...
]

}



32
33
34
35
# File 'lib/docstat.rb', line 32

def self.process docset_path
  containers = containers_from_docset(docset_path)
  { "containers" => containers.map(&:to_hash) , "ratio" => overall_ratio(containers) }
end

.test_ratio(docset_path, passing_ratio) ⇒ Object

Returns true if the coverage ratio of a docset at docset_path is greater than or equal to passing_ratio



39
40
41
42
# File 'lib/docstat.rb', line 39

def self.test_ratio docset_path, passing_ratio
  containers = containers_from_docset(docset_path)
  overall_ratio(containers) >= passing_ratio
end