Ruby Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
Gemfile
Gemfile.lock
README.md
build.sh
count-0.0.7.gem
count.gemspec

README.md

A code line counter

Support Language

LANG = {
  :cpp   =>"C++ Source",
  :c     =>"C Source",
  :cs    =>"C# ",
  :h     =>"C/C++ Header",
  :hs    =>"Haskell",
  :java  =>"Java",
  :js    =>"JavaScript",
  :m     =>"Objective C",
  :php   =>"PHP",
  :py    =>"Python",
  :rb    =>"Ruby",
  :scala =>"Scala",
  :sh    =>"Shell",
  :sml   =>"Stand ML",  
  :coffee =>"CoffeeScript",
  :scss  => "Scss",
  :erb   => "Erb Templete",
  :haml  => "Haml Templete",
  :slim  => "Slim Templete",
  :less  => "Less",
  :txt   => "txt",
  :swift => "swift",
  :xml => "xml"
}

To add other language, just add :source file's extend name => Language Name to the hash table

Usage

%gem install count
%count ~/code

==================================================
        Lang       count   count(no comments)
==================================================
        Ruby       6860       6409
        Java      17474      13333
C/C++ Header       3545       1719
 Objective C      20119      16137
    C Source       1207        924
  C++ Source        476        393
       Shell         13         10
  JavaScript        600        516
       Scala         17         17
      Python       4036       3838
==================================================
       Total      54347      43296