Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compat: address "old-style-definition" compiler error on Ruby 3.1+ #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
push:
pull_request:

jobs:
build:
runs-on: ${{ matrix.runner }}
name: Ruby ${{ matrix.ruby }}/${{ matrix.runner }}
strategy:
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
runner: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Compile extension
run: |
bundle exec rake compile

- name: Run tests
run: |
bundle exec rake test
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require "bundler/gem_tasks"
require "rake/testtask"
require 'rake/extensiontask'

Rake::ExtensionTask.new("visibility_monitor_c")
Rake::ExtensionTask.new("visibility_monitor")

Rake::TestTask.new(test: :compile) do |t|
t.libs << "test"
Expand Down
5 changes: 5 additions & 0 deletions ext/visibility_monitor/extconf.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require "mkmf"

$CFLAGS << " -Wall -Werror"

create_makefile "visibility_monitor"
7 changes: 7 additions & 0 deletions ext/visibility_monitor/mkmf.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extconf.h is:
/* begin */
1: #ifndef EXTCONF_H
2: #define EXTCONF_H
3: #endif
/* end */

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static VALUE monitor_set_visibility_placeholder(VALUE mod, VALUE method_name, VA
return Qnil;
}

void Init_visibility_monitor_c() {
void Init_visibility_monitor(void) {
VALUE mVisibilityMonitor = rb_define_module("VisibilityMonitor");

rb_define_method(mVisibilityMonitor, "public", monitor_public, -1);
Expand Down
3 changes: 0 additions & 3 deletions ext/visibility_monitor_c/extconf.rb

This file was deleted.

2 changes: 0 additions & 2 deletions lib/visibility_monitor.rb

This file was deleted.

Binary file removed lib/visibility_monitor/visibility_monitor.bundle
Binary file not shown.
Binary file removed lib/visibility_monitor_c.bundle
Binary file not shown.
8 changes: 4 additions & 4 deletions visibility_monitor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/dylanahsmith/visibility_monitor"
spec.license = "MIT"

spec.extensions = ['ext/visibility_monitor_c/extconf.rb']
spec.extensions = ['ext/visibility_monitor/extconf.rb']
spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.16"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rake-compiler", "~> 1.0"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "rake-compiler"
spec.add_development_dependency "minitest", "~> 5.0"
end