File tree Expand file tree Collapse file tree 6 files changed +2
-31
lines changed Expand file tree Collapse file tree 6 files changed +2
-31
lines changed Original file line number Diff line number Diff line change 11require "rspec/core/rake_task"
22RSpec ::Core ::RakeTask . new ( :spec )
33
4- desc "Build H3 C library"
5- task :build do
6- unless Dir . exist? ( "ext/h3/src/build" )
7- `git submodule update --init --recursive`
8- print "Building h3..."
9- `cd ext/h3; make > /dev/null 2>&1`
10- puts " done."
11- end
12- end
13-
14- desc "Remove compiled H3 library"
15- task :clean do
16- FileUtils . remove_dir ( "ext/h3/src/build" ) if Dir . exist? ( "ext/h3/src/build" )
17- end
18-
19- task spec : :build
20-
21- desc "Recompile the H3 C library"
22- task rebuild : %i[ clean build ]
23-
244task default : :spec
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -23,5 +23,4 @@ Gem::Specification.new do |spec|
2323 spec . add_development_dependency "yard" , "~> 0.9"
2424 spec . add_development_dependency "pry" , "~> 0.14"
2525
26- spec . extensions << "ext/h3/extconf.rb"
2726end
Original file line number Diff line number Diff line change @@ -5,12 +5,11 @@ module Bindings
55 # When extended, this module sets up FFI to use the H3 C library.
66 module Base
77 def self . extended ( base )
8- lib_path = File . expand_path ( __dir__ + "/../../../ext/h3/src/build/lib" )
98 base . extend FFI ::Library
109 base . extend Gem ::Deprecate
1110 base . include Structs
1211 base . include Types
13- base . ffi_lib [ "#{ lib_path } / libh3.dylib" , "#{ lib_path } / libh3.so" ]
12+ base . ffi_lib [ "libh3.dylib" , "libh3.so" ]
1413 base . typedef :ulong_long , :h3_index
1514 base . typedef :int , :k_distance
1615 base . typedef :uint , :h3_error_code
Original file line number Diff line number Diff line change 33# require "coveralls"
44# Coveralls.wear!
55
6- begin
7- require "h3"
8- rescue LoadError
9- raise "Could not load h3. Run `rake rebuild` to recompile."
10- end
6+ require "h3"
117
128# This file was generated by the `rspec --init` command. Conventionally, all
139# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
You can’t perform that action at this time.
0 commit comments