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+
15private import codeql.ruby.AST
26
37/**
@@ -19,6 +23,9 @@ module Gemfile {
1923 class Gem extends MethodCall {
2024 Gem ( ) { this .getMethodName ( ) = "gem" and this .getFile ( ) = getGemfile ( ) }
2125
26+ /**
27+ * Gets the name of the gem in this version constraint.
28+ */
2229 string getName ( ) { result = this .getArgument ( 0 ) .getConstantValue ( ) .getStringlikeValue ( ) }
2330
2431 /**
@@ -86,6 +93,10 @@ module Gemfile {
8693 )
8794 }
8895
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+ */
89100 class VersionConstraint extends string {
90101 Comparator comp ;
91102 string versionString ;
You can’t perform that action at this time.
0 commit comments