File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
ruby/ql/lib/codeql/ruby/frameworks Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Provides classes and predicates for Gemfiles, including version constraint logic.
3
+ */
4
+
1
5
private import codeql.ruby.AST
2
6
3
7
/**
@@ -19,6 +23,9 @@ module Gemfile {
19
23
class Gem extends MethodCall {
20
24
Gem ( ) { this .getMethodName ( ) = "gem" and this .getFile ( ) = getGemfile ( ) }
21
25
26
+ /**
27
+ * Gets the name of the gem in this version constraint.
28
+ */
22
29
string getName ( ) { result = this .getArgument ( 0 ) .getConstantValue ( ) .getStringlikeValue ( ) }
23
30
24
31
/**
@@ -86,6 +93,10 @@ module Gemfile {
86
93
)
87
94
}
88
95
96
+ /**
97
+ * A version constraint in a `gem` call. This consists of a version number and an optional comparator, for example
98
+ * `>= 1.2.3`.
99
+ */
89
100
class VersionConstraint extends string {
90
101
Comparator comp ;
91
102
string versionString ;
You can’t perform that action at this time.
0 commit comments