ffi-geos 1.2.2 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +49 -0
  3. data/.rubocop.yml +5117 -4
  4. data/FUNDING.yml +2 -0
  5. data/Gemfile +9 -16
  6. data/Guardfile +3 -4
  7. data/MIT-LICENSE +1 -1
  8. data/README.rdoc +2 -20
  9. data/Rakefile +3 -2
  10. data/ffi-geos.gemspec +7 -2
  11. data/lib/ffi-geos/buffer_params.rb +1 -1
  12. data/lib/ffi-geos/coordinate_sequence.rb +179 -177
  13. data/lib/ffi-geos/geometry.rb +118 -31
  14. data/lib/ffi-geos/geometry_collection.rb +26 -12
  15. data/lib/ffi-geos/interrupt.rb +11 -14
  16. data/lib/ffi-geos/line_string.rb +64 -49
  17. data/lib/ffi-geos/multi_line_string.rb +1 -1
  18. data/lib/ffi-geos/point.rb +18 -18
  19. data/lib/ffi-geos/polygon.rb +44 -30
  20. data/lib/ffi-geos/prepared_geometry.rb +1 -1
  21. data/lib/ffi-geos/strtree.rb +28 -30
  22. data/lib/ffi-geos/tools.rb +1 -1
  23. data/lib/ffi-geos/utils.rb +16 -23
  24. data/lib/ffi-geos/version.rb +1 -1
  25. data/lib/ffi-geos/wkb_reader.rb +1 -1
  26. data/lib/ffi-geos/wkb_writer.rb +4 -5
  27. data/lib/ffi-geos/wkt_reader.rb +1 -1
  28. data/lib/ffi-geos/wkt_writer.rb +7 -13
  29. data/lib/ffi-geos.rb +134 -48
  30. data/sonar-project.properties +16 -0
  31. data/test/coordinate_sequence_tests.rb +148 -126
  32. data/test/geometry_collection_tests.rb +41 -67
  33. data/test/geometry_tests.rb +341 -40
  34. data/test/interrupt_tests.rb +7 -7
  35. data/test/line_string_tests.rb +23 -15
  36. data/test/point_tests.rb +5 -5
  37. data/test/polygon_tests.rb +6 -7
  38. data/test/prepared_geometry_tests.rb +8 -8
  39. data/test/strtree_tests.rb +13 -12
  40. data/test/test_helper.rb +74 -56
  41. data/test/utils_tests.rb +69 -59
  42. data/test/wkb_reader_tests.rb +9 -9
  43. data/test/wkb_writer_tests.rb +14 -12
  44. data/test/wkt_reader_tests.rb +0 -1
  45. data/test/wkt_writer_tests.rb +2 -5
  46. metadata +12 -10
  47. data/.travis.yml +0 -21
data/FUNDING.yml ADDED
@@ -0,0 +1,2 @@
1
+ github:
2
+ - dark-panda
data/Gemfile CHANGED
@@ -1,23 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
7
+ gem 'guard'
8
+ gem 'guard-minitest'
5
9
  gem 'minitest'
6
10
  gem 'minitest-reporters'
7
- gem 'rake', '~> 10.0'
8
- gem 'rdoc', '~> 3.12'
9
-
10
- platforms :rbx do
11
- gem 'rubinius-developer_tools'
12
- gem 'rubysl', '~> 2.0'
13
- end
14
-
15
- if RUBY_VERSION >= '1.9'
16
- gem 'guard'
17
- gem 'guard-minitest'
18
- gem 'simplecov'
19
- end
11
+ gem 'rake'
12
+ gem 'rdoc'
13
+ gem 'rubocop', require: false
14
+ gem 'simplecov', require: false
20
15
 
21
- if File.exist?('Gemfile.local')
22
- instance_eval File.read('Gemfile.local')
23
- end
16
+ instance_eval File.read('Gemfile.local') if File.exist?('Gemfile.local')
data/Guardfile CHANGED
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  guard 'minitest', test_folders: 'test', test_file_patterns: '*_tests.rb' do
3
- watch(%r|^test/(.+)_tests\.rb|)
4
+ watch(%r{^test/(.+)_tests\.rb})
4
5
 
5
6
  watch(%r{^lib/(.*/)?([^/]+)\.rb$}) do |m|
6
7
  "test/#{m[2]}_tests.rb"
@@ -11,6 +12,4 @@ guard 'minitest', test_folders: 'test', test_file_patterns: '*_tests.rb' do
11
12
  end
12
13
  end
13
14
 
