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 +5 -5
- data/.travis.yml +4 -2
- data/lib/simplify_rb.rb +1 -1
- data/lib/simplify_rb/version.rb +1 -1
- data/spec/simplify_rb_spec.rb +13 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7cceace0a43afaceb14633479b8e4497b3abbe4f697dec9f6e7888dbbc60cf01
|
4
|
+
data.tar.gz: 480012823a6f4a48c22219b52147e4a65d844c0f3290e2c9648514c0aa76a9b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56b1b18958c6181d0bbc121583185b9f9aed82ad8901389dc61857454330ebf071ccd09b72161bda9fba16bd345fc8526cc5c3d246fff609c153cc4d6d2b711b
|
7
|
+
data.tar.gz: b98c8644bf8693f2fc8316c2f36841d701b1ab0a42eed0f66a988fd0d10f6cc769d4ab17d34c9c4ee8244114ad5876e808373a2fc7bbb1eb36c578943b90cf29
|
data/.travis.yml
CHANGED
data/lib/simplify_rb.rb
CHANGED
@@ -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('
|
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
|
|
data/lib/simplify_rb/version.rb
CHANGED
data/spec/simplify_rb_spec.rb
CHANGED
@@ -49,10 +49,19 @@ describe SimplifyRb::Simplifier do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
describe 'unexpected
|
53
|
-
|
54
|
-
|
55
|
-
|
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.
|
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:
|
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.
|
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.
|