simplify_rb 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 33cd91e84b17826cf512f3b17083e297b65c3268
4
- data.tar.gz: 48d4337b44170364e78f3e206e5b19a90a84d567
2
+ SHA256:
3
+ metadata.gz: 7cceace0a43afaceb14633479b8e4497b3abbe4f697dec9f6e7888dbbc60cf01
4
+ data.tar.gz: 480012823a6f4a48c22219b52147e4a65d844c0f3290e2c9648514c0aa76a9b7
5
5
  SHA512:
6
- metadata.gz: fd402062db3e2892fd4a1ce5aa8223b47f03daf465be61d397b874c19630aaa7085269ade4ed93c1be6cb45f61d1e092075e962587c3f174383cfd27aaa12468
7
- data.tar.gz: 9a4baf26c41e5d912767840a811847d1bd65b3ccac19e16b9b743a2a7ef5ac21d515f944c92631e8fbe55aa280b47c6029aec77d7c50a5f86234f46cc86be72a
6
+ metadata.gz: 56b1b18958c6181d0bbc121583185b9f9aed82ad8901389dc61857454330ebf071ccd09b72161bda9fba16bd345fc8526cc5c3d246fff609c153cc4d6d2b711b
7
+ data.tar.gz: b98c8644bf8693f2fc8316c2f36841d701b1ab0a42eed0f66a988fd0d10f6cc769d4ab17d34c9c4ee8244114ad5876e808373a2fc7bbb1eb36c578943b90cf29
@@ -1,5 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.0
4
- - 2.2
5
3
  - 2.1
4
+ - 2.2
5
+ - 2.3.0
6
+ - 2.4
7
+ - 2.5
@@ -6,7 +6,7 @@ require 'simplify_rb/douglas_peucker_simplifier'
6
6
  module SimplifyRb
7
7
  class Simplifier
8
8
  def process(raw_points, tolerance = 1, highest_quality = false)
9
- raise ArgumentError.new('Points must be an array') unless raw_points.is_a? Array
9
+ raise ArgumentError.new('raw_points must be enumerable') unless raw_points.is_a? Enumerable
10
10
 
11
11
  return raw_points if raw_points.length <= 1
12
12
 
@@ -1,3 +1,3 @@
1
1
  module SimplifyRb
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -49,10 +49,19 @@ describe SimplifyRb::Simplifier do
49
49
  end
50
50
  end
51
51
 
52
- describe 'unexpected argument' do
53
- it 'raises an error if the points are not passsed as an array' do
54
- data = { x: 1, y: 2 }
55
- expect { subject.process(data) }.to raise_error(ArgumentError, 'Points must be an array')
52
+ describe 'unexpected arguments' do
53
+ context 'when raw_points is not enumerable' do
54
+ it 'raises an ArgumentError' do
55
+ data = Object.new
56
+ expect { subject.process(data) }.to raise_error(ArgumentError, 'raw_points must be enumerable')
57
+ end
58
+ end
59
+
60
+ context "when raw_points is enumerable, but doesn't respond to x/y" do
61
+ it 'raises an ArgumentError' do
62
+ data = [{ foo: :bar }, { foo: :bar }]
63
+ expect { subject.process(data) }.to raise_error(ArgumentError, 'Points must have :x and :y values')
64
+ end
56
65
  end
57
66
  end
58
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplify_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - odlp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-28 00:00:00.000000000 Z
11
+ date: 2018-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.5.1
103
+ rubygems_version: 2.7.6
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Polyline simplification library. Ruby port of Simplify.js.