Fixes recursion bug in disambiguate_in().
[ohcount] / README.md
1 Ohcount
2 =======
3
4 Ohloh's source code line counter.
5
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.
9
10 License
11 -------
12
13 Ohcount is specifically licensed under GPL v2.0, and no later version.
14
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.
19
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/>.
22
23 Overview
24 --------
25
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.
29
30 Ohcount supports multiple languages within a single file: for example,
31 a complex HTML document might include regions of both CSS and JavaScript.
32
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.
36
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.
41
42 Ohcount includes a Ruby binding which allows you to directly access its
43 language detection features from a Ruby application.
44
45 System Requirements
46 -------------------
47
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.
50
51 Ohcount does not support Windows.
52
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.
55
56 Source Code
57 -----------
58
59 Ohcount source code is available as a Git repository:
60
61   git clone git://github.com/blackducksw/ohcount.git
62
63 Building Ohcount
64 ----------------
65
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
68
69 ```
70 ./build
71 ```
72
73 Using Ohcount
74 -------------
75
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:
77
78 ```
79 bin/ohcount
80 ```
81
82 Ohcount support several options. Run `ohcount --help` for more information.
83
84 Building Ruby and Python Libraries
85 ----------------------------------
86
87 To build the ruby wrapper:
88
89 ```
90 ./build ruby
91 ```
92
93 To build the python wrapper, run
94
95 ```
96 python python/setup.py build
97 python python/setup.py install
98 ```
99
100 The python wrapper is currently unsupported.