Skip to content

Commit 414fc60

Browse files
committed
Add classes to support Ruby analysis
1 parent c57a06a commit 414fc60

18 files changed

+2846
-4
lines changed

Diff for: LICENSE-ruby.txt

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
RUBYGEMS
2+
========
3+
RubyGems is copyrighted free software by Chad Fowler, Rich Kilmer, Jim Weirich
4+
and others. You can redistribute it and/or modify it under either the terms of
5+
the MIT license (see the file MIT.txt), or the conditions below:
6+
7+
You may make and give away verbatim copies of the source form of the software
8+
without restriction, provided that you duplicate all of the original copyright
9+
notices and associated disclaimers.
10+
11+
You may modify your copy of the software in any way, provided that you do at
12+
least ONE of the following:
13+
14+
place your modifications in the Public Domain or otherwise make them Freely
15+
Available, such as by posting said modifications to Usenet or an equivalent
16+
medium, or by allowing the author to include your modifications in the
17+
software.
18+
19+
use the modified software only within your corporation or organization.
20+
21+
give non-standard executables non-standard names, with instructions on where
22+
to get the original software distribution.
23+
24+
make other distribution arrangements with the author.
25+
26+
You may distribute the software in object code or executable form, provided
27+
that you do at least ONE of the following:
28+
29+
distribute the executables and library files of the software, together with
30+
instructions (in the manual page or equivalent) on where to get the original
31+
distribution.
32+
33+
accompany the distribution with the machine-readable source of the software.
34+
35+
give non-standard executables non-standard names, with instructions on where
36+
to get the original software distribution.
37+
38+
make other distribution arrangements with the author.
39+
40+
You may modify and include the part of the software into any other software
41+
(possibly commercial).
42+
43+
The scripts and library files supplied as input to or produced as output from
44+
the software do not automatically fall under the copyright of the software,
45+
but belong to whomever generated them, and may be sold commercially, and may
46+
be aggregated with this software.
47+
48+
THIS SOFTWARE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED
49+
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
50+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
51+
52+
RUBY
53+
========
54+
Ruby is copyrighted free software by Yukihiro Matsumoto <[email protected]>.
55+
You can redistribute it and/or modify it under either the terms of the
56+
2-clause BSDL (see the file BSDL), or the conditions below:
57+
58+
1. You may make and give away verbatim copies of the source form of the
59+
software without restriction, provided that you duplicate all of the
60+
original copyright notices and associated disclaimers.
61+
62+
2. You may modify your copy of the software in any way, provided that
63+
you do at least ONE of the following:
64+
65+
a) place your modifications in the Public Domain or otherwise
66+
make them Freely Available, such as by posting said
67+
modifications to Usenet or an equivalent medium, or by allowing
68+
the author to include your modifications in the software.
69+
70+
b) use the modified software only within your corporation or
71+
organization.
72+
73+
c) give non-standard binaries non-standard names, with
74+
instructions on where to get the original software distribution.
75+
76+
d) make other distribution arrangements with the author.
77+
78+
3. You may distribute the software in object code or binary form,
79+
provided that you do at least ONE of the following:
80+
81+
a) distribute the binaries and library files of the software,
82+
together with instructions (in the manual page or equivalent)
83+
on where to get the original distribution.
84+
85+
b) accompany the distribution with the machine-readable source of
86+
the software.
87+
88+
c) give non-standard binaries non-standard names, with
89+
instructions on where to get the original software distribution.
90+
91+
d) make other distribution arrangements with the author.
92+
93+
4. You may modify and include the part of the software into any other
94+
software (possibly commercial). But some files in the distribution
95+
are not written by the author, so that they are not under these terms.
96+
97+
For the list of those files and their copying conditions, see the
98+
file LEGAL.
99+
100+
5. The scripts and library files supplied as input to or produced as
101+
output from the software do not automatically fall under the
102+
copyright of the software, but belong to whomever generated them,
103+
and may be sold commercially, and may be aggregated with this
104+
software.
105+
106+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
107+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
108+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
109+
PURPOSE.

Diff for: build.xml

+2
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
285285
<run-jflex dir="${gen.analysis.dir}/perl" name="PerlXref"/>
286286
<run-jflex dir="${gen.analysis.dir}/php" name="PhpSymbolTokenizer"/>
287287
<run-jflex dir="${gen.analysis.dir}/php" name="PhpXref"/>
288+
<run-jflex dir="${gen.analysis.dir}/ruby" name="RubySymbolTokenizer"/>
289+
<run-jflex dir="${gen.analysis.dir}/ruby" name="RubyXref"/>
288290
<run-jflex dir="${gen.analysis.dir}/lisp" name="LispSymbolTokenizer"/>
289291
<run-jflex dir="${gen.analysis.dir}/lisp" name="LispXref"/>
290292
<run-jflex dir="${gen.analysis.dir}/tcl" name="TclSymbolTokenizer"/>

Diff for: opengrok-indexer/pom.xml

+7
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
116116
<exclude>*.java</exclude>
117117
</excludes>
118118
</testResource>
119+
<testResource>
120+
<targetPath>org/opensolaris/opengrok/analysis/ruby/</targetPath>
121+
<directory>../test/org/opensolaris/opengrok/analysis/ruby/</directory>
122+
<excludes>
123+
<exclude>*.java</exclude>
124+
</excludes>
125+
</testResource>
119126
<testResource>
120127
<targetPath>org/opensolaris/opengrok/analysis/haskell/</targetPath>
121128
<directory>../test/org/opensolaris/opengrok/analysis/haskell/</directory>

Diff for: src/org/opensolaris/opengrok/analysis/AnalyzerGuru.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
import org.opensolaris.opengrok.analysis.kotlin.KotlinAnalyzerFactory;
9191
import org.opensolaris.opengrok.analysis.sh.ShAnalyzerFactory;
9292
import org.opensolaris.opengrok.analysis.powershell.PowershellAnalyzerFactory;
93+
import org.opensolaris.opengrok.analysis.ruby.RubyAnalyzerFactory;
9394
import org.opensolaris.opengrok.analysis.sql.PLSQLAnalyzerFactory;
9495
import org.opensolaris.opengrok.analysis.sql.SQLAnalyzerFactory;
9596
import org.opensolaris.opengrok.analysis.swift.SwiftAnalyzerFactory;
@@ -156,7 +157,7 @@ public class AnalyzerGuru {
156157
/**
157158
* Descending string length comparator for magics
158159
*/
159-
private static Comparator<String> descStrlenComparator =
160+
private static final Comparator<String> descStrlenComparator =
160161
new Comparator<String>() {
161162
@Override public int compare(String s1, String s2) {
162163
// DESC: s2 length <=> s1 length
@@ -249,7 +250,8 @@ public class AnalyzerGuru {
249250
new GolangAnalyzerFactory(),
250251
new LuaAnalyzerFactory(),
251252
new PascalAnalyzerFactory(),
252-
new AdaAnalyzerFactory()
253+
new AdaAnalyzerFactory(),
254+
new RubyAnalyzerFactory()
253255
};
254256

255257
for (FileAnalyzerFactory analyzer : analyzers) {

0 commit comments

Comments
 (0)