Skip to content

Commit 5300969

Browse files
authored
Tidying (#38)
* Remove unnecessary files. * Move dependencies to gemspec. * Add MIT license. * Move these specs to indexing_spec.rb * Move bindings base. * hex ring needs to handle pentagons. * Functionality improvements. * Update gem version to match H3. * Update readme.
1 parent 02ebc49 commit 5300969

27 files changed

+246
-170
lines changed

.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

Gemfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
source "https://rubygems.org"
2-
3-
ruby "2.4.4" # Ideally, the same one as stuart-api.
4-
5-
gem "rake"
6-
gem "rspec", "~> 3.8.0"
7-
gem "ffi", "~> 1.9.6"
8-
gem "rgeo-geojson", "~> 2.1.1"
2+
gemspec

Gemfile.lock

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
PATH
2+
remote: .
3+
specs:
4+
h3 (3.2.0)
5+
ffi (~> 1.9)
6+
rgeo-geojson (~> 2.1)
7+
18
GEM
29
remote: https://rubygems.org/
310
specs:
411
diff-lcs (1.3)
512
ffi (1.9.25)
613
rake (12.3.2)
7-
rgeo (1.0.0)
14+
rgeo (2.0.0)
815
rgeo-geojson (2.1.1)
916
rgeo (>= 1.0.0)
1017
rspec (3.8.0)
@@ -20,18 +27,16 @@ GEM
2027
diff-lcs (>= 1.2.0, < 2.0)
2128
rspec-support (~> 3.8.0)
2229
rspec-support (3.8.0)
30+
yard (0.9.16)
2331

2432
PLATFORMS
2533
ruby
2634

2735
DEPENDENCIES
28-
ffi (~> 1.9.6)
29-
rake
30-
rgeo-geojson (~> 2.1.1)
31-
rspec (~> 3.8.0)
32-
33-
RUBY VERSION
34-
ruby 2.4.4p296
36+
h3!
37+
rake (~> 12.3)
38+
rspec (~> 3.8)
39+
yard (~> 0.9)
3540

3641
BUNDLED WITH
37-
1.17.1
42+
1.17.2

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# H3 Ruby
22

3-
[![Build Status](https://travis-ci.org/StuartApp/h3_ruby.svg?branch=master)](https://travis-ci.org/seanhandley/h3_ruby)
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)
46

57
Ruby bindings for Uber's [H3 library](https://uber.github.io/h3/).
68

7-
TODO: Add more wrapper functions.
9+
Please consult the H3 documentation for a full explanation of terminology and concepts.
810

911
## Getting Started
1012

@@ -14,24 +16,26 @@ Install the build dependencies as instructed here: https://github.com/uber/h3#in
1416

1517
Do *not* follow the Compilation Steps. Instead, use the following:
1618

17-
git clone [email protected]:uber/h3.git
18-
cd h3
19+
git clone [email protected]:uber/h3.git h3_build
20+
cd h3_build
1921
cmake . -DBUILD_SHARED_LIBS=true
2022
make
2123
sudo make install
2224

25+
The key difference is the `BUILD_SHARED_LIBS` option.
26+
2327
## Installing
2428

2529
gem install h3
2630

2731
or
2832

2933
# Gemfile
30-
gem "h3", "~> 0.0.1pre"
34+
gem "h3", "~> 3.2"
3135

32-
## Running Specs
36+
## Documentation
3337

34-
bin/rspec spec
38+
https://www.rubydoc.info/github/StuartApp/h3_ruby
3539

3640
## Usage
3741

@@ -41,6 +45,7 @@ H3.geo_to_h3([53.959130, -1.079230], 8).to_s(16)
4145
# => "8819429a9dfffff"
4246
```
4347

44-
## GeoJSON
48+
## Running Specs
49+
50+
rake
4551

46-
Note that methods returning GeoJSON contain coordinates in the form `[lon, lat]`, whereas H3 coordinates use `[lat, lon]`.

bin/console

Lines changed: 0 additions & 6 deletions
This file was deleted.

bin/rspec

Lines changed: 0 additions & 3 deletions
This file was deleted.

bin/run

Lines changed: 0 additions & 6 deletions
This file was deleted.

h3.gemspec

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
$: << File.expand_path("lib", __dir__)
2-
require "h3/version"
1+
require_relative "lib/h3/version"
32

43
Gem::Specification.new do |spec|
54
spec.name = "h3"
65
spec.version = H3::VERSION
7-
spec.licenses = ["Nonstandard"] # Avoids a warning when building the gem.
6+
spec.licenses = ["MIT"]
87
spec.summary = "C Bindings for Uber's H3 library"
98
spec.homepage = "https://github.com/StuartApp/h3_ruby"
109
spec.authors = ["Lachlan Laycock", "Sean Handley"]
1110
spec.email = "[email protected]"
1211

13-
spec.extensions = %w(ext/h3/extconf.rb)
14-
spec.require_paths = %w(lib)
15-
spec.files = %w(
16-
ext/h3/extconf.rb
17-
ext/h3/h3.c
18-
lib/h3.rb
19-
lib/h3/version.rb
20-
)
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"
2121
end

lib/h3.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
require "ffi"
22
require "rgeo/geo_json"
33

4-
require "h3/binding_base"
5-
require "h3/bindings/structs"
6-
require "h3/bindings/private"
4+
require "h3/bindings"
75
require "h3/geo_json"
86
require "h3/hierarchy"
97
require "h3/indexing"

0 commit comments

Comments
 (0)