h3 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f0745c482f3ba67da0350bde8aeb48c91279d371a2f3f8edd9edc316093cdd72
4
+ data.tar.gz: f2b8ecf1b04bd8e329bd7d66c8300fc887e9cd3a1d73fd7e2691f2b15fc8ca08
5
+ SHA512:
6
+ metadata.gz: e82fa791a4d8daa83f62cc121ed5dee0662ae07b72fb8c0088925b4721452ce668e08251afad20e2d125838a421b42a75ceb7f2e95226feb37a21c5d95461d31
7
+ data.tar.gz: ff89b10a0736a61aa791242e7e17f4b0395e098a8631e605be8de7076d174b81b9a4ee877baf1236ab2aedf2409d692c0cc59b5064db96d7948faa53aafd25b1
@@ -0,0 +1,19 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
4
+ config: '.rubocop.yml'
5
+ channel: rubocop-0-52
6
+ checks:
7
+ Rubocop/Style/ClassAndModuleChildren:
8
+ enabled: false
9
+ duplication:
10
+ enabled: true
11
+ config:
12
+ languages:
13
+ ruby:
14
+ mass_threshold: 75
15
+ ratings:
16
+ paths:
17
+ - lib/**
18
+ - spec/**/*.rb
19
+ - "**.rb"
@@ -0,0 +1,3 @@
1
+ spec/examples.txt
2
+ .yardoc
3
+ *.gem
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
@@ -0,0 +1,255 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4.5
3
+ Exclude:
4
+ - "vendor/**/*"
5
+ - "db/schema.rb"
6
+ UseCache: false
7
+ Rails:
8
+ Enabled: true
9
+ Style/CollectionMethods:
10
+ Description: Preferred collection methods.
11
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
12
+ Enabled: true
13
+ PreferredMethods:
14
+ collect: map
15
+ collect!: map!
16
+ find: detect
17
+ find_all: select
18
+ reduce: inject
19
+ Style/FormatStringToken:
20
+ Description: Format string tokens
21
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#named-format-tokens
22
+ Enabled: false
23
+ Layout/DotPosition:
24
+ Description: Checks the position of the dot in multi-line method calls.
25
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
26
+ Enabled: true
27
+ EnforcedStyle: trailing
28
+ SupportedStyles:
29
+ - leading
30
+ - trailing
31
+ Naming/FileName:
32
+ Description: Use snake_case for source file names.
33
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
34
+ Enabled: false
35
+ Exclude: []
36
+ Style/GuardClause:
37
+ Description: Check for conditionals that can be replaced with guard clauses
38
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
39
+ Enabled: false
40
+ MinBodyLength: 1
41
+ Style/IfUnlessModifier:
42
+ Description: Favor modifier if/unless usage when you have a single-line body.
43
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
44
+ Enabled: false
45
+ Style/OptionHash:
46
+ Description: Don't use option hashes when you can use keyword arguments.
47
+ Enabled: false
48
+ Style/PercentLiteralDelimiters:
49
+ Description: Use `%`-literal delimiters consistently
50
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
51
+ Enabled: true
52
+ Naming/PredicateName:
53
+ Description: Check the names of predicate methods.
54
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
55
+ Enabled: true
56
+ NamePrefix:
57
+ - is_
58
+ - has_
59
+ - have_
60
+ NamePrefixBlacklist:
61
+ - is_
62
+ Exclude:
63
+ - spec/**/*
64
+ Style/RaiseArgs:
65
+ Description: Checks the arguments passed to raise/fail.
66
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
67
+ Enabled: false
68
+ EnforcedStyle: exploded
69
+ SupportedStyles:
70
+ - compact
71
+ - exploded
72
+ Style/SignalException:
73
+ Description: Checks for proper usage of fail and raise.
74
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
75
+ Enabled: false
76
+ EnforcedStyle: semantic
77
+ SupportedStyles:
78
+ - only_raise
79
+ - only_fail
80
+ - semantic
81
+ Style/SingleLineBlockParams:
82
+ Description: Enforces the names of some block params.
83
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
84
+ Enabled: false
85
+ Methods:
86
+ - reduce:
87
+ - a
88
+ - e
89
+ - inject:
90
+ - a
91
+ - e
92
+ Style/SingleLineMethods:
93
+ Description: Avoid single-line methods.
94
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
95
+ Enabled: false
96
+ AllowIfMethodIsEmpty: true
97
+ Style/StringLiterals:
98
+ Description: Checks if uses of quotes match the configured preference.
99
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
100
+ Enabled: true
101
+ EnforcedStyle: double_quotes
102
+ SupportedStyles:
103
+ - single_quotes
104
+ - double_quotes
105
+ Style/StringLiteralsInInterpolation:
106
+ Description: Checks if uses of quotes inside expressions in interpolated strings
107
+ match the configured preference.
108
+ Enabled: true
109
+ EnforcedStyle: single_quotes
110
+ SupportedStyles:
111
+ - single_quotes
112
+ - double_quotes
113
+ Metrics/BlockLength:
114
+ Enabled: false
115
+ Metrics/AbcSize:
116
+ Description: A calculated magnitude based on number of assignments, branches, and
117
+ conditions.
118
+ Enabled: false
119
+ Max: 15
120
+ Metrics/ClassLength:
121
+ Description: Avoid classes longer than 100 lines of code.
122
+ Enabled: false
123
+ CountComments: false
124
+ Max: 100
125
+ Metrics/LineLength:
126
+ Max: 100
127
+ # To make it possible to copy or click on URIs in the code, we allow lines
128
+ # containing a URI to be longer than Max.
129
+ AllowHeredoc: true
130
+ AllowURI: true
131
+ URISchemes:
132
+ - http
133
+ - https
134
+ Metrics/ModuleLength:
135
+ CountComments: false
136
+ Max: 100
137
+ Description: Avoid modules longer than 100 lines of code.
138
+ Enabled: false
139
+ Metrics/CyclomaticComplexity:
140
+ Description: A complexity metric that is strongly correlated to the number of test
141
+ cases needed to validate a method.
142
+ Enabled: false
143
+ Max: 6
144
+ Metrics/MethodLength:
145
+ Description: Avoid methods longer than 10 lines of code.
146
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
147
+ Enabled: false
148
+ CountComments: false
149
+ Max: 10
150
+ Metrics/ParameterLists:
151
+ Description: Avoid parameter lists longer than three or four parameters.
152
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
153
+ Enabled: false
154
+ Max: 5
155
+ CountKeywordArgs: true
156
+ Metrics/PerceivedComplexity:
157
+ Description: A complexity metric geared towards measuring complexity for a human
158
+ reader.
159
+ Enabled: false
160
+ Max: 7
161
+ Lint/AssignmentInCondition:
162
+ Description: Don't use assignment in conditions.
163
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
164
+ Enabled: false
165
+ AllowSafeAssignment: true
166
+ Style/InlineComment:
167
+ Description: Avoid inline comments.
168
+ Enabled: false
169
+ Naming/AccessorMethodName:
170
+ Description: Check the naming of accessor methods for get_/set_.
171
+ Enabled: false
172
+ Style/Alias:
173
+ Description: Use alias_method instead of alias.
174
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
175
+ Enabled: false
176
+ Style/Documentation:
177
+ Description: Document classes and non-namespace modules.
178
+ Enabled: false
179
+ Style/DoubleNegation:
180
+ Description: Checks for uses of double negation (!!).
181
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
182
+ Enabled: false
183
+ Style/EachWithObject:
184
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
185
+ Enabled: false
186
+ Style/EmptyLiteral:
187
+ Description: Prefer literals to Array.new/Hash.new/String.new.
188
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
189
+ Enabled: false
190
+ Style/ModuleFunction:
191
+ Description: Checks for usage of `extend self` in modules.
192
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
193
+ Enabled: false
194
+ Style/OneLineConditional:
195
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
196
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
197
+ Enabled: false
198
+ Style/PerlBackrefs:
199
+ Description: Avoid Perl-style regex back references.
200
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
201
+ Enabled: false
202
+ Style/SymbolArray:
203
+ SupportedStyles:
204
+ - percent
205
+ - brackets
206
+ EnforcedStyle: percent
207
+ Style/Send:
208
+ Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
209
+ may overlap with existing methods.
210
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
211
+ Enabled: false
212
+ Style/SpecialGlobalVars:
213
+ Description: Avoid Perl-style global variables.
214
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
215
+ Enabled: false
216
+ Style/VariableInterpolation:
217
+ Description: Don't interpolate global, instance and class variables directly in
218
+ strings.
219
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
220
+ Enabled: false
221
+ Style/WhenThen:
222
+ Description: Use when x then ... for one-line cases.
223
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
224
+ Enabled: false
225
+ Lint/EachWithObjectArgument:
226
+ Description: Check for immutable argument given to each_with_object.
227
+ Enabled: true
228
+ Lint/HandleExceptions:
229
+ Description: Don't suppress exception.
230
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
231
+ Enabled: false
232
+ Lint/LiteralInInterpolation:
233
+ Description: Checks for literals used in interpolation.
234
+ Enabled: false
235
+ Lint/LiteralAsCondition:
236
+ Description: Checks of literals used in conditions.
237
+ Enabled: false
238
+ Style/Lambda:
239
+ Description: Use the new lambda literal syntax for single-line blocks.
240
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
241
+ Enabled: false
242
+ Rails/HttpPositionalArguments:
243
+ Enabled: false
244
+ Rails/SkipsModelValidations:
245
+ Enabled: false
246
+ Lint/AmbiguousBlockAssociation:
247
+ Enabled: false
248
+ Style/ClassAndModuleChildren:
249
+ Enabled: false
250
+ Style/RescueStandardError:
251
+ EnforcedStyle: implicit
252
+ Style/LambdaCall:
253
+ Enabled: false
254
+ Style/FrozenStringLiteralComment:
255
+ Enabled: false
@@ -0,0 +1,19 @@
1
+ install:
2
+ - git clone https://github.com/uber/h3.git h3_build
3
+ - pushd h3_build
4
+ - cmake . -DBUILD_SHARED_LIBS=true
5
+ - make
6
+ - sudo make install
7
+ - popd
8
+ - bundle install
9
+ language: ruby
10
+ cache: bundler
11
+ rvm:
12
+ - 2.4
13
+ addons:
14
+ apt:
15
+ packages:
16
+ - cmake
17
+ - make
18
+ - gcc
19
+ - libtool
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
@@ -0,0 +1,42 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ h3 (3.2.0)
5
+ ffi (~> 1.9)
6
+ rgeo-geojson (~> 2.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ diff-lcs (1.3)
12
+ ffi (1.9.25)
13
+ rake (12.3.2)
14
+ rgeo (2.0.0)
15
+ rgeo-geojson (2.1.1)
16
+ rgeo (>= 1.0.0)
17
+ rspec (3.8.0)
18
+ rspec-core (~> 3.8.0)
19
+ rspec-expectations (~> 3.8.0)
20
+ rspec-mocks (~> 3.8.0)
21
+ rspec-core (3.8.0)
22
+ rspec-support (~> 3.8.0)
23
+ rspec-expectations (3.8.2)
24
+ diff-lcs (>= 1.2.0, < 2.0)
25
+ rspec-support (~> 3.8.0)
26
+ rspec-mocks (3.8.0)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.8.0)
29
+ rspec-support (3.8.0)
30
+ yard (0.9.16)
31
+
32
+ PLATFORMS
33
+ ruby
34
+
35
+ DEPENDENCIES
36
+ h3!
37
+ rake (~> 12.3)
38
+ rspec (~> 3.8)
39
+ yard (~> 0.9)
40
+
41
+ BUNDLED WITH
42
+ 1.17.2
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Stuart Delivery
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,51 @@
1
+ # H3 Ruby
2
+
3
+ ![h3](https://user-images.githubusercontent.com/98526/50283275-48177300-044d-11e9-8337-eba8d3cc88a2.png)
4
+
5
+ [![Build Status](https://travis-ci.org/StuartApp/h3_ruby.svg?branch=master)](https://travis-ci.org/seanhandley/h3_ruby) [![Maintainability](https://api.codeclimate.com/v1/badges/c55e1f67421eba8af8d0/maintainability)](https://codeclimate.com/repos/5c18b7f49bc79a02a4000d81/maintainability)
6
+
7
+ Ruby bindings for Uber's [H3 library](https://uber.github.io/h3/).
8
+
9
+ Please consult the H3 documentation for a full explanation of terminology and concepts.
10
+
11
+ ## Getting Started
12
+
13
+ You need to install the C lib at https://github.com/uber/h3.
14
+
15
+ Install the build dependencies as instructed here: https://github.com/uber/h3#install-build-time-dependencies
16
+
17
+ Do *not* follow the Compilation Steps. Instead, use the following:
18
+
19
+ git clone git@github.com:uber/h3.git h3_build
20
+ cd h3_build
21
+ cmake . -DBUILD_SHARED_LIBS=true
22
+ make
23
+ sudo make install
24
+
25
+ The key difference is the `BUILD_SHARED_LIBS` option.
26
+
27
+ ## Installing
28
+
29
+ gem install h3
30
+
31
+ or
32
+
33
+ # Gemfile
34
+ gem "h3", "~> 3.2"
35
+
36
+ ## Documentation
37
+
38
+ https://www.rubydoc.info/github/StuartApp/h3_ruby
39
+
40
+ ## Usage
41
+
42
+ ```ruby
43
+ require "h3"
44
+ H3.geo_to_h3([53.959130, -1.079230], 8).to_s(16)
45
+ # => "8819429a9dfffff"
46
+ ```
47
+
48
+ ## Running Specs
49
+
50
+ rake
51
+
@@ -0,0 +1,3 @@
1
+ require 'rspec/core/rake_task'
2
+ RSpec::Core::RakeTask.new(:spec)
3
+ task :default => :spec
@@ -0,0 +1,21 @@
1
+ require_relative "lib/h3/version"
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "h3"
5
+ spec.version = H3::VERSION
6
+ spec.licenses = ["MIT"]
7
+ spec.summary = "C Bindings for Uber's H3 library"
8
+ spec.homepage = "https://github.com/StuartApp/h3_ruby"
9
+ spec.authors = ["Lachlan Laycock", "Sean Handley"]
10
+ spec.email = "l.laycock@stuart.com"
11
+
12
+ spec.required_ruby_version = "> 2.3"
13
+ spec.files = `git ls-files`.split("\n")
14
+
15
+ spec.add_runtime_dependency "ffi", "~> 1.9"
16
+ spec.add_runtime_dependency "rgeo-geojson", "~> 2.1"
17
+
18
+ spec.add_development_dependency "rake", "~> 12.3"
19
+ spec.add_development_dependency "rspec", "~> 3.8"
20
+ spec.add_development_dependency "yard", "~> 0.9"
21
+ end