Skip to content

Commit

Permalink
Fix: web app example sinatra
Browse files Browse the repository at this point in the history
  • Loading branch information
Liliane Constantino committed Jan 3, 2022
1 parent 049d6ff commit 695a24e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pipelinit
<td rowspan="1">Shell script</td>
<td>Lint</td>
<td>✔️</td>
<td rowspan="6">Coming soon</td>
<td rowspan="7">Coming soon</td>
</tr>
<tr>
<td rowspan="2">Java</td>
Expand All @@ -170,7 +170,7 @@ pipelinit
<td>✔️</td>
</tr>
<tr>
<td rowspan="2">Ruby</td>
<td rowspan="3">Ruby</td>
<td>Lint</td>
<td>✔️</td>
</tr>
Expand Down
9 changes: 9 additions & 0 deletions core/plugins/stack/ruby/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Formatters,
introspect as introspectFormatters,
} from "./formatters.ts";
import { introspect as introspectType } from "./types.ts";

/**
* Introspected information about a project with Ruby
Expand All @@ -19,6 +20,10 @@ export default interface RubyProject {
*/
linters: Linters;
formatters: Formatters;
/**
* Identified type of project
*/
type?: string | null;
}

export const introspector: Introspector<RubyProject | undefined> = {
Expand All @@ -42,10 +47,14 @@ export const introspector: Introspector<RubyProject | undefined> = {
const linters = await introspectLinters(context);
const formatters = await introspectFormatters(context);

//Project type
const projectType = await introspectType(context);

return {
version: version,
linters: linters,
formatters: formatters,
type: projectType,
};
},
};
9 changes: 9 additions & 0 deletions tests/default_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ test(
},
);

test(
{ fixture: "ruby/sinatra", args: ["--no-strict"] },
async (stdout, _stderr, code, assertExpectedFiles) => {
assertStringIncludes(stdout, "Detected stack: ruby");
assertEquals(code, 0);
await assertExpectedFiles();
},
);

test(
{ fixture: "docker/docker-lint-build", args: ["--no-strict"] },
async (stdout, _stderr, code, assertExpectedFiles) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.3.0"
ruby-version: "3.0.2"
bundler-cache: true
- run: bundle exec sinatra --format .
- run: gem install
- run: gem install rubocop
- run: bundle exec rubocop --format .
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.3.0"
ruby-version: "3.0.2"
bundler-cache: true
- run: bundle exec sinatra --lint .
- run: gem install
- run: gem install rubocop
- run: bundle exec rubocop --lint .

0 comments on commit 695a24e

Please sign in to comment.