h3 3.5.0 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,47 +1,47 @@
1
1
  RSpec.describe H3 do
2
2
  include_context "constants"
3
3
 
4
- describe ".h3_resolution" do
4
+ describe ".resolution" do
5
5
  let(:h3_index) { valid_h3_index }
6
6
  let(:result) { 8 }
7
7
 
8
- subject(:h3_resolution) { H3.h3_resolution(h3_index) }
8
+ subject(:resolution) { H3.resolution(h3_index) }
9
9
 
10
10
  it { is_expected.to eq(result) }
11
11
  end
12
12
 
13
- describe ".h3_base_cell" do
13
+ describe ".base_cell" do
14
14
  let(:h3_index) { valid_h3_index }
15
15
  let(:result) { 12 }
16
16
 
17
- subject(:h3_base_cell) { H3.h3_base_cell(h3_index) }
17
+ subject(:base_cell) { H3.base_cell(h3_index) }
18
18
 
19
19
  it { is_expected.to eq(result) }
20
20
  end
21
21
 
22
- describe ".string_to_h3" do
22
+ describe ".from_string" do
23
23
  let(:h3_index) { "8928308280fffff"}
24
24
  let(:result) { h3_index.to_i(16) }
25
25
 
26
- subject(:string_to_h3) { H3.string_to_h3(h3_index) }
26
+ subject(:from_string) { H3.from_string(h3_index) }
27
27
 
28
28
  it { is_expected.to eq(result) }
29
29
  end
30
30
 
31
- describe ".h3_to_string" do
31
+ describe ".to_string" do
32
32
  let(:h3_index) { "8928308280fffff".to_i(16) }
33
33
  let(:result) { h3_index.to_s(16) }
34
34
 
35
- subject(:h3_to_string) { H3.h3_to_string(h3_index) }
35
+ subject(:to_string) { H3.to_string(h3_index) }
36
36
 
37
37
  it { is_expected.to eq(result) }
38
38
  end
39
39
 
40
- describe ".h3_valid?" do
40
+ describe ".valid?" do
41
41
  let(:h3_index) { valid_h3_index }
42
42
  let(:result) { true }
43
43
 
44
- subject(:h3_valid?) { H3.h3_valid?(h3_index) }
44
+ subject(:valid?) { H3.valid?(h3_index) }
45
45
 
46
46
  it { is_expected.to eq(result) }
47
47
 
@@ -51,16 +51,16 @@ RSpec.describe H3 do
51
51
  let(:result) { false }
52
52
 
53
53
  it "returns the expected result" do
54
- expect(h3_valid?).to eq(result)
54
+ expect(valid?).to eq(result)
55
55
  end
56
56
  end
57
57
  end
58
58
 
59
- describe ".h3_res_class_3?" do
59
+ describe ".class_3_resolution?" do
60
60
  let(:h3_index) { "8928308280fffff".to_i(16) }
61
61
  let(:result) { true }
62
62
 
63
- subject(:h3_res_class_3) { H3.h3_res_class_3?(h3_index) }
63
+ subject(:class_3_resolution) { H3.class_3_resolution?(h3_index) }
64
64
 
65
65
  it { is_expected.to eq(result) }
66
66
 
@@ -72,11 +72,11 @@ RSpec.describe H3 do
72
72
  end
73
73
  end
74
74
 
75
- describe ".h3_pentagon?" do
75
+ describe ".pentagon?" do
76
76
  let(:h3_index) { "821c07fffffffff".to_i(16) }
77
77
  let(:result) { true }
78
78
 
79
- subject(:h3_pentagon?) { H3.h3_pentagon?(h3_index) }
79
+ subject(:pentagon?) { H3.pentagon?(h3_index) }
80
80
 
81
81
  it { is_expected.to eq(result) }
82
82
 
@@ -104,11 +104,11 @@ RSpec.describe H3 do
104
104
  end
105
105
  end
106
106
 
107
- describe ".h3_faces" do
107
+ describe ".faces" do
108
108
  let(:h3_index) { "8928308280fffff".to_i(16) }
109
109
  let(:result) { [7] }
110
110
 
111
- subject(:max_face_count) { H3.h3_faces(h3_index) }
111
+ subject(:faces) { H3.faces(h3_index) }
112
112
 
113
113
  it { is_expected.to eq(result) }
114
114
 
@@ -1,11 +1,11 @@
1
1
  RSpec.describe H3 do
2
2
  include_context "constants"
3
3
 
4
- describe ".num_hexagons" do
4
+ describe ".hexagon_count" do
5
5
  let(:resolution) { 2 }
6
6
  let(:result) { 5882 }
7
7
 
8
- subject(:num_hexagons) { H3.num_hexagons(resolution) }
8
+ subject(:hexagon_count) { H3.hexagon_count(resolution) }
9
9
 
