ffi-geos 2.2.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +49 -0
  3. data/.rubocop-minitest.yml +240 -0
  4. data/.rubocop.yml +497 -111
  5. data/.rubocop_todo.yml +100 -0
  6. data/Gemfile +3 -6
  7. data/MIT-LICENSE +1 -1
  8. data/README.rdoc +2 -0
  9. data/ffi-geos.gemspec +5 -0
  10. data/lib/ffi-geos/buffer_params.rb +1 -1
  11. data/lib/ffi-geos/coordinate_sequence.rb +32 -32
  12. data/lib/ffi-geos/geojson_reader.rb +35 -0
  13. data/lib/ffi-geos/geojson_writer.rb +49 -0
  14. data/lib/ffi-geos/geometry.rb +11 -5
  15. data/lib/ffi-geos/geometry_collection.rb +5 -5
  16. data/lib/ffi-geos/line_string.rb +11 -11
  17. data/lib/ffi-geos/multi_line_string.rb +1 -1
  18. data/lib/ffi-geos/point.rb +4 -4
  19. data/lib/ffi-geos/polygon.rb +5 -5
  20. data/lib/ffi-geos/prepared_geometry.rb +21 -1
  21. data/lib/ffi-geos/strtree.rb +1 -1
  22. data/lib/ffi-geos/version.rb +1 -1
  23. data/lib/ffi-geos/wkb_reader.rb +1 -1
  24. data/lib/ffi-geos/wkb_writer.rb +14 -2
  25. data/lib/ffi-geos/wkt_reader.rb +1 -1
  26. data/lib/ffi-geos/wkt_writer.rb +2 -2
  27. data/lib/ffi-geos.rb +92 -4
  28. data/sonar-project.properties +4 -4
  29. data/test/coordinate_sequence_tests.rb +6 -6
  30. data/test/geojson_reader_tests.rb +170 -0
  31. data/test/geojson_writer_tests.rb +103 -0
  32. data/test/geometry_collection_tests.rb +4 -4
  33. data/test/geometry_tests.rb +75 -32
  34. data/test/line_string_tests.rb +13 -5
  35. data/test/point_tests.rb +3 -3
  36. data/test/polygon_tests.rb +3 -3
  37. data/test/prepared_geometry_tests.rb +30 -0
  38. data/test/strtree_tests.rb +8 -8
  39. data/test/test_helper.rb +43 -12
  40. data/test/wkb_writer_tests.rb +20 -0
  41. metadata +15 -6
  42. data/.travis.yml +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad455c6601540ad458633400a3d4b55722b5dff1415514e3cece263b29e79984
4
- data.tar.gz: 5f4e7646fb59267100418c6c4d6f2478f1dc9f6f8b49ac5d04fb0cf5b960a4b3
3
+ metadata.gz: 6b2dd7e2272fe9d6c29683aae6ff52d98846d288a8507884d38653468e87dd2e
4
+ data.tar.gz: 693c29be228d24f4be3b2ae0a7f71ef1f2757e9b1ae900f45cdff6686127b0c2
5
5
  SHA512:
