4 Ohloh's source code line counter.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License Version 2 as
8 published by the Free Software Foundation.
13 Ohcount is specifically licensed under GPL v2.0, and no later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 Ohcount is a library for counting lines of source code.
27 It was originally developed at Ohloh, and is used to generate
28 the reports at www.ohloh.net.
30 Ohcount supports multiple languages within a single file: for example,
31 a complex HTML document might include regions of both CSS and JavaScript.
33 Ohcount has two main components: a detector which determines the primary
34 language family used by a particular source file, and a parser which
35 provides a line-by-line breakdown of the contents of a source file.
37 Ohcount includes a command line tool that allows you to count individual
38 files or whole directory trees. It also allows you to find source code
39 files by language family, or to create a detailed annotation of an
40 individual source file.
42 Ohcount includes a Ruby binding which allows you to directly access its
43 language detection features from a Ruby application.
48 Ohcount is supported on Mac OS X 10.4 and 10.5 and Ubuntu 10.04 LTS. Other Linux
49 environments should also work, but your mileage may vary.
51 Ohcount does not support Windows.
53 Ohcount targets Ruby 1.8.7. The build script requires a bash shell. You
54 also need a C compiler to build the native extensions.
59 Ohcount source code is available as a Git repository:
61 git clone git://github.com/blackducksw/ohcount.git
66 You will need ragel 6.3 or higher, bash, pcre, magic, gcc (version 4.1.2 or greater)
67 and SWIG. Once you have them, go to the top directory of ohcount and run
76 Once you've built ohcount, the executable program will be at bin/ohcount. The most basic use is to count lines of code in a directory tree. run:
82 Ohcount support several options. Run `ohcount --help` for more information.
84 Building Ruby and Python Libraries
85 ----------------------------------
87 To build the ruby wrapper:
93 To build the python wrapper, run
96 python python/setup.py build
97 python python/setup.py install
100 The python wrapper is currently unsupported.