quickroute 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- metadata +4 -6
- data/spec/fixtures/2010-Ankkurirastit.jpg +0 -0
- data/spec/integration/parsing_spec.rb +0 -108
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quickroute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jarkko Laine
|
@@ -93,16 +93,14 @@ files:
|
|
93
93
|
- lib/string_extensions.rb
|
94
94
|
- lib/tag_data_extractor.rb
|
95
95
|
- lib/waypoint.rb
|
96
|
-
- spec/fixtures/2010-Ankkurirastit.jpg
|
97
|
-
- spec/integration/parsing_spec.rb
|
98
96
|
- spec/models/lap_spec.rb
|
99
97
|
- spec/models/quickroute_jpeg_parser_spec.rb
|
100
98
|
- spec/models/route_segment_spec.rb
|
101
99
|
- spec/models/route_spec.rb
|
102
100
|
- spec/models/session_spec.rb
|
103
101
|
- spec/models/waypoint_spec.rb
|
104
|
-
- spec/spec_helper.rb
|
105
102
|
- README.md
|
103
|
+
- spec/spec_helper.rb
|
106
104
|
homepage: https://github.com/jarkko/quickroute-ruby
|
107
105
|
licenses: []
|
108
106
|
|
Binary file
|
@@ -1,108 +0,0 @@
|
|
1
|
-
require_relative '../spec_helper'
|
2
|
-
|
3
|
-
describe "Parsing existing jpg file without calculation" do
|
4
|
-
before(:all) do
|
5
|
-
@filename = File.join(File.expand_path(File.dirname(__FILE__)),
|
6
|
-
'../fixtures/2010-Ankkurirastit.jpg')
|
7
|
-
|
8
|
-
@qp = QuickrouteJpegParser.new(File.join(@filename), false)
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should have correct version" do
|
12
|
-
@qp.version.should == "1.0.0.0"
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should have correct size in pixels" do
|
16
|
-
@qp.map_location_and_size_in_pixels.width.should == 1365
|
17
|
-
@qp.map_location_and_size_in_pixels.height.should == 1556
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should have one session" do
|
21
|
-
@qp.sessions.size.should equal(1)
|
22
|
-
end
|
23
|
-
|
24
|
-
describe "session" do
|
25
|
-
before do
|
26
|
-
@it = @qp.sessions.first
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should have correct session info" do
|
30
|
-
@it.session_info.person.name.should == "kari ja maria"
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should have 17 laps" do
|
34
|
-
@it.laps.size.should equal(17)
|
35
|
-
end
|
36
|
-
|
37
|
-
describe "lap" do
|
38
|
-
it "should have correct time" do
|
39
|
-
Time.at(@it.laps.first.time).to_s.should == "2010-04-18 11:48:03 +0300"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
it "should have 39 handles" do
|
44
|
-
@it.handles.size.should equal(39)
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should have correct projection origin" do
|
48
|
-
@it.projection_origin.latitude.should == 60.33081694444444
|
49
|
-
@it.projection_origin.longitude.should == 22.894455
|
50
|
-
end
|
51
|
-
|
52
|
-
describe "route" do
|
53
|
-
it "should have one segment" do
|
54
|
-
@it.route.segments.size.should equal(1)
|
55
|
-
end
|
56
|
-
|
57
|
-
describe "segment" do
|
58
|
-
it "should have 1001 waypoints" do
|
59
|
-
@it.route.segments.first.waypoints.size.should equal(1001)
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "first waypoint" do
|
63
|
-
before do
|
64
|
-
@wp = @it.route.segments.first.waypoints.first
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should have correct time set" do
|
68
|
-
Time.at(@wp.time).to_s.should == "2010-04-18 11:48:03 +0300"
|
69
|
-
end
|
70
|
-
|
71
|
-
it "should have correct position" do
|
72
|
-
@wp.position.latitude.should == 60.34066361111111
|
73
|
-
@wp.position.longitude.should == 22.904983333333334
|
74
|
-
end
|
75
|
-
|
76
|
-
it "should have correct altitude" do
|
77
|
-
@wp.altitude.should == 62
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
describe "Parsing existing jpg file with calculation" do
|
86
|
-
before(:all) do
|
87
|
-
@filename = File.join(File.expand_path(File.dirname(__FILE__)),
|
88
|
-
'../fixtures/2010-Ankkurirastit.jpg')
|
89
|
-
|
90
|
-
@qp = QuickrouteJpegParser.new(File.join(@filename), true)
|
91
|
-
end
|
92
|
-
|
93
|
-
describe "session" do
|
94
|
-
it "should have correct straight line distance" do
|
95
|
-
@qp.sessions.first.straight_line_distance.round.should == 6750
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
describe "route" do
|
100
|
-
it "should have correct distance" do
|
101
|
-
@qp.sessions.first.route.distance.round.should == 7566
|
102
|
-
end
|
103
|
-
|
104
|
-
it "should have correct elapsed time" do
|
105
|
-
@qp.sessions.first.route.elapsed_time.should == 2706.0
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|