File tree Expand file tree Collapse file tree 6 files changed +33
-36
lines changed
Expand file tree Collapse file tree 6 files changed +33
-36
lines changed Original file line number Diff line number Diff line change 4141* .so
4242* .so. *
4343* .dylib
44+ * .bundle
4445
4546# Executables
4647* .exe
@@ -64,3 +65,6 @@ modules.order
6465Module.symvers
6566Mkfile.old
6667dkms.conf
68+
69+ # Temporary files
70+ tmp /*
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ test_sources = $(wildcard test/*.c)
88test_objects = $(test_sources:.c=.o )
99non_main_objects = $(filter-out src/main.o, $(objects ) )
1010
11- soext ?= $(shell ruby -e 'puts RbConfig::CONFIG["SOEXT "]')
11+ soext ?= $(shell ruby -e 'puts RbConfig::CONFIG["DLEXT "]')
1212lib_name = lib$(exec ) .$(soext )
1313ruby_extension = ext/erbx/$(lib_name )
1414
@@ -47,4 +47,4 @@ test: $(test_objects) $(non_main_objects)
4747
4848clean :
4949 rm -f $(exec ) $(test_exec ) $(lib_name ) $(ruby_extension )
50- rm -f src/* .o test/* .o
50+ rm -rf src/* .o test/* .o lib/erbx/ * .bundle tmp
Original file line number Diff line number Diff line change @@ -17,23 +17,24 @@ Rake::TestTask.new(:test) do |t|
1717end
1818
1919Rake ::Task [ :compile ] . enhance do
20- IO . popen ( "make" ) do |output |
21- output . each_line do |line |
22- puts "#{ line } "
23- end
24- end
20+ IO . popen ( "make" ) do |output |
21+ output . each_line do |line |
22+ puts "#{ line } "
23+ end
24+ end
25+
26+ if $?. exitstatus != 0
27+ raise "src/* could not be compiled #{ $?. exitstatus } "
28+ end
29+ end
2530
26- if $?. exitstatus != 0
27- raise "src/* could not be compiled #{ $?. exitstatus } "
28- end
29- end
3031
31- Rake ::Task [ :clean ] . enhance do
32- IO . popen ( "make clean" ) do |output |
33- output . each_line do |line |
34- puts "#{ line } "
35- end
36- end
37- end
32+ Rake ::Task [ :clean ] . enhance do
33+ IO . popen ( "make clean" ) do |output |
34+ output . each_line do |line |
35+ puts "#{ line } "
36+ end
37+ end
38+ end
3839
39- task default : [ :compile , :test ]
40+ task default : [ :compile , :test ]
Original file line number Diff line number Diff line change @@ -13,11 +13,14 @@ Gem::Specification.new do |spec|
1313 spec . required_ruby_version = ">= 3.0.0"
1414
1515 spec . require_paths = [ "lib" ]
16- spec . files = [
17- "ext/erbx/extension.c" ,
18- "lib/erbx.rb" ,
19- # "lib/erbx/version.rb"
20- ]
16+
17+ gemspec = File . basename ( __FILE__ )
18+ spec . files = IO . popen ( %w[ git ls-files -z ] , chdir : __dir__ , err : IO ::NULL ) do |ls |
19+ ls . readlines ( "\x0 " , chomp : true ) . reject do |f |
20+ ( f == gemspec ) ||
21+ f . start_with? ( *%w[ bin/ test/ spec/ features/ .git .github appveyor Gemfile ] )
22+ end
23+ end
2124
2225 spec . extensions = [ "ext/erbx/extconf.rb" ]
2326 spec . metadata [ "allowed_push_host" ] = "https://rubygems.org"
Original file line number Diff line number Diff line change 99 abort "#{ extension_name } .h can't be found"
1010end
1111
12- # expected_functions = [
13- # "erbx_lex",
14- # "erbx_lex_file",
15- # ]
16- #
17- # expected_functions.each do |expected_function|
18- # unless find_library(extension_name, expected_function)
19- # abort "lib#{extension_name}.so can't be found or #{expected_function}() not defined in it"
20- # end
21- # end
22-
2312create_header
2413create_makefile ( "#{ extension_name } /#{ extension_name } " )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ module LibERBX
88 extend FFI ::Library
99
1010 def self . library_extension
11- RbConfig ::CONFIG [ "SOEXT " ]
11+ RbConfig ::CONFIG [ "DLEXT " ]
1212 end
1313
1414 def self . library_name
You can’t perform that action at this time.
0 commit comments