10
10
  it { is_expected.to eq(result) }
11
11
 
@@ -14,7 +14,7 @@ RSpec.describe H3 do
14
14
  let(:result) { false }
15
15
 
16
16
  it "returns the expected result" do
17
- expect { num_hexagons }.to raise_error(ArgumentError)
17
+ expect { hexagon_count }.to raise_error(ArgumentError)
18
18
  end
19
19
  end
20
20
  end
@@ -73,12 +73,12 @@ RSpec.describe H3 do
73
73
  it { is_expected.to eq(result) }
74
74
  end
75
75
 
76
- describe ".res_0_indexes" do
76
+ describe ".base_cells" do
77
77
  let(:count) { 122 }
78
- subject(:res_0_indexes) { H3.res_0_indexes }
78
+ subject(:base_cells) { H3.base_cells }
79
79
 
80
80
  it "has 122 base cells" do
81
- expect(res_0_indexes.count).to eq(count)
81
+ expect(base_cells.count).to eq(count)
82
82
  end
83
83
  end
84
84
  end
@@ -331,27 +331,27 @@ RSpec.describe H3 do
331
331
  end
332
332
  end
333
333
 
334
- describe ".h3_distance" do
334
+ describe ".distance" do
335
335
  let(:origin) { "89283082993ffff".to_i(16) }
336
336
  let(:destination) { "89283082827ffff".to_i(16) }
337
337
  let(:result) { 5 }
338
338
 
339
- subject(:h3_distance) { H3.h3_distance(origin, destination) }
339
+ subject(:distance) { H3.distance(origin, destination) }
340
340
 
341
341
  it { is_expected.to eq(result) }
342
342
  end
343
343
 
344
- describe ".h3_line_size" do
344
+ describe ".line_size" do
345
345
  let(:origin) { "89283082993ffff".to_i(16) }
346
346
  let(:destination) { "89283082827ffff".to_i(16) }
347
347
  let(:result) { 6 }
348
348
 
349
- subject(:h3_line_size) { H3.h3_line_size(origin, destination) }
349
+ subject(:h3_line_size) { H3.line_size(origin, destination) }
350
350
 
351
351
  it { is_expected.to eq(result) }
352
352
  end
353
353
 
354
- describe ".h3_line" do
354
+ describe ".line" do
355
355
  let(:origin) { "89283082993ffff".to_i(16) }
356
356
  let(:destination) { "89283082827ffff".to_i(16) }
357
357
  let(:result) do
@@ -361,7 +361,7 @@ RSpec.describe H3 do
361
361
  ].map { |i| i.to_i(16) }
362
362
  end
363
363
 
364
- subject(:h3_line) { H3.h3_line(origin, destination) }
364
+ subject(:line) { H3.line(origin, destination) }
365
365
 
366
366
  it { is_expected.to eq(result) }
367
367
  end
@@ -1,12 +1,12 @@
1
1
  RSpec.describe H3 do
2
2
  include_context "constants"
3
3
 
4
- describe ".h3_indexes_neighbors?" do
4
+ describe ".neighbors?" do
5
5
  let(:origin) { "8928308280fffff".to_i(16) }
6
6
  let(:destination) { "8928308280bffff".to_i(16) }
7
7
  let(:result) { true }
8
8
 
9
- subject(:h3_indexes_neighbors?) { H3.h3_indexes_neighbors?(origin, destination) }
9
+ subject(:neighbors?) { H3.neighbors?(origin, destination) }
10
10
 
11
11
  it { is_expected.to eq(result) }
12
12
 
@@ -18,21 +18,21 @@ RSpec.describe H3 do
18
18
  end
19
19
  end
20
20
 
21
- describe ".h3_unidirectional_edge" do
21
+ describe ".unidirectional_edge" do
22
22
  let(:origin) { "8928308280fffff".to_i(16) }
23
23
  let(:destination) { "8928308280bffff".to_i(16) }
24
24
  let(:result) { "16928308280fffff".to_i(16) }
25
25
 
26
- subject(:h3_unidirectional_edge) { H3.h3_unidirectional_edge(origin, destination) }
26
+ subject(:unidirectional_edge) { H3.unidirectional_edge(origin, destination) }
27
27
 
28
28
  it { is_expected.to eq(result) }
29
29
  end
30
30
 
31
- describe ".h3_unidirectional_edge_valid?" do
31
+ describe ".unidirectional_edge_valid?" do
32
32
  let(:edge) { "11928308280fffff".to_i(16) }
33
33
  let(:result) { true }
34
34
 
35
- subject(:h3_unidirectional_edge_valid?) { H3.h3_unidirectional_edge_valid?(edge) }
35
+ subject(:h3_unidirectional_edge_valid?) { H3.unidirectional_edge_valid?(edge) }
36
36
 
