rcap 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +4 -0
- data/README.rdoc +1 -1
- data/lib/rcap/cap_1_0/polygon.rb +5 -4
- data/lib/rcap/cap_1_1/polygon.rb +5 -4
- data/lib/rcap/cap_1_2/polygon.rb +1 -1
- data/lib/rcap/version.rb +1 -1
- data/spec/cap_1_0/area_spec.rb +1 -1
- data/spec/cap_1_1/area_spec.rb +1 -1
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
data/lib/rcap/cap_1_0/polygon.rb
CHANGED
@@ -9,8 +9,9 @@ module RCAP
|
|
9
9
|
# Collection of Point objects.
|
10
10
|
attr_reader( :points )
|
11
11
|
|
12
|
-
validates_length_of( :points, :minimum => 3 )
|
13
12
|
validates_collection_of( :points )
|
13
|
+
validates_length_of( :points, :minimum => 3 )
|
14
|
+
validates_equality_of_first_and_last( :points )
|
14
15
|
|
15
16
|
XML_ELEMENT_NAME = 'polygon' # :nodoc:
|
16
17
|
XPATH = "cap:#{ XML_ELEMENT_NAME }" # :nodoc:
|
@@ -28,10 +29,10 @@ module RCAP
|
|
28
29
|
end
|
29
30
|
|
30
31
|
# Returns a string representation of the polygon of the form
|
31
|
-
# points[0] points[1] points[2] ...
|
32
|
+
# points[0] points[1] points[2] ...
|
32
33
|
# where each point is formatted with Point#to_s
|
33
34
|
def to_s
|
34
|
-
|
35
|
+
@points.join( ' ' )
|
35
36
|
end
|
36
37
|
|
37
38
|
def inspect # :nodoc:
|
@@ -56,7 +57,7 @@ module RCAP
|
|
56
57
|
def self.from_xml_element( polygon_xml_element ) # :nodoc:
|
57
58
|
if !polygon_xml_element.text.nil? && !polygon_xml_element.text.empty?
|
58
59
|
coordinates = self.parse_polygon_string( polygon_xml_element.text )
|
59
|
-
points = coordinates.map{ |lattitude, longitude| Point.new( :lattitude => lattitude, :longitude => longitude )}
|
60
|
+
points = coordinates.map{ |lattitude, longitude| Point.new( :lattitude => lattitude, :longitude => longitude )}
|
60
61
|
polygon = self.new( :points => points )
|
61
62
|
else
|
62
63
|
self.new
|
data/lib/rcap/cap_1_1/polygon.rb
CHANGED
@@ -9,8 +9,9 @@ module RCAP
|
|
9
9
|
# Collection of Point objects.
|
10
10
|
attr_reader( :points )
|
11
11
|
|
12
|
-
validates_length_of( :points, :minimum => 3 )
|
13
12
|
validates_collection_of( :points )
|
13
|
+
validates_length_of( :points, :minimum => 3 )
|
14
|
+
validates_equality_of_first_and_last( :points )
|
14
15
|
|
15
16
|
XML_ELEMENT_NAME = 'polygon' # :nodoc:
|
16
17
|
XPATH = "cap:#{ XML_ELEMENT_NAME }" # :nodoc:
|
@@ -28,10 +29,10 @@ module RCAP
|
|
28
29
|
end
|
29
30
|
|
30
31
|
# Returns a string representation of the polygon of the form
|
31
|
-
# points[0] points[1] points[2] ...
|
32
|
+
# points[0] points[1] points[2] ...
|
32
33
|
# where each point is formatted with Point#to_s
|
33
34
|
def to_s
|
34
|
-
|
35
|
+
@points.join( ' ' )
|
35
36
|
end
|
36
37
|
|
37
38
|
def inspect # :nodoc:
|
@@ -56,7 +57,7 @@ module RCAP
|
|
56
57
|
def self.from_xml_element( polygon_xml_element ) # :nodoc:
|
57
58
|
if !polygon_xml_element.text.nil? && !polygon_xml_element.text.empty?
|
58
59
|
coordinates = self.parse_polygon_string( polygon_xml_element.text )
|
59
|
-
points = coordinates.map{ |lattitude, longitude| Point.new( :lattitude => lattitude, :longitude => longitude )}
|
60
|
+
points = coordinates.map{ |lattitude, longitude| Point.new( :lattitude => lattitude, :longitude => longitude )}
|
60
61
|
polygon = self.new( :points => points )
|
61
62
|
else
|
62
63
|
self.new
|
data/lib/rcap/cap_1_2/polygon.rb
CHANGED
@@ -29,7 +29,7 @@ module RCAP
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# Returns a string representation of the polygon of the form
|
32
|
-
# points[0] points[1] points[2] ...
|
32
|
+
# points[0] points[1] points[2] ...
|
33
33
|
# where each point is formatted with Point#to_s
|
34
34
|
def to_s
|
35
35
|
@points.join( ' ' )
|
data/lib/rcap/version.rb
CHANGED
data/spec/cap_1_0/area_spec.rb
CHANGED
@@ -167,7 +167,7 @@ describe( RCAP::CAP_1_0::Area ) do
|
|
167
167
|
@polygon = RCAP::CAP_1_0::Polygon.new
|
168
168
|
@polygon.points.push( RCAP::CAP_1_0::Point.new( :lattitude => 0, :longitude => 0 ),
|
169
169
|
RCAP::CAP_1_0::Point.new( :lattitude => 0, :longitude => 1 ),
|
170
|
-
RCAP::CAP_1_0::Point.new( :lattitude =>
|
170
|
+
RCAP::CAP_1_0::Point.new( :lattitude => 0, :longitude => 0 ))
|
171
171
|
@area.polygons << @polygon
|
172
172
|
@area.should( be_valid )
|
173
173
|
end
|
data/spec/cap_1_1/area_spec.rb
CHANGED
@@ -167,7 +167,7 @@ describe( RCAP::CAP_1_1::Area ) do
|
|
167
167
|
@polygon = RCAP::CAP_1_1::Polygon.new
|
168
168
|
@polygon.points.push( RCAP::CAP_1_1::Point.new( :lattitude => 0, :longitude => 0 ),
|
169
169
|
RCAP::CAP_1_1::Point.new( :lattitude => 0, :longitude => 1 ),
|
170
|
-
RCAP::CAP_1_1::Point.new( :lattitude =>
|
170
|
+
RCAP::CAP_1_1::Point.new( :lattitude => 0, :longitude => 0 ))
|
171
171
|
@area.polygons << @polygon
|
172
172
|
@area.should( be_valid )
|
173
173
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 2
|
10
|
+
version: 1.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Farrel Lifson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-28 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: assistance
|