14
- if File.exist?('Guardfile.local')
15
- instance_eval File.read('Guardfile.local')
16
- end
15
+ instance_eval File.read('Guardfile.local') if File.exist?('Guardfile.local')
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2017 J Smith <dark.panda@gmail.com>
1
+ Copyright (c) 2010-2021 J Smith <dark.panda@gmail.com>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
data/README.rdoc CHANGED
@@ -7,15 +7,8 @@
7
7
  * GEOS version 3.3.0 or greater. GEOS 3.2.2 and below will work to an extent,
8
8
  but some features and methods will be disabled or missing.
9
9
 
10
- Ruby versions known to work according to travis-ci and local testing:
11
-
12
- * Ruby MRI 1.9.3, 2.0+, 2.1+, 2.2+
13
- * Ruby MRI 1.8.7 works but as Ruby 1.8 is no longer being maintained, there's
14
- no guarantee this will continue in the future and is therefore no longer
15
- being tested with the same rigour as more modern versions of Ruby.
16
- * Rubinius 2
17
- * JRuby 1.6+, with the exception of versions of JRuby prior to 1.6.3 as per
18
- below. This includes both 1.8 and 1.9 modes.
10
+ We currently test on Travis CI using the current releases of MRI that are
11
+ maintained. See `.travis.yml` for a list. We also test against jruby-head.
19
12
 
20
13
  === JRuby Notes
21
14
 
@@ -74,17 +67,6 @@ Ruby bindings along with the following enhancements and additions:
74
67
  entire GEOS C API is represented in ffi-geos along with all sorts of useful
75
68
  convenience methods and geometry conversion and manipulation methods.
76
69
 
77
- * *NEW IN ffi-geos 1.0.0* -- all errors thrown by ffi-geos are now instances of
78
- Geos::Error or subclasses thereof. Geos::Error itself is a descendant
79
- of RuntimeError as is the case with the native Geos extension. This means
80
- that code like rescue RuntimeError should still work but you can now
81
- further capture more precise error types by capturing errors like
82
- Geos::Error, Geos::ParseError, etc.
83
-
84
- * *NEW IN ffi-geos 1.0.0* -- new methods for Geom::Geometry#voronoi_diagram,
85
- Geos::MultiLineString#closed? and Geos::Geometry#clip_by_rect when using
86
- GEOS 3.5.0+.
87
-
88
70
  == Thanks
89
71
 
90
72
  * Daniel Azuma for the testing and JRuby help.
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  # -*- ruby -*-
3
4
 
@@ -7,7 +8,7 @@ require 'rake/testtask'
7
8
  require 'rdoc/task'
8
9
  require 'bundler/gem_tasks'
9
10
 
10
- $:.push File.expand_path(File.dirname(__FILE__), 'lib')
11
+ $LOAD_PATH.push File.expand_path(File.dirname(__FILE__), 'lib')
11
12
 
12
13
  version = Geos::VERSION
13
14
 
@@ -19,7 +20,7 @@ Rake::TestTask.new(:test) do |t|
19
20
  t.warning = !!ENV['WARNINGS']
20
21
  end
21
22
 
22
- task :default => :test
23
+ task default: :test
23
24
 
24
25
  begin
25
26
  desc 'Build docs'
data/ffi-geos.gemspec CHANGED
@@ -1,12 +1,14 @@
1
- # -*- encoding: utf-8 -*-
1
+ # frozen_string_literal: true
2
2
 
3
- require File.expand_path('../lib/ffi-geos/version', __FILE__)
3
+ require File.expand_path('lib/ffi-geos/version', __dir__)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'ffi-geos'
7
7
  s.version = Geos::VERSION
8
8
 
9
9
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
10
+ s.required_ruby_version = '>= 2.5'
11
+
10
12
  s.authors = ['J Smith']
11
13
  s.description = 'An ffi wrapper for GEOS, a C++ port of the Java Topology Suite (JTS).'
12
14
  s.summary = s.description
@@ -22,4 +24,7 @@ Gem::Specification.new do |s|
22
24
  s.require_paths = ['lib']
23
25
 
24
26
  s.add_dependency('ffi', ['>= 1.0.0'])
27
+ s.metadata = {
28
+ 'rubygems_mfa_required' => 'true'
29
+ }
25
30
  end
@@ -36,7 +36,7 @@ module Geos
36
36
  end
37
37
  end
38
38
 
39
- def self.release(ptr) #:nodoc:
39
+ def self.release(ptr) # :nodoc:
40
40
  FFIGeos.GEOSBufferParams_destroy_r(Geos.current_handle_pointer, ptr)
41
41
  end
42
42