37
37
  it { is_expected.to eq(result) }
38
38
 
@@ -62,24 +62,24 @@ RSpec.describe H3 do
62
62
  it { is_expected.to eq(result) }
63
63
  end
64
64
 
65
- describe ".h3_indexes_from_unidirectional_edge" do
65
+ describe ".origin_and_destination_from_unidirectional_edge" do
66
66
  let(:h3_index) { "11928308280fffff".to_i(16) }
67
67
  let(:expected_indexes) do
68
68
  %w(8928308280fffff 8928308283bffff).map { |i| i.to_i(16) }
69
69
  end
70
70
 
71
- subject(:h3_indexes_from_unidirectional_edge) do
72
- H3.h3_indexes_from_unidirectional_edge(h3_index)
71
+ subject(:origin_and_destination_from_unidirectional_edge) do
72
+ H3.origin_and_destination_from_unidirectional_edge(h3_index)
73
73
  end
74
74
 
75
75
  it "has two expected h3 indexes" do
76
- expect(h3_indexes_from_unidirectional_edge).to eq(expected_indexes)
76
+ expect(origin_and_destination_from_unidirectional_edge).to eq(expected_indexes)
77
77
  end
78
78
  end
79
79
 
80
- describe ".h3_unidirectional_edges_from_hexagon" do
81
- subject(:h3_unidirectional_edges_from_hexagon) do
82
- H3.h3_unidirectional_edges_from_hexagon(h3_index)
80
+ describe ".unidirectional_edges_from_hexagon" do
81
+ subject(:unidirectional_edges_from_hexagon) do
82
+ H3.unidirectional_edges_from_hexagon(h3_index)
83
83
  end
84
84
 
85
85
  context "when index is a hexagon" do
@@ -87,7 +87,7 @@ RSpec.describe H3 do
87
87
  let(:count) { 6 }
88
88
 
89
89
  it "has six expected edges" do
90
- expect(h3_unidirectional_edges_from_hexagon.count).to eq(count)
90
+ expect(unidirectional_edges_from_hexagon.count).to eq(count)
91
91
  end
92
92
  end
93
93
 
@@ -96,21 +96,21 @@ RSpec.describe H3 do
96
96
  let(:count) { 5 }
97
97
 
98
98
  it "has five expected edges" do
99
- expect(h3_unidirectional_edges_from_hexagon.count).to eq(count)
99
+ expect(unidirectional_edges_from_hexagon.count).to eq(count)
100
100
  end
101
101
  end
102
102
  end
103
103
 
104
- describe ".h3_unidirectional_edge_boundary" do
104
+ describe ".unidirectional_edge_boundary" do
105
105
  let(:edge) { "11928308280fffff".to_i(16) }
106
106
  let(:expected) do
107
107
  [[37.77820687262237, -122.41971895414808], [37.77652420699321, -122.42079024541876]]
108
108
  end
109
109
 
110
- subject(:h3_unidirectional_edge_boundary) { H3.h3_unidirectional_edge_boundary(edge) }
110
+ subject(:unidirectional_edge_boundary) { H3.unidirectional_edge_boundary(edge) }
111
111
 
112
112
  it "matches expected coordinates" do
113
- h3_unidirectional_edge_boundary.zip(expected) do |(lat, lon), (exp_lat, exp_lon)|
113
+ unidirectional_edge_boundary.zip(expected) do |(lat, lon), (exp_lat, exp_lon)|
114
114
  expect(lat).to be_within(0.000001).of(exp_lat)
115
115
  expect(lon).to be_within(0.000001).of(exp_lon)
116
116
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: h3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lachlan Laycock
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-07-25 00:00:00.000000000 Z
12
+ date: 2019-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -39,6 +39,20 @@ dependencies:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '2.1'
42
+ - !ruby/object:Gem::Dependency
43
+ name: zeitwerk
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: 2.1.9
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: 2.1.9
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: coveralls
44
58
  requirement: !ruby/object:Gem::Requirement
@@ -374,7 +388,6 @@ files:
374
388
  - ext/h3/src/website/static/index.html
375
389
  - h3.gemspec
376
390
  - lib/h3.rb
377
- - lib/h3/bindings.rb
378
391
  - lib/h3/bindings/base.rb
379
392
  - lib/h3/bindings/private.rb
380
393
  - lib/h3/bindings/structs.rb
data/lib/h3/bindings.rb DELETED
@@ -1,12 +0,0 @@
1
- require "h3/bindings/base"
2
- require "h3/bindings/structs"
3
- require "h3/bindings/types"
4
- require "h3/bindings/private"
5
-
6
- module H3
7
- # Internal bindings related modules and classes.
8
- #
9
- # These are intended to be used by the library's public methods
10
- # and not to be used directly by client code.
11
- module Bindings; end
12
- end