forked from andyverprauskus/ohcount
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
executable file
·90 lines (59 loc) · 3.25 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
== Ohcount
NOTE: THE PRIMARY DOCUMENTATION FOR OHCOUNT IS EXTRACTED FROM SOURCE CODE
BY DOXYGEN. FOR THE MOST UP-TO-DATE DOCS, PLEASE SEE BELOW FOR INFO
ON BUILDING AND REFERING TO THE DOXYGEN DOCS.
Ohloh/SourceForge's source code line counter.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 2 as
published by the Free Software Foundation.
Ohcount is specifically licensed under GPL v2.0, and no later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
== Overview
Ohcount is a library for counting lines of source code.
It was originally developed at Ohloh, and is used to generate
the reports at www.ohloh.net.
Ohcount supports multiple languages within a single file: for example,
a complex HTML document might include regions of both CSS and JavaScript.
Ohcount has two main components: a detector which determines the primary
language family used by a particular source file, and a parser which
provides a line-by-line breakdown of the contents of a source file.
Ohcount includes a command line tool that allows you to count individual
files or whole directory trees. It also allows you to find source code
files by language family, or to create a detailed annotation of an
individual source file.
Ohcount includes a Ruby binding which allows you to directly access its
language detection features from a Ruby application.
== System Requirements
Ohcount is supported on Mac OS X 10.4 and 10.5 and Ubuntu 8.04 LTS. Other Linux
environments should also work, but your mileage may vary.
Ohcount does not support Windows.
Ohcount targets Ruby 1.8.6. The build script requires a bash shell. You
also need a C compiler to build the native extensions.
== Source Code ==
Ohcount source code is available as a Git repository:
git clone git://github.com/andyverprauskus/ohcount.git
== Doc files ==
To build the more extensive Doxygen docs, do
> cd doc
> Doxygen Doxyfile
After building the docs, view them with a browser by opening doc/html/index.html.
On a mac, you can install Doxygen with "sudo port install Doxygen".
On Debian/Ubuntu, install with "sudo apt-get instal doxygen".
== Building Ohcount ==
You will need ragel 6.3 or higher, bash, pcre, gcc and SWIG to build ohcount. Once you have them, go to the top directory of ohcount and type:
> bash build
or > ./build
== Using Ohcount ==
Once you've building ohcount, the executable program will be at bin/ohcount. The most basic use is to count lines of code in a directory tree, run:
"ohcount" to count the current directory and source code in any child directories
== For additional docs, including how to add a new language, see the Doxygen docs ==
Particularly, for instructions on adding a new language, follow the instructions at doc/html/detector_doc.html
Read http://labs.ohloh.net/ohcount/wiki/HowToSubmitPatches for information about having your patch accepted.
DEPENDENCIES
============
SWIG, pcre, ragel, bash