-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
283 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Documentation Coverage | ||
|
||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
CONSOLE_OUTPUT: XTerm | ||
COVERAGE: PartialSummary | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.3" | ||
bundler-cache: true | ||
|
||
- name: Validate coverage | ||
timeout-minutes: 5 | ||
run: bundle exec bake decode:index:coverage lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: RuboCop | ||
|
||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
CONSOLE_OUTPUT: XTerm | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ruby | ||
bundler-cache: true | ||
|
||
- name: Run RuboCop | ||
timeout-minutes: 10 | ||
run: bundle exec rubocop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
AllCops: | ||
DisabledByDefault: true | ||
|
||
Layout/IndentationStyle: | ||
Enabled: true | ||
EnforcedStyle: tabs | ||
|
||
Layout/InitialIndentation: | ||
Enabled: true | ||
|
||
Layout/IndentationWidth: | ||
Enabled: true | ||
Width: 1 | ||
|
||
Layout/IndentationConsistency: | ||
Enabled: true | ||
EnforcedStyle: normal | ||
|
||
Layout/BlockAlignment: | ||
Enabled: true | ||
|
||
Layout/EndAlignment: | ||
Enabled: true | ||
EnforcedStyleAlignWith: start_of_line | ||
|
||
Layout/BeginEndAlignment: | ||
Enabled: true | ||
EnforcedStyleAlignWith: start_of_line | ||
|
||
Layout/ElseAlignment: | ||
Enabled: true | ||
|
||
Layout/DefEndAlignment: | ||
Enabled: true | ||
|
||
Layout/CaseIndentation: | ||
Enabled: true | ||
|
||
Layout/CommentIndentation: | ||
Enabled: true | ||
|
||
Layout/EmptyLinesAroundClassBody: | ||
Enabled: true | ||
|
||
Layout/EmptyLinesAroundModuleBody: | ||
Enabled: true | ||
|
||
Style/FrozenStringLiteralComment: | ||
Enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
# frozen_string_literal: true | ||
class HelloWorld | ||
JSON_TYPE = "application/json".freeze | ||
PLAINTEXT_TYPE = "text/plain".freeze | ||
|
||
def respond(type, body) | ||
[200, { "Content-Type" => type }, [body]] | ||
end | ||
|
||
def call(env) | ||
case env["PATH_INFO"] | ||
when "/json" | ||
# Test type 1: JSON serialization | ||
return respond JSON_TYPE, | ||
Oj.dump({ message: "Hello, World!" }, { mode: :strict }) | ||
when "/plaintext" | ||
# Test type 6: Plaintext | ||
return respond PLAINTEXT_TYPE, "Hello, World!" | ||
end | ||
|
||
[200, {}, []] | ||
end | ||
JSON_TYPE = "application/json".freeze | ||
PLAINTEXT_TYPE = "text/plain".freeze | ||
|
||
def respond(type, body) | ||
[200, { "Content-Type" => type }, [body]] | ||
end | ||
|
||
def call(env) | ||
case env["PATH_INFO"] | ||
when "/json" | ||
# Test type 1: JSON serialization | ||
return respond JSON_TYPE, Oj.dump({ message: "Hello, World!" }, { mode: :strict }) | ||
when "/plaintext" | ||
# Test type 6: Plaintext | ||
return respond PLAINTEXT_TYPE, "Hello, World!" | ||
end | ||
|
||
[200, {}, []] | ||
end | ||
end | ||
|
||
# run HelloWorld.new | ||
|
||
run do | ||
end | ||
run HelloWorld.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
class EchoBody | ||
def initialize(input) | ||
@input = input | ||
end | ||
def initialize(input) | ||
@input = input | ||
end | ||
|
||
def each(&output) | ||
while chunk = @input.read(1024) | ||
output.call(chunk) | ||
end | ||
end | ||
def each(&output) | ||
while chunk = @input.read(1024) | ||
output.call(chunk) | ||
end | ||
end | ||
end | ||
|
||
run lambda{|env| | ||
[200, [], EchoBody.new(env['rack.input'])] | ||
[200, [], EchoBody.new(env['rack.input'])] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.