6
- metadata.gz: 90248b57a990f2ffdaae1fab6bcf0a8ff4a0e2616642ee3bd93eca9307a1c2a833d738b1dd4a62a16ea4421f14e221fa19b0e1299de596bbb6876fdcbae44c61
7
- data.tar.gz: db4b787c80d3274530da0a396bf3ad39affc1f7881cb715e019d4333db45bca5ff01ec4bb5052038f049e1456ef389ab972bf9116aebc6004f8f1dc0b208b965
6
+ metadata.gz: 5e1eeaa9c89a1b7f8da8a7b2e753ff297138bc36821d068dc57428ab34e7b2592fd4b020e287b5091ad28c524639911296c38483723a5ed84b8f5cefe3e49e14
7
+ data.tar.gz: d25319769baf08025584885d928fedc0323b9e9e192dac6c96f863e7d7bbbd4a8905eb939cfb1ae180c23e2dd2d9d69467b16f6af6873d7f079901f7e61115d6
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: FFI Geos
3
+ 'on':
4
+ push:
5
+ branches:
6
+ - master
7
+ - github-actions
8
+ pull_request:
9
+ jobs:
10
+ tests:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby: [ '2.6', '2.7', '3.0', '3.1' ]
15
+ name: Ruby ${{ matrix.ruby }} tests
16
+ steps:
17
+ - name: Check out app
18
+ uses: actions/checkout@v2
19
+ with:
20
+ fetch-depth: 0
21
+ - name: Set up apt packages
22
+ run: sudo apt-get -yqq install libgeos-dev
23
+ - name: Set up Ruby
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: ${{ matrix.ruby }}
27
+ - name: Bundle install
28
+ run: |-
29
+ gem update --system
30
+ bundle install --path=.bundle --jobs 2 --retry 3
31
+ - name: Run Tests
32
+ env:
33
+ COVERAGE: 'true'
34
+ CI: 'true'
35
+ run: bundle exec rake test
36
+ - name: Fix coverage report
37
+ if: always()
38
+ run: sed -i "s/\/home\/runner\/work\/ffi-geos\/ffi-geos\//\/github\/workspace\//g" coverage/coverage.json || true
39
+ - name: Run rubocop
40
+ if: always()
41
+ env:
42
+ RAILS_ENV: test
43
+ run: bundle exec rubocop --parallel --format=json > rubocop-report.json || true
44
+ - name: Run SonarCloud
45
+ if: always()
46
+ uses: sonarsource/sonarcloud-github-action@master
47
+ env:
48
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
49
+ SONAR_TOKEN: "${{ secrets.SONAR_CLOUD_TOKEN }}"
@@ -0,0 +1,240 @@
1
+ Minitest:
2
+ Enabled: true
3
+ Include:
4
+ - '**/test/**/*'
5
+ - '**/*_test.rb'
6
+
7
+ Minitest/AssertEmpty:
8
+ Description: 'This cop enforces the test to use `assert_empty` instead of using `assert(object.empty?)`.'
9
+ StyleGuide: 'https://minitest.rubystyle.guide#assert-empty'
10
+ Enabled: true
11
+ VersionAdded: '0.2'
12
+
13
+ Minitest/AssertEmptyLiteral:
14
+ Description: 'This cop enforces the test to use `assert_empty` instead of using `assert_equal([], object)`.'
15
+ Enabled: true
16
+ VersionAdded: '0.5'
17
+ VersionChanged: '0.11'
18
+
19
+ Minitest/AssertEqual:
20
+ Description: 'This cop enforces the test to use `assert_equal` instead of using `assert(expected == actual)`.'
21
+ StyleGuide: 'https://minitest.rubystyle.guide#assert-equal-arguments-order'
22
+ Enabled: true
23
+ VersionAdded: '0.4'
24
+
25
+ Minitest/AssertInDelta:
26
+ Description: 'This cop enforces the test to use `assert_in_delta` instead of using `assert_equal` to compare floats.'
27
+ StyleGuide: 'https://minitest.rubystyle.guide/#assert-in-delta'
28
+ Enabled: true
29
+ VersionAdded: '0.10'
30
+
31
+ Minitest/AssertIncludes:
32
+ Description: 'This cop enforces the test to use `assert_includes` instead of using `assert(collection.include?(object))`.'
33
+ StyleGuide: 'https://minitest.rubystyle.guide#assert-includes'
34
+ Enabled: true
35
+ VersionAdded: '0.2'
36
+
37
+ Minitest/AssertInstanceOf:
38
+ Description: 'This cop enforces the test to use `assert_instance_of(Class, object)` over `assert(object.instance_of?(Class))`'
39
+ StyleGuide: 'https://minitest.rubystyle.guide#assert-instance-of'
40
+ Enabled: true
41
+ VersionAdded: '0.4'
42
+
43
+ Minitest/AssertKindOf:
44
+ Description: 'This cop enforces the test to use `assert_kind_of(Class, object)` over `assert(object.kind_of?(Class))`'
45
+ StyleGuide: 'https://github.com/rubocop/minitest-style-guide#assert-kind-of'
46
+ Enabled: true
47
+ VersionAdded: '0.10'
48
+
49
+ Minitest/AssertMatch:
50
+ Description: 'This cop enforces the test to use `assert_match` instead of using `assert(matcher.match(object))`.'
51
+ StyleGuide: 'https://minitest.rubystyle.guide#assert-match'
52
+ Enabled: true
53
+ VersionAdded: '0.6'
54
+
55
+ Minitest/AssertNil:
56
+ Description: 'This cop enforces the test to use `assert_nil` instead of using `assert_equal(nil, something)` or `assert(something.nil?)`.'
57
+ StyleGuide: 'https://minitest.rubystyle.guide#assert-nil'
58
+ Enabled: true
59
+ VersionAdded: '0.1'
60
+
61
+ Minitest/AssertOutput:
62
+ Description: 'This cop checks for opportunities to use `assert_output`.'
63
+ StyleGuide: 'https://minitest.rubystyle.guide/#assert-output'
64
+ Enabled: true
65
+ VersionAdded: '0.10'
66
+
67
+ Minitest/AssertPathExists:
68
+ Description: 'This cop enforces the test to use `assert_path_exists` instead of using `assert(File.exist?(path))`.'
69
+ StyleGuide: 'https://minitest.rubystyle.guide/#assert-path-exists'
70
+ Enabled: true
71
+ VersionAdded: '0.10'
72
+
73
+ Minitest/AssertPredicate:
74
+ Description: 'This cop enforces the test to use `assert_predicate` instead of using `assert(obj.a_predicate_method?)`.'
75
+ StyleGuide: 'https://minitest.rubystyle.guide/#assert-predicate'
76
+ Enabled: true
77
+ VersionAdded: '0.18'
78
+
79
+ Minitest/AssertRespondTo:
80
+ Description: 'This cop enforces the test to use `assert_respond_to(object, :do_something)` over `assert(object.respond_to?(:do_something))`.'
81
+ StyleGuide: 'https://minitest.rubystyle.guide#assert-responds-to-method'
82
+ Enabled: true
83
+ VersionAdded: '0.3'
84
+
85
+ Minitest/AssertSilent:
86
+ Description: "This cop enforces the test to use `assert_silent { ... }` instead of using `assert_output('', '') { ... }`."
87
+ StyleGuide: 'https://github.com/rubocop/minitest-style-guide#assert-silent'
88
+ Enabled: true
89
+ VersionAdded: '0.10'
90
+
91
+ Minitest/AssertTruthy:
92
+ Description: 'This cop enforces the test to use `assert(actual)` instead of using `assert_equal(true, actual)`.'
93
+ StyleGuide: 'https://minitest.rubystyle.guide#assert-truthy'
94
+ Enabled: true
95
+ VersionAdded: '0.2'
96
+
97
+ Minitest/AssertWithExpectedArgument:
98
+ Description: 'This cop tries to detect when a user accidentally used `assert` when they meant to use `assert_equal`.'
99
+ Enabled: true
100
+ Safe: false
101
+ VersionAdded: '0.11'
102
+
103
+ Minitest/AssertionInLifecycleHook:
104
+ Description: 'This cop checks for usage of assertions in lifecycle hooks.'
105
+ Enabled: true
106
+ VersionAdded: '0.10'
107
+
108
+ Minitest/DuplicateTestRun:
109
+ Description: 'This cop detects duplicate test runs caused by one test class inheriting from another.'
110
+ StyleGuide: 'https://minitest.rubystyle.guide/#subclassing-test-cases'
111
+ Enabled: true
112
+ VersionAdded: '0.19'
113
+
114
+ Minitest/GlobalExpectations:
115
+ Description: 'This cop checks for deprecated global expectations.'
116
+ StyleGuide: 'https://minitest.rubystyle.guide#global-expectations'
117
+ Enabled: true
118
+ EnforcedStyle: any
119
+ Include:
120
+ - '**/test/**/*'
121
+ - '**/*_test.rb'
122
+ - '**/spec/**/*'
123
+ - '**/*_spec.rb'
124
+ SupportedStyles:
125
+ - _
126
+ - any
127
+ - expect
128
+ - value
129
+ VersionAdded: '0.7'
130
+ VersionChanged: '0.16'
131
+
132
+ Minitest/LiteralAsActualArgument:
133
+ Description: 'This cop enforces correct order of `expected` and `actual` arguments for `assert_equal`.'
134
+ StyleGuide: 'https://minitest.rubystyle.guide/#assert-equal-arguments-order'
135
+ Enabled: true
136
+ VersionAdded: '0.10'
137
+
138
+ Minitest/MultipleAssertions:
139
+ Description: 'This cop checks if test cases contain too many assertion calls.'
140
+ Enabled: true
141
+ VersionAdded: '0.10'
142
+ Max: 3
143
+
144
+ Minitest/NoAssertions:
145
+ Description: 'This cop checks for at least one assertion (or flunk) in tests.'
146
+ Enabled: false
147
+ VersionAdded: '0.12'
148
+
149
+ Minitest/RefuteEmpty:
150
+ Description: 'This cop enforces to use `refute_empty` instead of using `refute(object.empty?)`.'
151
+ StyleGuide: 'https://minitest.rubystyle.guide#refute-empty'
152
+ Enabled: true
153
+ VersionAdded: '0.3'
154
+
155
+ Minitest/RefuteEqual:
156
+ Description: 'Check if your test uses `refute_equal` instead of `assert(expected != object)` or `assert(! expected == object))`.'
157
+ StyleGuide: 'https://minitest.rubystyle.guide#refute-equal'
158
+ Enabled: true
159
+ VersionAdded: '0.3'
160
+
161
+ Minitest/RefuteFalse:
162
+ Description: 'Check if your test uses `refute(actual)` instead of `assert_equal(false, actual)`.'
163
+ StyleGuide: 'https://minitest.rubystyle.guide#refute-false'
164
+ Enabled: true
165
+ VersionAdded: '0.3'
166
+
167
+ Minitest/RefuteInDelta:
168
+ Description: 'This cop enforces the test to use `refute_in_delta` instead of using `refute_equal` to compare floats.'
169
+ StyleGuide: 'https://minitest.rubystyle.guide/#refute-in-delta'
170
+ Enabled: true
171
+ VersionAdded: '0.10'
172
+
173
+ Minitest/RefuteIncludes:
174
+ Description: 'This cop enforces the test to use `refute_includes` instead of using `refute(collection.include?(object))`.'
175
+ StyleGuide: 'https://minitest.rubystyle.guide#refute-includes'
176
+ Enabled: true
177
+ VersionAdded: '0.3'
178
+
179
+ Minitest/RefuteInstanceOf:
180
+ Description: 'This cop enforces the test to use `refute_instance_of(Class, object)` over `refute(object.instance_of?(Class))`.'
181
+ StyleGuide: 'https://minitest.rubystyle.guide#refute-instance-of'
182
+ Enabled: true
183
+ VersionAdded: '0.4'
184
+
185
+ Minitest/RefuteKindOf:
186
+ Description: 'This cop enforces the test to use `refute_kind_of(Class, object)` over `refute(object.kind_of?(Class))`.'
187
+ StyleGuide: 'https://github.com/rubocop/minitest-style-guide#refute-kind-of'
188
+ Enabled: true
189
+ VersionAdded: '0.10'
190
+
191
+ Minitest/RefuteMatch:
192
+ Description: 'This cop enforces the test to use `refute_match` instead of using `refute(matcher.match(object))`.'
193
+ StyleGuide: 'https://minitest.rubystyle.guide#refute-match'
194
+ Enabled: true
195
+ VersionAdded: '0.6'
196
+
197
+ Minitest/RefuteNil:
198
+ Description: 'This cop enforces the test to use `refute_nil` instead of using `refute_equal(nil, something)` or `refute(something.nil?)`.'
199
+ StyleGuide: 'https://minitest.rubystyle.guide#refute-nil'
200
+ Enabled: true
201
+ VersionAdded: '0.2'
202
+
203
+ Minitest/RefutePathExists:
204
+ Description: 'This cop enforces the test to use `refute_path_exists` instead of using `refute(File.exist?(path))`.'
205
+ StyleGuide: 'https://minitest.rubystyle.guide/#refute-path-exists'
206
+ Enabled: true
207
+ VersionAdded: '0.10'
208
+
209
+ Minitest/RefutePredicate:
210
+ Description: 'This cop enforces the test to use `refute_predicate` instead of using `refute(obj.a_predicate_method?)`.'
211
+ StyleGuide: 'https://minitest.rubystyle.guide/#refute-predicate'
212
+ Enabled: true
213
+ VersionAdded: '0.18'
214
+
215
+ Minitest/RefuteRespondTo:
216
+ Description: 'This cop enforces the test to use `refute_respond_to(object, :do_something)` over `refute(object.respond_to?(:do_something))`.'
217
+ StyleGuide: 'https://minitest.rubystyle.guide#refute-respond-to'
218
+ Enabled: true
219
+ VersionAdded: '0.4'
220
+
221
+ Minitest/SkipEnsure:
222
+ Description: 'Checks that `ensure` call even if `skip`.'
223
+ Enabled: true
224
+ VersionAdded: '0.20'
225
+
226
+ Minitest/TestMethodName:
227
+ Description: 'This cop enforces that test method names start with `test_` prefix.'
228
+ Enabled: true
229
+ VersionAdded: '0.10'
230
+
231
+ Minitest/UnreachableAssertion:
232
+ Description: 'This cop checks for an `assert_raises` block containing any unreachable assertions.'
233
+ Enabled: true
234
+ VersionAdded: '0.14'
235
+
236
+ Minitest/UnspecifiedException:
237
+ Description: 'This cop checks for a specified error in `assert_raises`.'
238
+ StyleGuide: 'https://minitest.rubystyle.guide#unspecified-exception'
239
+ Enabled: true
240
+ VersionAdded: '0.10'