stratify-garmin 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +49 -49
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/app/assets/images/garmin-icon-16.png +0 -0
- data/app/assets/images/garmin-icon-24.png +0 -0
- data/lib/stratify-garmin/activity.rb +1 -1
- data/lib/stratify-garmin/collector.rb +2 -2
- data/lib/stratify-garmin/presenter.rb +6 -6
- data/lib/stratify-garmin/rss_item_adapter.rb +4 -4
- data/lib/stratify-garmin/version.rb +1 -1
- data/spec/stratify-garmin/integration_spec.rb +1 -1
- data/spec/stratify-garmin/presenter_spec.rb +2 -2
- data/stratify-garmin.gemspec +5 -4
- data/vcr_cassettes/garmin.yml +16 -16
- metadata +33 -22
data/Gemfile.lock
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stratify-garmin (0.1.
|
4
|
+
stratify-garmin (0.1.4)
|
5
5
|
nokogiri (~> 1.4.4)
|
6
|
-
railties (~> 3.
|
7
|
-
stratify-base (~> 0.1.
|
6
|
+
railties (~> 3.2.0)
|
7
|
+
stratify-base (~> 0.1.4)
|
8
8
|
thoughtafter-simple-rss (~> 1.2.3)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: http://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actionpack (3.
|
14
|
-
activemodel (= 3.
|
15
|
-
activesupport (= 3.
|
13
|
+
actionpack (3.2.3)
|
14
|
+
activemodel (= 3.2.3)
|
15
|
+
activesupport (= 3.2.3)
|
16
16
|
builder (~> 3.0.0)
|
17
17
|
erubis (~> 2.7.0)
|
18
|
-
|
19
|
-
rack (~> 1.
|
20
|
-
rack-cache (~> 1.
|
21
|
-
rack-mount (~> 0.8.2)
|
18
|
+
journey (~> 1.0.1)
|
19
|
+
rack (~> 1.4.0)
|
20
|
+
rack-cache (~> 1.2)
|
22
21
|
rack-test (~> 0.6.1)
|
23
|
-
sprockets (~> 2.
|
24
|
-
activemodel (3.
|
25
|
-
activesupport (= 3.
|
26
|
-
bcrypt-ruby (~> 3.0.0)
|
22
|
+
sprockets (~> 2.1.2)
|
23
|
+
activemodel (3.2.3)
|
24
|
+
activesupport (= 3.2.3)
|
27
25
|
builder (~> 3.0.0)
|
26
|
+
activesupport (3.2.3)
|
28
27
|
i18n (~> 0.6)
|
29
|
-
activesupport (3.1.0)
|
30
28
|
multi_json (~> 1.0)
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
bson (1.6.2)
|
30
|
+
bson_ext (1.6.2)
|
31
|
+
bson (~> 1.6.2)
|
34
32
|
builder (3.0.0)
|
35
|
-
database_cleaner (0.
|
36
|
-
diff-lcs (1.1.
|
33
|
+
database_cleaner (0.7.2)
|
34
|
+
diff-lcs (1.1.3)
|
37
35
|
erubis (2.7.0)
|
38
36
|
fakeweb (1.3.0)
|
39
37
|
hike (1.2.1)
|
40
38
|
i18n (0.6.0)
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
journey (1.0.3)
|
40
|
+
json (1.7.0)
|
41
|
+
mongo (1.6.2)
|
42
|
+
bson (~> 1.6.2)
|
43
|
+
mongoid (2.4.9)
|
44
|
+
activemodel (~> 3.1)
|
45
45
|
mongo (~> 1.3)
|
46
46
|
tzinfo (~> 0.3.22)
|
47
|
-
multi_json (1.
|
47
|
+
multi_json (1.3.2)
|
48
48
|
nokogiri (1.4.7)
|
49
|
-
rack (1.
|
50
|
-
rack-cache (1.
|
49
|
+
rack (1.4.1)
|
50
|
+
rack-cache (1.2)
|
51
51
|
rack (>= 0.4)
|
52
|
-
rack-mount (0.8.3)
|
53
|
-
rack (>= 1.0.0)
|
54
52
|
rack-ssl (1.3.2)
|
55
53
|
rack
|
56
54
|
rack-test (0.6.1)
|
57
55
|
rack (>= 1.0)
|
58
|
-
railties (3.
|
59
|
-
actionpack (= 3.
|
60
|
-
activesupport (= 3.
|
56
|
+
railties (3.2.3)
|
57
|
+
actionpack (= 3.2.3)
|
58
|
+
activesupport (= 3.2.3)
|
61
59
|
rack-ssl (~> 1.3.2)
|
62
60
|
rake (>= 0.8.7)
|
63
61
|
rdoc (~> 3.4)
|
64
62
|
thor (~> 0.14.6)
|
65
63
|
rake (0.9.2)
|
66
|
-
rdoc (3.
|
67
|
-
|
68
|
-
|
69
|
-
rspec-
|
70
|
-
rspec-
|
71
|
-
|
72
|
-
rspec-
|
73
|
-
|
74
|
-
|
75
|
-
|
64
|
+
rdoc (3.12)
|
65
|
+
json (~> 1.4)
|
66
|
+
rspec (2.9.0)
|
67
|
+
rspec-core (~> 2.9.0)
|
68
|
+
rspec-expectations (~> 2.9.0)
|
69
|
+
rspec-mocks (~> 2.9.0)
|
70
|
+
rspec-core (2.9.0)
|
71
|
+
rspec-expectations (2.9.1)
|
72
|
+
diff-lcs (~> 1.1.3)
|
73
|
+
rspec-mocks (2.9.0)
|
74
|
+
sprockets (2.1.3)
|
76
75
|
hike (~> 1.2)
|
77
76
|
rack (~> 1.0)
|
78
|
-
tilt (
|
79
|
-
stratify-base (0.1.
|
80
|
-
bson_ext (~> 1.
|
81
|
-
mongoid (~> 2.0
|
77
|
+
tilt (~> 1.1, != 1.3.0)
|
78
|
+
stratify-base (0.1.4)
|
79
|
+
bson_ext (~> 1.6.0)
|
80
|
+
mongoid (~> 2.4.0)
|
82
81
|
tilt (~> 1.3.2)
|
83
82
|
thor (0.14.6)
|
84
83
|
thoughtafter-simple-rss (1.2.3.3)
|
85
84
|
tilt (1.3.3)
|
86
|
-
tzinfo (0.3.
|
85
|
+
tzinfo (0.3.33)
|
87
86
|
vcr (1.10.0)
|
88
87
|
|
89
88
|
PLATFORMS
|
90
89
|
ruby
|
91
90
|
|
92
91
|
DEPENDENCIES
|
93
|
-
database_cleaner (~> 0.
|
92
|
+
database_cleaner (~> 0.7.2)
|
94
93
|
fakeweb (~> 1.3.0)
|
95
|
-
|
94
|
+
rake (~> 0.9.2)
|
95
|
+
rspec (~> 2.9.0)
|
96
96
|
stratify-garmin!
|
97
97
|
vcr (~> 1.10.0)
|
data/LICENSE
CHANGED
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
17
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
18
18
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
19
19
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
data/Rakefile
CHANGED
Binary file
|
Binary file
|
@@ -6,7 +6,7 @@ module Stratify
|
|
6
6
|
module Garmin
|
7
7
|
class Collector < Stratify::Collector
|
8
8
|
source "Garmin"
|
9
|
-
|
9
|
+
|
10
10
|
configuration_fields :rss_url => {:type => :string, :label => "RSS URL"}
|
11
11
|
|
12
12
|
configuration_instructions %q[
|
@@ -52,7 +52,7 @@ module Stratify
|
|
52
52
|
:starting_longitude => adapter.starting_longitude,
|
53
53
|
:guid => adapter.guid,
|
54
54
|
:created_at => adapter.created_at
|
55
|
-
)
|
55
|
+
)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -2,15 +2,15 @@ module Stratify
|
|
2
2
|
module Garmin
|
3
3
|
class Presenter
|
4
4
|
delegate :title, :activity_type, :description, :to => :@activity
|
5
|
-
|
5
|
+
|
6
6
|
def initialize(activity)
|
7
7
|
@activity = activity
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
def summary
|
11
11
|
"#{activity_type}: #{title}"
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def details
|
15
15
|
join_fields_with_separator distance, time, description
|
16
16
|
end
|
@@ -24,13 +24,13 @@ module Stratify
|
|
24
24
|
seconds = @activity.time_in_seconds % 60
|
25
25
|
"#{minutes} minutes, #{seconds} seconds"
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
private
|
29
|
-
|
29
|
+
|
30
30
|
def separator
|
31
31
|
"\u2022"
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def join_fields_with_separator(*fields)
|
35
35
|
fields.reject(&:blank?).join(" #{separator} ")
|
36
36
|
end
|
@@ -4,7 +4,7 @@ module Stratify
|
|
4
4
|
module Garmin
|
5
5
|
class RssItemAdapter
|
6
6
|
attr_reader :item
|
7
|
-
|
7
|
+
|
8
8
|
def initialize(item)
|
9
9
|
@item = item
|
10
10
|
end
|
@@ -30,7 +30,7 @@ module Stratify
|
|
30
30
|
elevation_gain_string = description_content_in_table_row(8)
|
31
31
|
elevation_gain_string.to_i
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def event_type
|
35
35
|
description_content_in_table_row(5)
|
36
36
|
end
|
@@ -68,11 +68,11 @@ module Stratify
|
|
68
68
|
def description_as_nokogiri_doc
|
69
69
|
@description_doc ||= Nokogiri::HTML(item.description)
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
72
|
def description_content_in_table_row(row_index)
|
73
73
|
description_as_nokogiri_doc.at_xpath("//table/tr[#{row_index}]/td[2]").content
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
def starting_location
|
77
77
|
lat_long_pair_as_strings = item.georss_point.split
|
78
78
|
lat_long_pair_as_floats = lat_long_pair_as_strings.map(&:to_f)
|
@@ -12,7 +12,7 @@ describe Stratify::Garmin::Presenter do
|
|
12
12
|
describe "details" do
|
13
13
|
it "provides the activity's distance, time, and description" do
|
14
14
|
activity = Stratify::Garmin::Activity.new(
|
15
|
-
:distance_in_miles => 7,
|
15
|
+
:distance_in_miles => 7,
|
16
16
|
:time_in_seconds => 3613,
|
17
17
|
:description => "77 degrees and sunny"
|
18
18
|
)
|
@@ -22,7 +22,7 @@ describe Stratify::Garmin::Presenter do
|
|
22
22
|
|
23
23
|
it "provides only the activity's distance and time when the description is blank" do
|
24
24
|
activity = Stratify::Garmin::Activity.new(
|
25
|
-
:distance_in_miles => 7,
|
25
|
+
:distance_in_miles => 7,
|
26
26
|
:time_in_seconds => 3613,
|
27
27
|
:description => ""
|
28
28
|
)
|
data/stratify-garmin.gemspec
CHANGED
@@ -20,12 +20,13 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
22
|
s.add_runtime_dependency "nokogiri", "~> 1.4.4"
|
23
|
-
s.add_runtime_dependency "railties", "~> 3.
|
24
|
-
s.add_runtime_dependency "stratify-base", "~> 0.1.
|
23
|
+
s.add_runtime_dependency "railties", "~> 3.2.0"
|
24
|
+
s.add_runtime_dependency "stratify-base", "~> 0.1.4"
|
25
25
|
s.add_runtime_dependency "thoughtafter-simple-rss", "~> 1.2.3"
|
26
26
|
|
27
|
-
s.add_development_dependency "database_cleaner", "~> 0.
|
27
|
+
s.add_development_dependency "database_cleaner", "~> 0.7.2"
|
28
28
|
s.add_development_dependency "fakeweb", "~> 1.3.0"
|
29
|
-
s.add_development_dependency "
|
29
|
+
s.add_development_dependency "rake", "~> 0.9.2"
|
30
|
+
s.add_development_dependency "rspec", "~> 2.9.0"
|
30
31
|
s.add_development_dependency "vcr", "~> 1.10.0"
|
31
32
|
end
|
data/vcr_cassettes/garmin.yml
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
---
|
2
|
-
- !ruby/struct:VCR::HTTPInteraction
|
3
|
-
request: !ruby/struct:VCR::Request
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
4
|
method: :get
|
5
5
|
uri: http://connect.garmin.com:80/feed/rss/activities?feedname=Garmin%20Connect%20-%20johndoe&owner=johndoe
|
6
|
-
body:
|
7
|
-
headers:
|
8
|
-
response: !ruby/struct:VCR::Response
|
9
|
-
status: !ruby/struct:VCR::ResponseStatus
|
6
|
+
body:
|
7
|
+
headers:
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
10
|
code: 200
|
11
11
|
message: OK
|
12
|
-
headers:
|
13
|
-
server:
|
12
|
+
headers:
|
13
|
+
server:
|
14
14
|
- Apache/2.2.14 (Ubuntu)
|
15
|
-
pragma:
|
15
|
+
pragma:
|
16
16
|
- no-cache
|
17
|
-
content-type:
|
17
|
+
content-type:
|
18
18
|
- text/xml;charset=UTF-8
|
19
|
-
cache-control:
|
19
|
+
cache-control:
|
20
20
|
- private, no-cache, no-store, must-revalidate
|
21
|
-
expires:
|
21
|
+
expires:
|
22
22
|
- Fri, 15 Jul 2011 21:04:16 GMT
|
23
|
-
date:
|
23
|
+
date:
|
24
24
|
- Fri, 15 Jul 2011 21:04:16 GMT
|
25
|
-
content-length:
|
25
|
+
content-length:
|
26
26
|
- "14243"
|
27
|
-
connection:
|
27
|
+
connection:
|
28
28
|
- keep-alive
|
29
29
|
body: |
|
30
30
|
<?xml version="1.0" encoding="UTF-8"?>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stratify-garmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-04-29 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &70134215580900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,32 +21,32 @@ dependencies:
|
|
21
21
|
version: 1.4.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70134215580900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: railties
|
27
|
-
requirement: &
|
27
|
+
requirement: &70134215563320 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 3.
|
32
|
+
version: 3.2.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70134215563320
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: stratify-base
|
38
|
-
requirement: &
|
38
|
+
requirement: &70134215552740 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.1.
|
43
|
+
version: 0.1.4
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70134215552740
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: thoughtafter-simple-rss
|
49
|
-
requirement: &
|
49
|
+
requirement: &70134215546860 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,21 +54,21 @@ dependencies:
|
|
54
54
|
version: 1.2.3
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70134215546860
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: database_cleaner
|
60
|
-
requirement: &
|
60
|
+
requirement: &70134215541660 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.
|
65
|
+
version: 0.7.2
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70134215541660
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: fakeweb
|
71
|
-
requirement: &
|
71
|
+
requirement: &70134215536960 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,21 +76,32 @@ dependencies:
|
|
76
76
|
version: 1.3.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70134215536960
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rake
|
82
|
+
requirement: &70134215661900 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ~>
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 0.9.2
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70134215661900
|
80
91
|
- !ruby/object:Gem::Dependency
|
81
92
|
name: rspec
|
82
|
-
requirement: &
|
93
|
+
requirement: &70134215832840 !ruby/object:Gem::Requirement
|
83
94
|
none: false
|
84
95
|
requirements:
|
85
96
|
- - ~>
|
86
97
|
- !ruby/object:Gem::Version
|
87
|
-
version: 2.
|
98
|
+
version: 2.9.0
|
88
99
|
type: :development
|
89
100
|
prerelease: false
|
90
|
-
version_requirements: *
|
101
|
+
version_requirements: *70134215832840
|
91
102
|
- !ruby/object:Gem::Dependency
|
92
103
|
name: vcr
|
93
|
-
requirement: &
|
104
|
+
requirement: &70134215855560 !ruby/object:Gem::Requirement
|
94
105
|
none: false
|
95
106
|
requirements:
|
96
107
|
- - ~>
|
@@ -98,7 +109,7 @@ dependencies:
|
|
98
109
|
version: 1.10.0
|
99
110
|
type: :development
|
100
111
|
prerelease: false
|
101
|
-
version_requirements: *
|
112
|
+
version_requirements: *70134215855560
|
102
113
|
description: Garmin Connect plugin for Stratify
|
103
114
|
email:
|
104
115
|
- jason@jasonrudolph.com
|