Skip to content

Commit 7506681

Browse files
committed
Add more Ruby refs as per CD plan
1 parent a237137 commit 7506681

File tree

9 files changed

+31
-11
lines changed

9 files changed

+31
-11
lines changed

docs/codeql/codeql-cli/about-ql-packs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ QL packs are used to organize the files used in CodeQL analysis. They
77
contain queries, library files, query suites, and important metadata.
88

99
The `CodeQL repository <https://github.com/github/codeql>`__ contains QL packs for
10-
C/C++, C#, Java, JavaScript, and Python. The `CodeQL for Go
10+
C/C++, C#, Java, JavaScript, Python, and Ruby. The `CodeQL for Go
1111
<https://github.com/github/codeql-go/>`__ repository contains a QL pack for Go
1212
analysis. You can also make custom QL packs to contain your own queries and
1313
libraries.

docs/codeql/codeql-cli/creating-codeql-databases.rst

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ Creating databases for non-compiled languages
8888
---------------------------------------------
8989

9090
The CodeQL CLI includes extractors to create databases for non-compiled
91-
languages---specifically, JavaScript (and TypeScript) and Python. These
92-
extractors are automatically invoked when you specify JavaScript or Python as
91+
languages---specifically, JavaScript (and TypeScript), Python, and Ruby. These
92+
extractors are automatically invoked when you specify JavaScript, Python, or Ruby as
9393
the ``--language`` option when executing ``database create``. When creating
9494
databases for these languages you must ensure that all additional dependencies
9595
are available.
9696

9797
.. pull-quote:: Important
9898

99-
When you run ``database create`` for JavaScript, TypeScript, and Python, you should not
99+
When you run ``database create`` for JavaScript, TypeScript, Python, and Ruby, you should not
100100
specify a ``--command`` option. Otherwise this overrides the normal
101101
extractor invocation, which will create an empty database. If you create
102102
databases for multiple languages and one of them is a compiled language,
@@ -127,14 +127,25 @@ When creating databases for Python you must ensure:
127127
packages that the codebase depends on.
128128
- You have installed the `virtualenv <https://pypi.org/project/virtualenv/>`__ pip module.
129129

130-
In the command line you must specify ``--language=python``. For example
130+
In the command line you must specify ``--language=python``. For example::
131131
::
132132

133133
codeql database create --language=python <output-folder>/python-database
134134

135-
executes the ``database create`` subcommand from the code's checkout root,
135+
This executes the ``database create`` subcommand from the code's checkout root,
136136
generating a new Python database at ``<output-folder>/python-database``.
137137

138+
Ruby
139+
~~~~
140+
141+
Creating databases for Ruby requires no additional dependencies.
142+
In the command line you must specify ``--language=ruby``. For example::
143+
144+
codeql database create --language=ruby --source-root <folder-to-extract> <output-folder>/ruby-database
145+
146+
Here, we have specified a ``--source-root`` path, which is the location where
147+
database creation is executed, but is not necessarily the checkout root of the
148+
codebase.
138149

139150
Creating databases for compiled languages
140151
-----------------------------------------

docs/codeql/codeql-cli/getting-started-with-the-codeql-cli.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ further options on the command line.
100100

101101
The `CodeQL repository <https://github.com/github/codeql>`__ contains
102102
the queries and libraries required for CodeQL analysis of C/C++, C#, Java,
103-
JavaScript/TypeScript, and Python.
103+
JavaScript/TypeScript, Python, and Ruby.
104104
Clone a copy of this repository into ``codeql-home``.
105105

106106
By default, the root of the cloned repository will be called ``codeql``.

docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Using the starter workspace
7878
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7979
The starter workspace is a Git repository. It contains:
8080

81-
* The `repository of CodeQL libraries and queries <https://github.com/github/codeql>`__ for C/C++, C#, Java, JavaScript, and Python. This is included as a submodule, so it can be updated without affecting your custom queries.
81+
* The `repository of CodeQL libraries and queries <https://github.com/github/codeql>`__ for C/C++, C#, Java, JavaScript, Python, and Ruby. This is included as a submodule, so it can be updated without affecting your custom queries.
8282
* The `repository of CodeQL libraries and queries <https://github.com/github/codeql-go>`__ for Go. This is also included as a submodule.
8383
* A series of folders named ``codeql-custom-queries-<language>``. These are ready for you to start developing your own custom queries for each language, using the standard libraries. There are some example queries to get you started.
8484

docs/codeql/query-help/codeql-cwe-coverage.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ Note that the CWE coverage includes both "`supported queries <https://github.com
3333
java-cwe
3434
javascript-cwe
3535
python-cwe
36+
37+
.. include:: ../reusables/ruby-beta-note.rst

docs/codeql/query-help/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ View the query help for the queries included in the ``code-scanning``, ``securit
1010
- :doc:`CodeQL query help for JavaScript <javascript>`
1111
- :doc:`CodeQL query help for Python <python>`
1212

13-
1413
.. pull-quote:: Information
1514

1615
Each query help article includes:
@@ -23,6 +22,8 @@ View the query help for the queries included in the ``code-scanning``, ``securit
2322

2423
For a full list of the CWEs covered by these queries, see ":doc:`CodeQL CWE coverage <codeql-cwe-coverage>`."
2524

25+
.. include:: ../reusables/ruby-beta-note.rst
26+
2627
.. toctree::
2728
:hidden:
2829
:titlesonly:

docs/codeql/reusables/extractors.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
* - JavaScript/TypeScript
1616
- ``javascript``
1717
* - Python
18-
- ``python``
18+
- ``python``
19+
* - Ruby
20+
- ``ruby``
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. pull-quote:: Note
2+
3+
CodeQL analysis for Ruby is currently in beta. During the beta, analysis of Ruby code,
4+
and the accompanying documentation, will not be as comprehensive as for other languages.

docs/codeql/writing-codeql-queries/creating-path-queries.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Declaring sources and sinks
116116
You must provide information about the ``source`` and ``sink`` in your path query. These are objects that correspond to the nodes of the paths that you are exploring.
117117
The name and the type of the ``source`` and the ``sink`` must be declared in the ``from`` statement of the query, and the types must be compatible with the nodes of the graph computed by the ``edges`` predicate.
118118

119-
If you are querying C/C++, C#, Java, or JavaScript code (and you have used ``import DataFlow::PathGraph`` in your query), the definitions of the ``source`` and ``sink`` are accessed via the ``Configuration`` class in the data flow library. You should declare all three of these objects in the ``from`` statement.
119+
If you are querying C/C++, C#, Java, JavaScript, or Ruby code (and you have used ``import DataFlow::PathGraph`` in your query), the definitions of the ``source`` and ``sink`` are accessed via the ``Configuration`` class in the data flow library. You should declare all three of these objects in the ``from`` statement.
120120
For example:
121121

122122
.. code-block:: ql

0 commit comments

Comments
 (0)