Skip to content

Commit 9ed9858

Browse files
authored
Fix Struct#pretty_inspect error, add CI tasks for github (#4)
Last Struct#pretty_inspect commit was missing a line that did not get committed. Adding that line. To prevent this from happening again, added github CI tasks for PRs & merges to main.
1 parent d71ec98 commit 9ed9858

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
main:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
ruby:
21+
- "3.1"
22+
- "3.2"
23+
- "3.3"
24+
- "3.4"
25+
- ruby-head
26+
name: "Ruby ${{ matrix.ruby }}: ${{ matrix.task }}"
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: ruby/setup-ruby@v1
30+
with:
31+
ruby-version: "${{ matrix.ruby }}"
32+
bundler-cache: true
33+
# install castxml for the importer tests
34+
- run: sudo apt-get update && sudo apt-get install -y castxml
35+
- run: bundle install
36+
- run: bundle exec rake spec

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Gemfile.lock
1010

1111
# rspec failure tracking
1212
.rspec_status
13-
.rspec
1413

1514
# apple files
1615
.DS_Store

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--format documentation
2+
--color
3+
--require spec_helper

lib/ctypes/struct.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ def pretty_print(q) # :nodoc:
517517
type.is_a?(CTypes::Pad)
518518
end
519519
q.seplist(fields, -> { q.breakable("") }) do |name, _|
520+
names = name.is_a?(::Array) ? name : [name]
520521
names.each do |name|
521522
next if name.is_a?(CTypes::Pad)
522523
q.text(".#{name} = ")

0 commit comments

Comments
 (0)