ffi-geos 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop-minitest.yml +240 -0
- data/.rubocop.yml +158 -54
- data/.rubocop_todo.yml +100 -0
- data/Gemfile +2 -0
- data/MIT-LICENSE +1 -1
- data/README.rdoc +2 -0
- data/ffi-geos.gemspec +1 -1
- data/lib/ffi-geos/geojson_reader.rb +35 -0
- data/lib/ffi-geos/geojson_writer.rb +49 -0
- data/lib/ffi-geos/geometry.rb +6 -0
- data/lib/ffi-geos/geometry_collection.rb +1 -1
- data/lib/ffi-geos/line_string.rb +1 -1
- data/lib/ffi-geos/polygon.rb +1 -1
- data/lib/ffi-geos/prepared_geometry.rb +20 -0
- data/lib/ffi-geos/version.rb +1 -1
- data/lib/ffi-geos/wkb_writer.rb +12 -0
- data/lib/ffi-geos.rb +85 -1
- data/test/geojson_reader_tests.rb +170 -0
- data/test/geojson_writer_tests.rb +103 -0
- data/test/geometry_tests.rb +18 -0
- data/test/prepared_geometry_tests.rb +30 -0
- data/test/test_helper.rb +6 -0
- data/test/wkb_writer_tests.rb +20 -0
- metadata +12 -4
data/.rubocop.yml
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
|
2
|
+
inherit_from:
|
3
|
+
- .rubocop-minitest.yml
|
4
|
+
- .rubocop_todo.yml
|
5
|
+
|
6
|
+
inherit_mode:
|
7
|
+
merge:
|
8
|
+
- Exclude
|
9
|
+
|
10
|
+
require:
|
11
|
+
- rubocop-minitest
|
12
|
+
|
1
13
|
# Common configuration.
|
2
14
|
|
3
15
|
AllCops:
|
@@ -148,13 +160,7 @@ AllCops:
|
|
148
160
|
# rubocop is run. Keys are the name of the extension, and values are an array
|
149
161
|
# of gems in the Gemfile that the extension is suggested for, if not already
|
150
162
|
# included.
|
151
|
-
SuggestExtensions:
|
152
|
-
rubocop-rails: [rails]
|
153
|
-
rubocop-rspec: [rspec, rspec-rails]
|
154
|
-
rubocop-minitest: [minitest]
|
155
|
-
rubocop-sequel: [sequel]
|
156
|
-
rubocop-rake: [rake]
|
157
|
-
rubocop-graphql: [graphql]
|
163
|
+
SuggestExtensions: false
|
158
164
|
|
159
165
|
#################### Bundler ###############################
|
160
166
|
|
@@ -244,6 +250,25 @@ Gemspec/DateAssignment:
|
|
244
250
|
Include:
|
245
251
|
- '**/*.gemspec'
|
246
252
|
|
253
|
+
Gemspec/DependencyVersion:
|
254
|
+
Description: 'Requires or forbids specifying gem dependency versions.'
|
255
|
+
Enabled: false
|
256
|
+
VersionAdded: '1.29'
|
257
|
+
EnforcedStyle: 'required'
|
258
|
+
SupportedStyles:
|
259
|
+
- 'required'
|
260
|
+
- 'forbidden'
|
261
|
+
Include:
|
262
|
+
- '**/*.gemspec'
|
263
|
+
AllowedGems: []
|
264
|
+
|
265
|
+
Gemspec/DeprecatedAttributeAssignment:
|
266
|
+
Description: Checks that deprecated attribute assignments are not set in a gemspec file.
|
267
|
+
Enabled: false
|
268
|
+
VersionAdded: '1.30'
|
269
|
+
Include:
|
270
|
+
- '**/*.gemspec'
|
271
|
+
|
247
272
|
Gemspec/DuplicatedAssignment:
|
248
273
|
Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
|
249
274
|
Enabled: true
|
@@ -264,7 +289,7 @@ Gemspec/OrderedDependencies:
|
|
264
289
|
- '**/*.gemspec'
|
265
290
|
|
266
291
|
Gemspec/RequireMFA:
|
267
|
-
Description: 'Checks that the gemspec has metadata to require
|
292
|
+
Description: 'Checks that the gemspec has metadata to require Multi-Factor Authentication from RubyGems.'
|
268
293
|
Enabled: true
|
269
294
|
VersionAdded: '1.23'
|
270
295
|
Reference:
|
@@ -432,13 +457,13 @@ Layout/ClassStructure:
|
|
432
457
|
- prepend
|
433
458
|
- extend
|
434
459
|
ExpectedOrder:
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
460
|
+
- module_inclusion
|
461
|
+
- constants
|
462
|
+
- public_class_methods
|
463
|
+
- initializer
|
464
|
+
- public_methods
|
465
|
+
- protected_methods
|
466
|
+
- private_methods
|
442
467
|
|
443
468
|
Layout/ClosingHeredocIndentation:
|
444
469
|
Description: 'Checks the indentation of here document closings.'
|
@@ -885,7 +910,7 @@ Layout/HeredocArgumentClosingParenthesis:
|
|
885
910
|
VersionAdded: '0.68'
|
886
911
|
|
887
912
|
Layout/HeredocIndentation:
|
888
|
-
Description: '
|
913
|
+
Description: 'Checks the indentation of the here document bodies.'
|
889
914
|
StyleGuide: '#squiggly-heredocs'
|
890
915
|
Enabled: true
|
891
916
|
VersionAdded: '0.49'
|
@@ -918,7 +943,7 @@ Layout/IndentationStyle:
|
|
918
943
|
VersionChanged: '0.82'
|
919
944
|
# By default the indentation width from `Layout/IndentationWidth` is used,
|
920
945
|
# but it can be overridden by setting this parameter.
|
921
|
-
# It is used during
|
946
|
+
# It is used during autocorrection to determine how many spaces should
|
922
947
|
# replace each tab.
|
923
948
|
IndentationWidth: ~
|
924
949
|
EnforcedStyle: spaces
|
@@ -933,7 +958,8 @@ Layout/IndentationWidth:
|
|
933
958
|
VersionAdded: '0.49'
|
934
959
|
# Number of spaces for each indentation level.
|
935
960
|
Width: 2
|
936
|
-
|
961
|
+
AllowedPatterns: []
|
962
|
+
# IgnoredPatterns: [] # deprecated
|
937
963
|
|
938
964
|
Layout/InitialIndentation:
|
939
965
|
Description: >-
|
@@ -987,10 +1013,11 @@ Layout/LineLength:
|
|
987
1013
|
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
988
1014
|
# directives like '# rubocop: enable ...' when calculating a line's length.
|
989
1015
|
IgnoreCopDirectives: true
|
990
|
-
# The
|
1016
|
+
# The AllowedPatterns option is a list of !ruby/regexp and/or string
|
991
1017
|
# elements. Strings will be converted to Regexp objects. A line that matches
|
992
1018
|
# any regular expression listed in this option will be ignored by LineLength.
|
993
|
-
|
1019
|
+
AllowedPatterns: []
|
1020
|
+
# IgnoredPatterns: []
|
994
1021
|
|
995
1022
|
Layout/MultilineArrayBraceLayout:
|
996
1023
|
Description: >-
|
@@ -1663,7 +1690,9 @@ Lint/DuplicateRegexpCharacterClassElement:
|
|
1663
1690
|
Lint/DuplicateRequire:
|
1664
1691
|
Description: 'Check for duplicate `require`s and `require_relative`s.'
|
1665
1692
|
Enabled: true
|
1693
|
+
SafeAutoCorrect: false
|
1666
1694
|
VersionAdded: '0.90'
|
1695
|
+
VersionChanged: '1.28'
|
1667
1696
|
|
1668
1697
|
Lint/DuplicateRescueException:
|
1669
1698
|
Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
|
@@ -1682,7 +1711,7 @@ Lint/ElseLayout:
|
|
1682
1711
|
VersionChanged: '1.2'
|
1683
1712
|
|
1684
1713
|
Lint/EmptyBlock:
|
1685
|
-
Description: '
|
1714
|
+
Description: 'Checks for blocks without a body.'
|
1686
1715
|
Enabled: true
|
1687
1716
|
VersionAdded: '1.1'
|
1688
1717
|
VersionChanged: '1.15'
|
@@ -1696,7 +1725,7 @@ Lint/EmptyClass:
|
|
1696
1725
|
AllowComments: false
|
1697
1726
|
|
1698
1727
|
Lint/EmptyConditionalBody:
|
1699
|
-
Description: '
|
1728
|
+
Description: 'Checks for the presence of `if`, `elsif` and `unless` branches without a body.'
|
1700
1729
|
Enabled: true
|
1701
1730
|
AllowComments: true
|
1702
1731
|
VersionAdded: '0.89'
|
@@ -1818,12 +1847,14 @@ Lint/IneffectiveAccessModifier:
|
|
1818
1847
|
Lint/InheritException:
|
1819
1848
|
Description: 'Avoid inheriting from the `Exception` class.'
|
1820
1849
|
Enabled: true
|
1850
|
+
SafeAutoCorrect: false
|
1821
1851
|
VersionAdded: '0.41'
|
1852
|
+
VersionChanged: '1.26'
|
1822
1853
|
# The default base class in favour of `Exception`.
|
1823
|
-
EnforcedStyle:
|
1854
|
+
EnforcedStyle: standard_error
|
1824
1855
|
SupportedStyles:
|
1825
|
-
- runtime_error
|
1826
1856
|
- standard_error
|
1857
|
+
- runtime_error
|
1827
1858
|
|
1828
1859
|
Lint/InterpolationCheck:
|
1829
1860
|
Description: 'Raise warning for interpolation in single q strs.'
|
@@ -1873,8 +1904,8 @@ Lint/MissingCopEnableDirective:
|
|
1873
1904
|
|
1874
1905
|
Lint/MissingSuper:
|
1875
1906
|
Description: >-
|
1876
|
-
|
1877
|
-
without calls to `super
|
1907
|
+
Checks for the presence of constructors and lifecycle callbacks
|
1908
|
+
without calls to `super`.
|
1878
1909
|
Enabled: true
|
1879
1910
|
VersionAdded: '0.89'
|
1880
1911
|
VersionChanged: '1.4'
|
@@ -1902,7 +1933,7 @@ Lint/NestedPercentLiteral:
|
|
1902
1933
|
VersionAdded: '0.52'
|
1903
1934
|
|
1904
1935
|
Lint/NextWithoutAccumulator:
|
1905
|
-
Description:
|
1936
|
+
Description: >-
|
1906
1937
|
Do not omit the accumulator when calling `next`
|
1907
1938
|
in a `reduce`/`inject` block.
|
1908
1939
|
Enabled: true
|
@@ -2013,6 +2044,8 @@ Lint/RedundantDirGlobSort:
|
|
2013
2044
|
Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
|
2014
2045
|
Enabled: true
|
2015
2046
|
VersionAdded: '1.8'
|
2047
|
+
VersionChanged: '1.26'
|
2048
|
+
SafeAutoCorrect: false
|
2016
2049
|
|
2017
2050
|
Lint/RedundantRequireStatement:
|
2018
2051
|
Description: 'Checks for unnecessary `require` statement.'
|
@@ -2056,6 +2089,12 @@ Lint/RedundantWithObject:
|
|
2056
2089
|
Enabled: true
|
2057
2090
|
VersionAdded: '0.51'
|
2058
2091
|
|
2092
|
+
Lint/RefinementImportMethods:
|
2093
|
+
Description: 'Use `Refinement#import_methods` when using `include` or `prepend` in `refine` block.'
|
2094
|
+
Enabled: true
|
2095
|
+
SafeAutoCorrect: false
|
2096
|
+
VersionAdded: '1.27'
|
2097
|
+
|
2059
2098
|
Lint/RegexpAsCondition:
|
2060
2099
|
Description: >-
|
2061
2100
|
Do not use regexp literal as a condition.
|
@@ -2194,7 +2233,7 @@ Lint/Syntax:
|
|
2194
2233
|
VersionAdded: '0.9'
|
2195
2234
|
|
2196
2235
|
Lint/ToEnumArguments:
|
2197
|
-
Description: '
|
2236
|
+
Description: 'Ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
|
2198
2237
|
Enabled: true
|
2199
2238
|
VersionAdded: '1.1'
|
2200
2239
|
|
@@ -2204,12 +2243,12 @@ Lint/ToJSON:
|
|
2204
2243
|
VersionAdded: '0.66'
|
2205
2244
|
|
2206
2245
|
Lint/TopLevelReturnWithArgument:
|
2207
|
-
Description: '
|
2246
|
+
Description: 'Detects top level return statements with argument.'
|
2208
2247
|
Enabled: true
|
2209
2248
|
VersionAdded: '0.89'
|
2210
2249
|
|
2211
2250
|
Lint/TrailingCommaInAttributeDeclaration:
|
2212
|
-
Description: '
|
2251
|
+
Description: 'Checks for trailing commas in attribute declarations.'
|
2213
2252
|
Enabled: true
|
2214
2253
|
VersionAdded: '0.90'
|
2215
2254
|
|
@@ -2258,14 +2297,15 @@ Lint/UnreachableCode:
|
|
2258
2297
|
VersionAdded: '0.9'
|
2259
2298
|
|
2260
2299
|
Lint/UnreachableLoop:
|
2261
|
-
Description: '
|
2300
|
+
Description: 'Checks for loops that will have at most one iteration.'
|
2262
2301
|
Enabled: true
|
2263
2302
|
VersionAdded: '0.89'
|
2264
2303
|
VersionChanged: '1.7'
|
2265
|
-
|
2304
|
+
AllowedPatterns:
|
2266
2305
|
# RSpec uses `times` in its message expectations
|
2267
2306
|
# eg. `exactly(2).times`
|
2268
2307
|
- !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
|
2308
|
+
# IgnoredPatterns: [] # deprecated
|
2269
2309
|
|
2270
2310
|
Lint/UnusedBlockArgument:
|
2271
2311
|
Description: 'Checks for unused block arguments.'
|
@@ -2316,17 +2356,12 @@ Lint/UselessAssignment:
|
|
2316
2356
|
Enabled: true
|
2317
2357
|
VersionAdded: '0.11'
|
2318
2358
|
|
2319
|
-
Lint/UselessElseWithoutRescue:
|
2320
|
-
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
2321
|
-
Enabled: true
|
2322
|
-
VersionAdded: '0.17'
|
2323
|
-
|
2324
2359
|
Lint/UselessMethodDefinition:
|
2325
2360
|
Description: 'Checks for useless method definitions.'
|
2326
2361
|
Enabled: true
|
2327
2362
|
VersionAdded: '0.90'
|
2363
|
+
VersionChanged: '0.91'
|
2328
2364
|
Safe: false
|
2329
|
-
AllowComments: true
|
2330
2365
|
|
2331
2366
|
Lint/UselessRuby2Keywords:
|
2332
2367
|
Description: 'Finds unnecessary uses of `ruby2_keywords`.'
|
@@ -2491,12 +2526,14 @@ Naming/BinaryOperatorParameterName:
|
|
2491
2526
|
|
2492
2527
|
Naming/BlockForwarding:
|
2493
2528
|
Description: 'Use anonymous block forwarding.'
|
2529
|
+
StyleGuide: '#block-forwarding'
|
2494
2530
|
Enabled: true
|
2495
2531
|
VersionAdded: '1.24'
|
2496
2532
|
EnforcedStyle: anonymous
|
2497
2533
|
SupportedStyles:
|
2498
2534
|
- anonymous
|
2499
2535
|
- explicit
|
2536
|
+
BlockForwardingName: block
|
2500
2537
|
|
2501
2538
|
Naming/BlockParameterName:
|
2502
2539
|
Description: >-
|
@@ -2535,6 +2572,7 @@ Naming/FileName:
|
|
2535
2572
|
StyleGuide: '#snake-case-files'
|
2536
2573
|
Enabled: true
|
2537
2574
|
VersionAdded: '0.50'
|
2575
|
+
VersionChanged: '1.23'
|
2538
2576
|
# Camel case file names listed in `AllCops:Include` and all file names listed
|
2539
2577
|
# in `AllCops:Exclude` are excluded by default. Add extra excludes here.
|
2540
2578
|
Exclude: []
|
@@ -2675,11 +2713,12 @@ Naming/MethodName:
|
|
2675
2713
|
- camelCase
|
2676
2714
|
# Method names matching patterns are always allowed.
|
2677
2715
|
#
|
2678
|
-
#
|
2716
|
+
# AllowedPatterns:
|
2679
2717
|
# - '\A\s*onSelectionBulkChange\s*'
|
2680
2718
|
# - '\A\s*onSelectionCleared\s*'
|
2681
2719
|
#
|
2682
|
-
|
2720
|
+
AllowedPatterns: []
|
2721
|
+
# IgnoredPatterns: [] # deprecated
|
2683
2722
|
|
2684
2723
|
Naming/MethodParameterName:
|
2685
2724
|
Description: >-
|
@@ -2755,6 +2794,7 @@ Naming/VariableName:
|
|
2755
2794
|
- snake_case
|
2756
2795
|
- camelCase
|
2757
2796
|
AllowedIdentifiers: []
|
2797
|
+
AllowedPatterns: []
|
2758
2798
|
|
2759
2799
|
Naming/VariableNumber:
|
2760
2800
|
Description: 'Use the configured style when numbering symbols, methods and variables.'
|
@@ -2776,9 +2816,15 @@ Naming/VariableNumber:
|
|
2776
2816
|
- rfc822 # Time#rfc822
|
2777
2817
|
- rfc2822 # Time#rfc2822
|
2778
2818
|
- rfc3339 # DateTime.rfc3339
|
2819
|
+
AllowedPatterns: []
|
2779
2820
|
|
2780
2821
|
#################### Security ##############################
|
2781
2822
|
|
2823
|
+
Security/CompoundHash:
|
2824
|
+
Description: 'When overwriting Object#hash to combine values, prefer delegating to Array#hash over writing a custom implementation.'
|
2825
|
+
Enabled: true
|
2826
|
+
VersionAdded: '1.28'
|
2827
|
+
|
2782
2828
|
Security/Eval:
|
2783
2829
|
Description: 'The use of eval represents a serious security risk.'
|
2784
2830
|
Enabled: true
|
@@ -3078,7 +3124,7 @@ Style/CaseEquality:
|
|
3078
3124
|
AllowOnConstant: false
|
3079
3125
|
|
3080
3126
|
Style/CaseLikeIf:
|
3081
|
-
Description: '
|
3127
|
+
Description: 'Identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
3082
3128
|
StyleGuide: '#case-vs-if-else'
|
3083
3129
|
Enabled: true
|
3084
3130
|
Safe: false
|
@@ -3152,7 +3198,7 @@ Style/ClassMethodsDefinitions:
|
|
3152
3198
|
StyleGuide: '#def-self-class-methods'
|
3153
3199
|
Enabled: false
|
3154
3200
|
VersionAdded: '0.89'
|
3155
|
-
EnforcedStyle:
|
3201
|
+
EnforcedStyle: def_self
|
3156
3202
|
SupportedStyles:
|
3157
3203
|
- def_self
|
3158
3204
|
- self_class
|
@@ -3473,6 +3519,12 @@ Style/EndlessMethod:
|
|
3473
3519
|
- allow_always
|
3474
3520
|
- disallow
|
3475
3521
|
|
3522
|
+
Style/EnvHome:
|
3523
|
+
Description: "Checks for consistent usage of `ENV['HOME']`."
|
3524
|
+
Enabled: true
|
3525
|
+
Safe: false
|
3526
|
+
VersionAdded: '1.29'
|
3527
|
+
|
3476
3528
|
Style/EvalWithLocation:
|
3477
3529
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
3478
3530
|
Enabled: true
|
@@ -3510,6 +3562,16 @@ Style/ExponentialNotation:
|
|
3510
3562
|
- engineering
|
3511
3563
|
- integral
|
3512
3564
|
|
3565
|
+
Style/FetchEnvVar:
|
3566
|
+
Description: >-
|
3567
|
+
Suggests `ENV.fetch` for the replacement of `ENV[]`.
|
3568
|
+
Reference:
|
3569
|
+
- https://rubystyle.guide/#hash-fetch-defaults
|
3570
|
+
Enabled: true
|
3571
|
+
VersionAdded: '1.28'
|
3572
|
+
# Environment variables to be excluded from the inspection.
|
3573
|
+
AllowedVars: []
|
3574
|
+
|
3513
3575
|
Style/FileRead:
|
3514
3576
|
Description: 'Favor `File.(bin)read` convenience methods.'
|
3515
3577
|
StyleGuide: '#file-read'
|
@@ -3541,8 +3603,9 @@ Style/For:
|
|
3541
3603
|
Description: 'Checks use of for or each in multiline loops.'
|
3542
3604
|
StyleGuide: '#no-for-loops'
|
3543
3605
|
Enabled: true
|
3606
|
+
SafeAutoCorrect: false
|
3544
3607
|
VersionAdded: '0.13'
|
3545
|
-
VersionChanged: '
|
3608
|
+
VersionChanged: '1.26'
|
3546
3609
|
EnforcedStyle: each
|
3547
3610
|
SupportedStyles:
|
3548
3611
|
- each
|
@@ -3622,10 +3685,11 @@ Style/GuardClause:
|
|
3622
3685
|
StyleGuide: '#no-nested-conditionals'
|
3623
3686
|
Enabled: true
|
3624
3687
|
VersionAdded: '0.20'
|
3625
|
-
VersionChanged: '
|
3688
|
+
VersionChanged: '1.28'
|
3626
3689
|
# `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
|
3627
3690
|
# needs to have to trigger this cop
|
3628
3691
|
MinBodyLength: 1
|
3692
|
+
AllowConsecutiveConditionals: false
|
3629
3693
|
|
3630
3694
|
Style/HashAsLastArrayItem:
|
3631
3695
|
Description: >-
|
@@ -3698,6 +3762,8 @@ Style/HashSyntax:
|
|
3698
3762
|
- always
|
3699
3763
|
# forces use of explicit hash literal value.
|
3700
3764
|
- never
|
3765
|
+
# accepts both shorthand and explicit use of hash literal value.
|
3766
|
+
- either
|
3701
3767
|
# Force hashes that have a symbol value to use hash rockets
|
3702
3768
|
UseHashRocketsWithSymbolValues: false
|
3703
3769
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
@@ -3812,8 +3878,8 @@ Style/InverseMethods:
|
|
3812
3878
|
:>: :<=
|
3813
3879
|
# `ActiveSupport` defines some common inverse methods. They are listed below,
|
3814
3880
|
# and not enabled by default.
|
3815
|
-
|
3816
|
-
|
3881
|
+
# :present?: :blank?,
|
3882
|
+
# :include?: :exclude?
|
3817
3883
|
# `InverseBlocks` are methods that are inverted by inverting the return
|
3818
3884
|
# of the block that is passed to the method
|
3819
3885
|
InverseBlocks:
|
@@ -3874,6 +3940,11 @@ Style/LineEndConcatenation:
|
|
3874
3940
|
VersionAdded: '0.18'
|
3875
3941
|
VersionChanged: '0.64'
|
3876
3942
|
|
3943
|
+
Style/MapCompactWithConditionalBlock:
|
3944
|
+
Description: 'Prefer `select` or `reject` over `map { ... }.compact`.'
|
3945
|
+
Enabled: true
|
3946
|
+
VersionAdded: '1.30'
|
3947
|
+
|
3877
3948
|
Style/MapToHash:
|
3878
3949
|
Description: 'Prefer `to_h` with a block over `map.to_h`.'
|
3879
3950
|
Enabled: true
|
@@ -3888,7 +3959,8 @@ Style/MethodCallWithArgsParentheses:
|
|
3888
3959
|
VersionChanged: '1.7'
|
3889
3960
|
IgnoreMacros: true
|
3890
3961
|
IgnoredMethods: []
|
3891
|
-
|
3962
|
+
AllowedPatterns: []
|
3963
|
+
# IgnoredPatterns: [] # deprecated
|
3892
3964
|
IncludedMacros: []
|
3893
3965
|
AllowParenthesesInMultilineCall: false
|
3894
3966
|
AllowParenthesesInChaining: false
|
@@ -4094,7 +4166,7 @@ Style/NegatedIf:
|
|
4094
4166
|
|
4095
4167
|
Style/NegatedIfElseCondition:
|
4096
4168
|
Description: >-
|
4097
|
-
|
4169
|
+
Checks for uses of `if-else` and ternary operators with a negated condition
|
4098
4170
|
which can be simplified by inverting condition and swapping branches.
|
4099
4171
|
Enabled: true
|
4100
4172
|
VersionAdded: '1.2'
|
@@ -4119,6 +4191,11 @@ Style/NegatedWhile:
|
|
4119
4191
|
Enabled: true
|
4120
4192
|
VersionAdded: '0.20'
|
4121
4193
|
|
4194
|
+
Style/NestedFileDirname:
|
4195
|
+
Description: 'Checks for nested `File.dirname`.'
|
4196
|
+
Enabled: true
|
4197
|
+
VersionAdded: '1.26'
|
4198
|
+
|
4122
4199
|
Style/NestedModifier:
|
4123
4200
|
Description: 'Avoid using nested modifiers.'
|
4124
4201
|
StyleGuide: '#no-nested-modifiers'
|
@@ -4274,6 +4351,19 @@ Style/NumericPredicate:
|
|
4274
4351
|
Exclude:
|
4275
4352
|
- 'spec/**/*'
|
4276
4353
|
|
4354
|
+
Style/ObjectThen:
|
4355
|
+
Description: 'Enforces the use of consistent method names `Object#yield_self` or `Object#then`.'
|
4356
|
+
StyleGuide: '#object-yield-self-vs-object-then'
|
4357
|
+
Enabled: true
|
4358
|
+
VersionAdded: '1.28'
|
4359
|
+
# Use `Object#yield_self` or `Object#then`?
|
4360
|
+
# Prefer `Object#yield_self` to `Object#then` (yield_self)
|
4361
|
+
# Prefer `Object#then` to `Object#yield_self` (then)
|
4362
|
+
EnforcedStyle: 'then'
|
4363
|
+
SupportedStyles:
|
4364
|
+
- then
|
4365
|
+
- yield_self
|
4366
|
+
|
4277
4367
|
Style/OneLineConditional:
|
4278
4368
|
Description: >-
|
4279
4369
|
Favor the ternary operator (?:) or multi-line constructs over
|
@@ -4515,10 +4605,20 @@ Style/RedundantFreeze:
|
|
4515
4605
|
VersionAdded: '0.34'
|
4516
4606
|
VersionChanged: '0.66'
|
4517
4607
|
|
4608
|
+
Style/RedundantInitialize:
|
4609
|
+
Description: 'Checks for redundant `initialize` methods.'
|
4610
|
+
Enabled: true
|
4611
|
+
Safe: false
|
4612
|
+
AllowComments: true
|
4613
|
+
VersionAdded: '1.27'
|
4614
|
+
VersionChanged: '1.28'
|
4615
|
+
|
4518
4616
|
Style/RedundantInterpolation:
|
4519
4617
|
Description: 'Checks for strings that are just an interpolated expression.'
|
4520
4618
|
Enabled: true
|
4619
|
+
SafeAutoCorrect: false
|
4521
4620
|
VersionAdded: '0.76'
|
4621
|
+
VersionChanged: '1.30'
|
4522
4622
|
|
4523
4623
|
Style/RedundantParentheses:
|
4524
4624
|
Description: "Checks for parentheses that seem not to serve any purpose."
|
@@ -4629,14 +4729,14 @@ Style/ReturnNil:
|
|
4629
4729
|
|
4630
4730
|
Style/SafeNavigation:
|
4631
4731
|
Description: >-
|
4632
|
-
|
4732
|
+
Transforms usages of a method call safeguarded by
|
4633
4733
|
a check for the existence of the object to
|
4634
4734
|
safe navigation (`&.`).
|
4635
|
-
|
4735
|
+
Autocorrection is unsafe as it assumes the object will
|
4636
4736
|
be `nil` or truthy, but never `false`.
|
4637
4737
|
Enabled: true
|
4638
4738
|
VersionAdded: '0.43'
|
4639
|
-
VersionChanged: '
|
4739
|
+
VersionChanged: '1.27'
|
4640
4740
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
4641
4741
|
# to whatever it used to return.
|
4642
4742
|
ConvertCodeThatCanStartToReturnNil: false
|
@@ -4647,6 +4747,8 @@ Style/SafeNavigation:
|
|
4647
4747
|
- try
|
4648
4748
|
- try!
|
4649
4749
|
SafeAutoCorrect: false
|
4750
|
+
# Maximum length of method chains for register an offense.
|
4751
|
+
MaxChainLength: 2
|
4650
4752
|
|
4651
4753
|
Style/Sample:
|
4652
4754
|
Description: >-
|
@@ -4752,6 +4854,7 @@ Style/SpecialGlobalVars:
|
|
4752
4854
|
SupportedStyles:
|
4753
4855
|
- use_perl_names
|
4754
4856
|
- use_english_names
|
4857
|
+
- use_builtin_english_names
|
4755
4858
|
|
4756
4859
|
Style/StabbyLambdaParentheses:
|
4757
4860
|
Description: 'Check for the usage of parentheses around stabby lambda arguments.'
|
@@ -4853,7 +4956,7 @@ Style/StructInheritance:
|
|
4853
4956
|
VersionChanged: '1.20'
|
4854
4957
|
|
4855
4958
|
Style/SwapValues:
|
4856
|
-
Description: '
|
4959
|
+
Description: 'Enforces the use of shorthand-style swapping of 2 variables.'
|
4857
4960
|
StyleGuide: '#values-swapping'
|
4858
4961
|
Enabled: true
|
4859
4962
|
VersionAdded: '1.1'
|
@@ -4881,13 +4984,14 @@ Style/SymbolProc:
|
|
4881
4984
|
Enabled: true
|
4882
4985
|
Safe: false
|
4883
4986
|
VersionAdded: '0.26'
|
4884
|
-
VersionChanged: '1.
|
4987
|
+
VersionChanged: '1.28'
|
4885
4988
|
AllowMethodsWithArguments: false
|
4886
4989
|
# A list of method names to be ignored by the check.
|
4887
4990
|
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
4888
4991
|
IgnoredMethods:
|
4889
4992
|
- respond_to
|
4890
4993
|
- define_method
|
4994
|
+
AllowComments: false
|
4891
4995
|
|
4892
4996
|
Style/TernaryParentheses:
|
4893
4997
|
Description: 'Checks for use of parentheses around ternary conditions.'
|
@@ -4902,7 +5006,7 @@ Style/TernaryParentheses:
|
|
4902
5006
|
AllowSafeAssignment: true
|
4903
5007
|
|
4904
5008
|
Style/TopLevelMethodDefinition:
|
4905
|
-
Description: '
|
5009
|
+
Description: 'Looks for top-level method definitions.'
|
4906
5010
|
StyleGuide: '#top-level-methods'
|
4907
5011
|
Enabled: false
|
4908
5012
|
VersionAdded: '1.15'
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 10000`
|
3
|
+
# on 2022-06-13 13:21:07 UTC using RuboCop version 1.30.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
11
|
+
Exclude:
|
12
|
+
- 'test/geometry_tests.rb'
|
13
|
+
|
14
|
+
# Offense count: 6
|
15
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
|
16
|
+
Metrics/AbcSize:
|
17
|
+
Exclude:
|
18
|
+
- 'lib/ffi-geos/coordinate_sequence.rb'
|
19
|
+
- 'lib/ffi-geos/line_string.rb'
|
20
|
+
- 'lib/ffi-geos/utils.rb'
|
21
|
+
- 'test/geometry_tests.rb'
|
22
|
+
|
23
|
+
# Offense count: 2
|
24
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
25
|
+
Metrics/ClassLength:
|
26
|
+
Exclude:
|
27
|
+
- 'lib/ffi-geos/coordinate_sequence.rb'
|
28
|
+
- 'lib/ffi-geos/geometry.rb'
|
29
|
+
|
30
|
+
# Offense count: 3
|
31
|
+
# Configuration parameters: IgnoredMethods, Max.
|
32
|
+
Metrics/CyclomaticComplexity:
|
33
|
+
Exclude:
|
34
|
+
- 'lib/ffi-geos/coordinate_sequence.rb'
|
35
|
+
- 'lib/ffi-geos/tools.rb'
|
36
|
+
|
37
|
+
# Offense count: 1
|
38
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
39
|
+
Metrics/ModuleLength:
|
40
|
+
Exclude:
|
41
|
+
- 'lib/ffi-geos.rb'
|
42
|
+
|
43
|
+
# Offense count: 1
|
44
|
+
# Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters.
|
45
|
+
Metrics/ParameterLists:
|
46
|
+
Exclude:
|
47
|
+
- 'lib/ffi-geos/utils.rb'
|
48
|
+
|
49
|
+
# Offense count: 4
|
50
|
+
# Configuration parameters: IgnoredMethods, Max.
|
51
|
+
Metrics/PerceivedComplexity:
|
52
|
+
Exclude:
|
53
|
+
- 'lib/ffi-geos/coordinate_sequence.rb'
|
54
|
+
- 'lib/ffi-geos/tools.rb'
|
55
|
+
- 'test/geometry_tests.rb'
|
56
|
+
|
57
|
+
# Offense count: 9
|
58
|
+
Naming/AccessorMethodName:
|
59
|
+
Exclude:
|
60
|
+
- 'lib/ffi-geos/geojson_writer.rb'
|
61
|
+
- 'lib/ffi-geos/point.rb'
|
62
|
+
- 'lib/ffi-geos/wkb_writer.rb'
|
63
|
+
- 'lib/ffi-geos/wkt_writer.rb'
|
64
|
+
|
65
|
+
# Offense count: 1
|
66
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
67
|
+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
68
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
69
|
+
Naming/FileName:
|
70
|
+
Exclude:
|
71
|
+
- 'lib/ffi-geos.rb'
|
72
|
+
|
73
|
+
# Offense count: 2
|
74
|
+
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
|
75
|
+
# NamePrefix: is_, has_, have_
|
76
|
+
# ForbiddenPrefixes: is_, has_, have_
|
77
|
+
# AllowedMethods: is_a?
|
78
|
+
# MethodDefinitionMacros: define_method, define_singleton_method
|
79
|
+
Naming/PredicateName:
|
80
|
+
Exclude:
|
81
|
+
- 'lib/ffi-geos/coordinate_sequence.rb'
|
82
|
+
- 'lib/ffi-geos/geometry.rb'
|
83
|
+
|
84
|
+
# Offense count: 2
|
85
|
+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
|
86
|
+
# SupportedStyles: snake_case, normalcase, non_integer
|
87
|
+
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
|
88
|
+
Naming/VariableNumber:
|
89
|
+
Exclude:
|
90
|
+
- 'lib/ffi-geos.rb'
|
91
|
+
- 'lib/ffi-geos/geometry.rb'
|
92
|
+
|
93
|
+
# Offense count: 4
|
94
|
+
# Configuration parameters: AllowedMethods.
|
95
|
+
# AllowedMethods: respond_to_missing?
|
96
|
+
Style/OptionalBooleanParameter:
|
97
|
+
Exclude:
|
98
|
+
- 'lib/ffi-geos/geometry.rb'
|
99
|
+
- 'test/wkb_reader_tests.rb'
|
100
|
+
- 'test/wkb_writer_tests.rb'
|
data/Gemfile
CHANGED
@@ -11,6 +11,8 @@ gem 'minitest-reporters'
|
|
11
11
|
gem 'rake'
|
12
12
|
gem 'rdoc'
|
13
13
|
gem 'rubocop', require: false
|
14
|
+
gem 'rubocop-minitest', require: false
|
14
15
|
gem 'simplecov', require: false
|
16
|
+
gem 'simplecov_json_formatter', require: false
|
15
17
|
|
16
18
|
instance_eval File.read('Gemfile.local') if File.exist?('Gemfile.local')
|
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -54,6 +54,8 @@ Ruby bindings along with the following enhancements and additions:
|
|
54
54
|
GEOS library and perform other work or cancel GEOS calls outright. The
|
55
55
|
interruption API was added in GEOS 3.4.0.
|
56
56
|
|
57
|
+
* Geos::GeoJSONReader and Geos::GeoJSONWriter support on GEOS 3.10+.
|
58
|
+
|
57
59
|
== New Methods and Additions (not exhaustive)
|
58
60
|
|
59
61
|
* SRIDs can be copied on many operations. GEOS doesn't usually copy SRIDs
|