Commit 3b1173ec authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'selhorn-codeblock2' into 'master'

More code block languages

See merge request gitlab-org/gitlab!24726
parents b4426eac 698fdc0b
......@@ -27,7 +27,7 @@ end
This will end up producing queries such as:
```
```plaintext
User Load (0.7ms) SELECT "users"."id" FROM "users" WHERE ("users"."id" >= 41654) ORDER BY "users"."id" ASC LIMIT 1 OFFSET 1000
(0.7ms) SELECT COUNT(*) FROM "users" WHERE ("users"."id" >= 41654) AND ("users"."id" < 42687)
```
......
......@@ -16,25 +16,25 @@ There are a few basic commands License Finder provides that you'll need in order
To verify that the checks are passing, and/or to see what dependencies are causing the checks to fail:
```
```shell
bundle exec license_finder
```
To whitelist a new license:
```
```shell
license_finder whitelist add MIT
```
To blacklist a new license:
```
```shell
license_finder blacklist add GPLv2
```
To tell License Finder about a dependency's license if it isn't auto-detected:
```
```shell
license_finder licenses add my_unknown_dependency MIT
```
......
......@@ -9,7 +9,7 @@ Currently `Rails.logger` calls all get saved into `production.log`, which contai
a mix of Rails' logs and other calls developers have inserted in the code base.
For example:
```
```plaintext
Started GET "/gitlabhq/yaml_db/tree/master" for 168.111.56.1 at 2015-02-12 19:34:53 +0200
Processing by Projects::TreeController#show as HTML
Parameters: {"project_id"=>"gitlabhq/yaml_db", "id"=>"master"}
......
......@@ -38,7 +38,7 @@ endpoints like:
Since the packages belong to a project, it's expected to have project-level endpoint (remote)
for uploading and downloading them. For example:
```
```plaintext
GET https://gitlab.com/api/v4/projects/<your_project_id>/packages/npm/
PUT https://gitlab.com/api/v4/projects/<your_project_id>/packages/npm/
```
......
......@@ -28,7 +28,7 @@ By default, QueryRecorder will ignore cached queries in the count. However, it m
all queries to avoid introducing an N+1 query that may be masked by the statement cache. To do this,
pass the `skip_cached` variable to `QueryRecorder` and use the `exceed_all_query_limit` matcher:
```
```ruby
it "avoids N+1 database queries" do
control_count = ActiveRecord::QueryRecorder.new(skip_cached: false) { visit_some_page }.count
create_list(:issue, 5)
......@@ -48,13 +48,13 @@ This could lead to false successes where subsequent "requests" could have querie
It may be useful to identify the source of the queries by looking at the call backtrace.
To enable this, run the specs with the `QUERY_RECORDER_DEBUG` environment variable set. For example:
```
```shell
QUERY_RECORDER_DEBUG=1 bundle exec rspec spec/requests/api/projects_spec.rb
```
This will log calls to QueryRecorder into the `test.log`. For example:
```
```plaintext
QueryRecorder SQL: SELECT COUNT(*) FROM "issues" WHERE "issues"."deleted_at" IS NULL AND "issues"."project_id" = $1 AND ("issues"."state" IN ('opened')) AND "issues"."confidential" = $2
--> /home/user/gitlab/gdk/gitlab/spec/support/query_recorder.rb:19:in `callback'
--> /home/user/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/fanout.rb:127:in `finish'
......
......@@ -4,7 +4,7 @@
Note that if your db user does not have advanced privileges you must create the db manually before running this command.
```
```shell
bundle exec rake setup
```
......@@ -70,7 +70,7 @@ Group are additionally seeded with epics if GitLab instance has epics feature av
If you're very sure that you want to **wipe the current database** and refill
seeds, you could:
``` shell
```shell
echo 'yes' | bundle exec rake setup
```
......@@ -83,7 +83,7 @@ your terminal, and it would generate more than 20G logs if you just redirect
it to a file. If we don't care about the output, we could just redirect it to
`/dev/null`:
``` shell
```shell
echo 'yes' | bundle exec rake setup > /dev/null
```
......@@ -138,13 +138,13 @@ you don't need to boot it every time you run a test, rake task or migration.
If you want to use it, you'll need to export the `ENABLE_SPRING` environment
variable to `1`:
```
```shell
export ENABLE_SPRING=1
```
Alternatively you can use the following on each spec run,
```
```shell
bundle exec spring rspec some_spec.rb
```
......@@ -154,7 +154,7 @@ You shouldn't ever need to compile frontend assets manually in development, but
if you ever need to test how the assets get compiled in a production
environment you can do so with the following command:
```
```shell
RAILS_ENV=production NODE_ENV=production bundle exec rake gitlab:assets:compile
```
......@@ -167,7 +167,7 @@ they can be easily inspected.
To update the Emoji aliases file (used for Emoji autocomplete) you must run the
following:
```
```shell
bundle exec rake gemojione:aliases
```
......@@ -176,7 +176,7 @@ bundle exec rake gemojione:aliases
To update the Emoji digests file (used for Emoji autocomplete) you must run the
following:
```
```shell
bundle exec rake gemojione:digests
```
......@@ -187,7 +187,7 @@ available Emoji.
Generating a sprite file containing all the Emoji can be done by running:
```
```shell
bundle exec rake gemojione:sprite
```
......@@ -201,7 +201,7 @@ task, then check the dimensions of the new spritesheet and update the
Starting a project from a template needs this project to be exported. On a
up to date master branch run:
```
```shell
gdk start
bundle exec rake gitlab:update_project_templates
git checkout -b update-project-templates
......@@ -233,7 +233,7 @@ a file for quick reference.
To see a list of all obsolete `ignored_columns` run:
```
```shell
bundle exec rake db:obsolete_ignored_columns
```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment