Skip to content

Commit a9dab20

Browse files
authored
Use FILE Instead of file for RBS Validation (#421)
This PR updates the RBS validation process by changing the parameter from `file` to `FILE`, resolving the issue of the file not being found during the execution of `rbs validate`. Additionally, this change adds the rbs command as a part of our CI workflow. resolve #424
1 parent 1acc99a commit a9dab20

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

.github/workflows/pull_request.yml

+12
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ jobs:
2727
- run: bundle exec rubocop
2828
- run: bundle exec rspec
2929

30+
rbs:
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
steps:
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.0
37+
with:
38+
ruby-version: '3.2'
39+
- run: gem install rbs
40+
- run: rbs -I sig validate
41+
3042
pinact:
3143
runs-on: ubuntu-latest
3244
permissions:

README_v2.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ main
182182
See the [examples](examples/v2) directory for more examples.
183183

184184
### RBS
185-
This library provides RBS files for type checking.\
185+
This library provides [RBS](https://github.com/ruby/rbs) files for type checking.\
186186
You can code with type support in the corresponding IDE or editor.
187187

188188
## Media

generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{# @pebvariable name="operations" type="org.openapitools.codegen.model.OperationMap" -#}
22
{# @pebvariable name="authMethods" type="java.util.ArrayList<org.openapitools.codegen.CodegenSecurity>" -#}
33
{# @pebvariable name="packageName" type="String" #}
4-
{%- include "./license-info.pebble" %}
4+
{%- include "./license.pebble" %}
55
require 'json'
66

77
require 'line/bot/v2/http_client'

generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module Line
3838
{%- for param in op.allParams %}
3939
{{param.paramName}}: {{ param.dataType }}{{ param.required ? '' : '?' }}{{ loop.last ? '' : ', ' -}}
4040
{% endfor %}
41-
) -> [({% for response in op.responses %}{{ response.baseType == 'object' or response.baseType == null ? 'String?' : response.baseType }}{{ loop.last ? '' : '|' }}{% endfor %}), Integer, Hash[String, String]]
41+
) -> [({% for response in op.responses %}{{ response.baseType == 'object' or response.baseType == null ? 'String?' : response.dataType }}{{ loop.last ? '' : '|' }}{% endfor %}), Integer, Hash[String, String]]
4242

4343
# {{ op.notes }}
4444
#
@@ -61,7 +61,7 @@ module Line
6161
{%- for param in op.allParams %}
6262
{{param.paramName}}: {{ param.dataType }}{{ param.required ? '' : '?' }}{{ loop.last ? '' : ', ' -}}
6363
{% endfor %}
64-
) -> ({% for response in op.responses %}{{ response.baseType == 'object' or response.baseType == null ? 'String?' : response.baseType }}{{ loop.last ? '' : '|' }}{% endfor %}){% endfor %}
64+
) -> ({% for response in op.responses %}{{ response.baseType == 'object' or response.baseType == null ? 'String?' : response.dataType }}{{ loop.last ? '' : '|' }}{% endfor %}){% endfor %}
6565
end
6666
end
6767
end

sig/line/bot/v2/messaging_api/api/messaging_api_blob_client.rbs

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,31 @@ module Line
2424
# @see https://developers.line.biz/en/reference/messaging-api/#get-content
2525
def get_message_content_with_http_info: (
2626
message_id: String
27-
) -> [(file), Integer, Hash[String, String]]
27+
) -> [(File), Integer, Hash[String, String]]
2828

2929
# Download image, video, and audio data sent from users.
3030
#
3131
# @param message_id Message ID of video or audio
3232
# @see https://developers.line.biz/en/reference/messaging-api/#get-content
3333
def get_message_content: (
3434
message_id: String
35-
) -> (file)
35+
) -> (File)
3636

3737
# Get a preview image of the image or video
3838
#
3939
# @param message_id Message ID of image or video
4040
# @see https://developers.line.biz/en/reference/messaging-api/#get-image-or-video-preview
4141
def get_message_content_preview_with_http_info: (
4242
message_id: String
43-
) -> [(file), Integer, Hash[String, String]]
43+
) -> [(File), Integer, Hash[String, String]]
4444

4545
# Get a preview image of the image or video
4646
#
4747
# @param message_id Message ID of image or video
4848
# @see https://developers.line.biz/en/reference/messaging-api/#get-image-or-video-preview
4949
def get_message_content_preview: (
5050
message_id: String
51-
) -> (file)
51+
) -> (File)
5252

5353
# Verify the preparation status of a video or audio for getting
5454
#
@@ -72,15 +72,15 @@ module Line
7272
# @see https://developers.line.biz/en/reference/messaging-api/#download-rich-menu-image
7373
def get_rich_menu_image_with_http_info: (
7474
rich_menu_id: String
75-
) -> [(file), Integer, Hash[String, String]]
75+
) -> [(File), Integer, Hash[String, String]]
7676

7777
# Download rich menu image.
7878
#
7979
# @param rich_menu_id ID of the rich menu with the image to be downloaded
8080
# @see https://developers.line.biz/en/reference/messaging-api/#download-rich-menu-image
8181
def get_rich_menu_image: (
8282
rich_menu_id: String
83-
) -> (file)
83+
) -> (File)
8484

8585
# Upload rich menu image
8686
#

0 commit comments

Comments
 (0)