Module: FFI::Library
- Included in:
- CPL::Conv, CPL::Error, CPL::HTTP, CPL::HashSet, CPL::List::ListFunctions::ClassMethods, CPL::MiniXML, CPL::Port, CPL::Progress, CPL::QuadTree, CPL::String, CPL::VSI, GDAL, GDAL::Alg, GDAL::GDAL, GDAL::Grid, GDAL::Matching, GDAL::Utils, GDAL::VRT, GDAL::Warper, OGR::API, OGR::Core, OGR::Featurestyle, OGR::Geocoding, OGR::SRSAPI, Rttopo
- Defined in:
- lib/ext/ffi_library_function_checks.rb
Overview
Redefining #attach_function so we can avoid bombing out if a called method is not defined.
Instance Method Summary collapse
Instance Method Details
#attach_function(*args) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ext/ffi_library_function_checks.rb', line 12 def attach_function(*args) old_attach_function(*args) rescue FFI::NotFoundError @unsupported_gdal_functions ||= [] if $VERBOSE || ENV.fetch("VERBOSE", nil) warn "ffi-gdal warning: function '#{args.first}' is not available in this " \ "build of GDAL/OGR (v#{FFI::GDAL.GDALVersionInfo('RELEASE_NAME')})" end @unsupported_gdal_functions << args.first end |
#old_attach_function ⇒ Object
10 |
# File 'lib/ext/ffi_library_function_checks.rb', line 10 alias old_attach_function attach_function |
#unsupported_gdal_functions ⇒ Object
25 26 27 |
# File 'lib/ext/ffi_library_function_checks.rb', line 25 def unsupported_gdal_functions @unsupported_gdal_functions ||= [] end |