Changeset 338ef7cbc6c092d5abce7091de645f7eb53e42b6

Show
Ignore:
Timestamp:
02/04/2008 01:01:53 PM (1 year ago)
Author:
Robin Luckey <robin@Tangier.local>
git-committer:
Robin Luckey <robin@Tangier.local> 1202158913 -0800
git-parent:

[0a6219f5af01f5b222bd50cf1962c149ae0bed84]

git-author:
Robin Luckey <robin@Tangier.local> 1202158913 -0800
Message:

[FIX] Haskell was missing a declaration for its nice_name.

There should probably be a test for this, but I can't figure out
how to get a list of all Monoglots at test time.
Language nice_names and categories should probably be declared
somewhere more obvious anyway.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • README

    r596bf87 r338ef7c  
    120120* In Ohcount::Generator, instantiate a new Ohcount::Monoglot or 
    121121  Ohcount::Polyglot to parse the language. 
     122* In Ohcount::SlocInfo, provide a "nice name" and category (procedural 
     123  code vs. markup) for the new language. 
    122124* Create a new Ohcount::Test to verify the parser. 
    123125 
  • lib/ohcount/sloc_info.rb

    rc094fe9 r338ef7c  
    1 # a DTO class to hold the sloc information 
     1# A generic data object for returning parsing results from Ohcount to Ohloh. 
     2
     3# This class has the additional job of declaring a "nice" (human readable) name 
     4# for each language, as well as the category (procedural code vs. markup) for each 
     5# language. These features should probably live elsewhere, and are currently 
     6# not covered by unit tests. 
    27class Ohcount::SlocInfo 
    38  attr_reader :language 
     
    7176      'xslt'          => {:nice_name => 'XSL Transformation',:category => 0}, 
    7277      'dmd'           => {:nice_name => 'D'                , :category => 0}, 
    73       'tex'           => {:nice_name => 'TeX/LaTeX'        , :category => 1} 
     78      'tex'           => {:nice_name => 'TeX/LaTeX'        , :category => 1}, 
     79      'haskell'       => {:nice_name => 'Haskell'          , :category => 0} 
    7480  } 
    7581 
     82  # Returns the human readable name for a language. 
    7683  def language_nice_name 
    7784    @@lang_map[self.language][:nice_name] 
    7885  end 
    7986 
     87  # Returns the category (procedural code vs. markup) for a language. 
     88  # 
     89  # Category 0 indicates procedural code (most languages). 
     90  # Category 1 indicates a markup file, such as XML. 
    8091  def language_category 
    8192    @@lang_map[self.language][:category]