From 24424daab30e49852c565d1647ec37c59b280f36 Mon Sep 17 00:00:00 2001 From: Bryan Powell Date: Wed, 30 Dec 2020 17:15:36 -0800 Subject: [PATCH] Build the extension correctly --- .commit/config.yml | 2 +- Rakefile | 5 +++-- ext/llhttp/extconf.rb | 5 ++--- lib/llhttp/parser.rb | 2 +- llhttp.gemspec | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.commit/config.yml b/.commit/config.yml index cafdc74..399975c 100644 --- a/.commit/config.yml +++ b/.commit/config.yml @@ -50,7 +50,7 @@ ruby: gem: namespace: "LLHttp" extra: |-2 - spec.files = Dir["CHANGELOG.md", "README.md", "LICENSE", "lib/**/*"] + spec.files = Dir["CHANGELOG.md", "README.md", "LICENSE", "lib/**/*", "ext/**/*"] spec.require_path = "lib" spec.extensions = %w[ext/llhttp/extconf.rb] diff --git a/Rakefile b/Rakefile index 264a5cb..1c60120 100644 --- a/Rakefile +++ b/Rakefile @@ -5,7 +5,6 @@ require "rake/extensiontask" Rake::ExtensionTask.new "llhttp_ext" do |ext| ext.ext_dir = "ext/llhttp" - ext.lib_dir = "lib/llhttp" end task test: :compile do @@ -16,8 +15,10 @@ end task :clean do [ - "./lib/llhttp/llhttp_ext.bundle" + "./lib/llhttp_ext.bundle" ].each do |file| + next unless File.exist?(file) + FileUtils.rm(file) end end diff --git a/ext/llhttp/extconf.rb b/ext/llhttp/extconf.rb index 65cfc3f..3f82f7a 100644 --- a/ext/llhttp/extconf.rb +++ b/ext/llhttp/extconf.rb @@ -2,6 +2,5 @@ require "mkmf" -dir_config "llhttp_ext" - -create_makefile "llhttp_ext" +dir_config("llhttp_ext") +create_makefile("llhttp_ext") diff --git a/lib/llhttp/parser.rb b/lib/llhttp/parser.rb index 6f02644..34b0106 100644 --- a/lib/llhttp/parser.rb +++ b/lib/llhttp/parser.rb @@ -43,4 +43,4 @@ def initialize(delegate, type: :both) end end -require_relative "llhttp_ext" +require_relative "../llhttp_ext" diff --git a/llhttp.gemspec b/llhttp.gemspec index fdc2952..ecb6370 100644 --- a/llhttp.gemspec +++ b/llhttp.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |spec| spec.license = "MIT" - spec.files = Dir["CHANGELOG.md", "README.md", "LICENSE", "lib/**/*"] + spec.files = Dir["CHANGELOG.md", "README.md", "LICENSE", "lib/**/*", "ext/**/*"] spec.require_path = "lib" spec.extensions = %w[ext/llhttp/extconf.rb]