evva 0.1.4.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -2
- data/.rspec +0 -1
- data/.rubocop_todo.yml +10 -10
- data/.travis.yml +1 -0
- data/Gemfile +9 -8
- data/Gemfile.lock +7 -11
- data/README.md +10 -0
- data/Rakefile +9 -0
- data/changelog.md +19 -2
- data/evva.gemspec +0 -3
- data/evva_config.yml +7 -3
- data/lib/evva/{mixpanel_enum.rb → analytics_enum.rb} +1 -1
- data/lib/evva/{mixpanel_event.rb → analytics_event.rb} +1 -1
- data/lib/evva/android_generator.rb +88 -69
- data/lib/evva/config.rb +13 -2
- data/lib/evva/google_sheet.rb +49 -46
- data/lib/evva/swift_generator.rb +44 -33
- data/lib/evva/version.rb +2 -2
- data/lib/evva.rb +7 -9
- data/spec/evva_spec.rb +1 -1
- data/spec/fixtures/sample_public_enums.csv +3 -0
- data/spec/fixtures/sample_public_events.csv +4 -0
- data/spec/fixtures/sample_public_people_properties.csv +3 -0
- data/spec/fixtures/test.yml +7 -4
- data/spec/lib/evva/android_generator_spec.rb +125 -116
- data/spec/lib/evva/config_spec.rb +8 -4
- data/spec/lib/evva/google_sheet_spec.rb +44 -74
- data/spec/lib/evva/swift_generator_spec.rb +100 -69
- metadata +10 -40
- data/lib/evva/data_source.rb +0 -23
- data/spec/fixtures/sample_public_enums.html +0 -1
- data/spec/fixtures/sample_public_info.html +0 -1
- data/spec/fixtures/sample_public_people_properties.html +0 -1
- data/spec/fixtures/sample_public_sheet.html +0 -1
- data/spec/lib/evva/data_source_spec.rb +0 -28
@@ -1,107 +1,77 @@
|
|
1
1
|
describe Evva::GoogleSheet do
|
2
|
-
let(:sheet) { Evva::GoogleSheet.new(
|
3
|
-
|
4
|
-
let(:
|
5
|
-
let(:
|
6
|
-
let(:enum_sheet) { "https://
|
7
|
-
let(:
|
8
|
-
let(:
|
9
|
-
let(:
|
10
|
-
|
11
|
-
|
2
|
+
let(:sheet) { Evva::GoogleSheet.new(events_sheet, people_sheet, enum_sheet) }
|
3
|
+
|
4
|
+
let(:events_sheet) { "https://wtvr1" }
|
5
|
+
let(:people_sheet) { "https://wtvr2" }
|
6
|
+
let(:enum_sheet) { "https://wtvr3" }
|
7
|
+
let(:events_file) { File.read('spec/fixtures/sample_public_events.csv') }
|
8
|
+
let(:people_file) { File.read('spec/fixtures/sample_public_people_properties.csv') }
|
9
|
+
let(:enum_file) { File.read('spec/fixtures/sample_public_enums.csv') }
|
10
|
+
|
11
|
+
before do
|
12
|
+
stub_request(:get, events_sheet).to_return(status: 200, body: events_file, headers: {})
|
13
|
+
stub_request(:get, people_sheet).to_return(status: 200, body: people_file, headers: {})
|
14
|
+
stub_request(:get, enum_sheet).to_return(status: 200, body: enum_file, headers: {})
|
15
|
+
end
|
12
16
|
|
13
17
|
describe '#events' do
|
14
18
|
subject(:events) { sheet.events }
|
15
|
-
before do
|
16
|
-
stub_request(:get, url_info).to_return(status: 200, body: file_info, headers: {})
|
17
|
-
stub_request(:get, url_sheet).to_return(status: 200, body: file_sheet, headers: {})
|
18
|
-
end
|
19
|
-
|
20
|
-
context 'when given a valid sheet' do
|
21
|
-
it do
|
22
|
-
expect { events }.not_to raise_error
|
23
|
-
end
|
24
19
|
|
25
|
-
|
26
|
-
|
27
|
-
Evva::MixpanelEvent.new('nav_feed_tap', {}),
|
28
|
-
Evva::MixpanelEvent.new('cp_view_scorecard', { course_id: 'Long', course_name: 'String' })]
|
29
|
-
expect(events).to eq(expected)
|
30
|
-
end
|
20
|
+
it do
|
21
|
+
expect { events }.not_to raise_error
|
31
22
|
end
|
32
23
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
24
|
+
it 'returns an array with the corresponding events' do
|
25
|
+
expected = [Evva::AnalyticsEvent.new('cp_page_view', { course_id: 'Long', course_name: 'String' }),
|
26
|
+
Evva::AnalyticsEvent.new('nav_feed_tap', {}),
|
27
|
+
Evva::AnalyticsEvent.new('cp_view_scorecard', { course_id: 'Long', course_name: 'String' })]
|
28
|
+
expect(events).to eq(expected)
|
39
29
|
end
|
40
30
|
|
41
|
-
context
|
42
|
-
before { stub_request(:get,
|
31
|
+
context "when given an inexistent sheet" do
|
32
|
+
before { stub_request(:get, events_sheet).to_return(status: 400, body: "Not Found", headers: {}) }
|
43
33
|
|
44
34
|
it do
|
45
|
-
expect { events }.to raise_error /
|
35
|
+
expect { events }.to raise_error /Http Error/
|
46
36
|
end
|
47
37
|
end
|
48
38
|
|
49
|
-
context
|
50
|
-
before { stub_request(:get,
|
39
|
+
context "when url content is not CSV" do
|
40
|
+
before { stub_request(:get, events_sheet).to_return(status: 200, body: "{\"asdsa\": \"This is a json\"}", headers: {}) }
|
51
41
|
|
52
42
|
it do
|
53
|
-
expect { events }.to raise_error /Cannot parse. Expected
|
43
|
+
expect { events }.to raise_error /Cannot parse. Expected CSV/
|
54
44
|
end
|
55
45
|
end
|
56
46
|
end
|
57
47
|
|
58
|
-
describe '#
|
59
|
-
subject(:
|
60
|
-
let(:expected_enum) do
|
61
|
-
[
|
62
|
-
Evva::MixpanelEnum.new('PageViewSourceScreen', ['course_discovery','synced_courses','nearby','deal']),
|
63
|
-
Evva::MixpanelEnum.new('PremiumClickBuy', ['notes','hi_res_maps','whatever'])
|
64
|
-
]
|
65
|
-
end
|
66
|
-
|
67
|
-
context 'when given a valid sheet' do
|
68
|
-
before do
|
69
|
-
stub_request(:get, url_info).to_return(status: 200, body: file_info, headers: {})
|
70
|
-
stub_request(:get, enum_sheet).to_return(status: 200, body: enum_file, headers: {})
|
71
|
-
end
|
72
|
-
|
73
|
-
it do
|
74
|
-
expect { enum_classes }.not_to raise_error
|
75
|
-
end
|
48
|
+
describe '#people_properties' do
|
49
|
+
subject(:people_properties) { sheet.people_properties }
|
76
50
|
|
77
|
-
|
78
|
-
|
79
|
-
end
|
51
|
+
it do
|
52
|
+
expect { people_properties }.not_to raise_error
|
80
53
|
end
|
81
|
-
end
|
82
54
|
|
83
|
-
|
84
|
-
|
85
|
-
let(:expected_people_properties) do
|
86
|
-
[
|
55
|
+
it 'returns an array with the corresponding events' do
|
56
|
+
expect(people_properties).to eq [
|
87
57
|
'rounds_with_wear',
|
88
58
|
'total_friends'
|
89
59
|
]
|
90
60
|
end
|
61
|
+
end
|
91
62
|
|
92
|
-
|
93
|
-
|
94
|
-
stub_request(:get, url_info).to_return(status: 200, body: file_info, headers: {})
|
95
|
-
stub_request(:get, people_sheet).to_return(status: 200, body: people_file, headers: {})
|
96
|
-
end
|
63
|
+
describe '#enum_classes' do
|
64
|
+
subject(:enum_classes) { sheet.enum_classes }
|
97
65
|
|
98
|
-
|
99
|
-
|
100
|
-
|
66
|
+
it do
|
67
|
+
expect { enum_classes }.not_to raise_error
|
68
|
+
end
|
101
69
|
|
102
|
-
|
103
|
-
|
104
|
-
|
70
|
+
it 'returns an array with the corresponding events' do
|
71
|
+
expect(enum_classes).to eq [
|
72
|
+
Evva::AnalyticsEnum.new('PageViewSourceScreen', ['course_discovery','synced_courses','nearby','deal']),
|
73
|
+
Evva::AnalyticsEnum.new('PremiumClickBuy', ['notes','hi_res_maps','whatever'])
|
74
|
+
]
|
105
75
|
end
|
106
76
|
end
|
107
77
|
end
|
@@ -1,94 +1,125 @@
|
|
1
1
|
describe Evva::SwiftGenerator do
|
2
2
|
let(:generator) { described_class.new }
|
3
3
|
|
4
|
-
def trim_spaces(str)
|
5
|
-
str.gsub(/^[ \t]+/, '')
|
6
|
-
.gsub(/[ \t]+$/, '')
|
7
|
-
end
|
8
|
-
|
9
4
|
describe '#events' do
|
10
|
-
subject {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
case trackCpPageView(course_id: Long, course_name: String?)
|
24
|
-
}
|
25
|
-
|
26
|
-
private var data: EventData {
|
27
|
-
switch self {
|
5
|
+
subject { generator.events(event_bundle, "") }
|
6
|
+
|
7
|
+
let(:event_bundle) { [
|
8
|
+
Evva::AnalyticsEvent.new('cp_page_view'),
|
9
|
+
Evva::AnalyticsEvent.new('cp_page_view_a', { course_id: 'Long', course_name: 'String' }),
|
10
|
+
Evva::AnalyticsEvent.new('cp_page_view_b', { course_id: 'Long', course_name: 'String', from_screen: 'CourseProfileSource' }),
|
11
|
+
Evva::AnalyticsEvent.new('cp_page_view_c', { course_id: 'Long', course_name: 'String', from_screen: 'CourseProfileSource?' }),
|
12
|
+
Evva::AnalyticsEvent.new('cp_page_view_d', { course_id: 'Long?', course_name: 'String' })
|
13
|
+
] }
|
14
|
+
|
15
|
+
let(:expected) {
|
16
|
+
<<-Swift
|
17
|
+
// This file was automatically generated by evva: https://github.com/hole19/evva
|
28
18
|
|
29
|
-
|
30
|
-
return EventData(name:"nav_feed_tap")
|
19
|
+
import Foundation
|
31
20
|
|
32
|
-
|
33
|
-
|
34
|
-
|
21
|
+
extension Analytics {
|
22
|
+
|
23
|
+
enum Event {
|
24
|
+
case cpPageView
|
25
|
+
case cpPageViewA(course_id: Int, course_name: String)
|
26
|
+
case cpPageViewB(course_id: Int, course_name: String, from_screen: CourseProfileSource)
|
27
|
+
case cpPageViewC(course_id: Int, course_name: String, from_screen: CourseProfileSource?)
|
28
|
+
case cpPageViewD(course_id: Int?, course_name: String)
|
29
|
+
|
30
|
+
var data: EventData {
|
31
|
+
switch self {
|
32
|
+
case .cpPageView:
|
33
|
+
return EventData(name: "cp_page_view")
|
34
|
+
|
35
|
+
case .cpPageViewA(let course_id, let course_name):
|
36
|
+
return EventData(name: "cp_page_view_a", properties: [
|
37
|
+
"course_id": course_id as Any,
|
38
|
+
"course_name": course_name as Any ]
|
39
|
+
)
|
40
|
+
|
41
|
+
case .cpPageViewB(let course_id, let course_name, let from_screen):
|
42
|
+
return EventData(name: "cp_page_view_b", properties: [
|
43
|
+
"course_id": course_id as Any,
|
44
|
+
"course_name": course_name as Any,
|
45
|
+
"from_screen": from_screen.rawValue as Any ]
|
46
|
+
)
|
47
|
+
|
48
|
+
case .cpPageViewC(let course_id, let course_name, let from_screen):
|
49
|
+
return EventData(name: "cp_page_view_c", properties: [
|
50
|
+
"course_id": course_id as Any,
|
51
|
+
"course_name": course_name as Any,
|
52
|
+
"from_screen": from_screen?.rawValue as Any ]
|
53
|
+
)
|
54
|
+
|
55
|
+
case .cpPageViewD(let course_id, let course_name):
|
56
|
+
return EventData(name: "cp_page_view_d", properties: [
|
57
|
+
"course_id": course_id as Any,
|
58
|
+
"course_name": course_name as Any ]
|
59
|
+
)
|
60
|
+
}
|
35
61
|
}
|
36
|
-
Swift
|
37
62
|
}
|
38
|
-
|
63
|
+
}
|
64
|
+
Swift
|
65
|
+
}
|
66
|
+
|
67
|
+
it { should eq expected }
|
39
68
|
end
|
40
69
|
|
41
|
-
describe '#
|
42
|
-
|
43
|
-
let(:properties) { 'course_id:Long,course_name:String,from_screen: CourseProfileSource?' }
|
70
|
+
describe '#special_property_enums' do
|
71
|
+
subject { generator.special_property_enums(enums) }
|
44
72
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
73
|
+
let(:enums) { [
|
74
|
+
Evva::AnalyticsEnum.new('CourseProfileSource', ['course_discovery', 'synced_courses']),
|
75
|
+
Evva::AnalyticsEnum.new('PremiumFrom', ['Course Profile', 'Round Setup'])
|
76
|
+
] }
|
50
77
|
|
51
|
-
|
52
|
-
|
78
|
+
let(:expected) {
|
79
|
+
<<-Swift
|
80
|
+
// This file was automatically generated by evva: https://github.com/hole19/evva
|
53
81
|
|
54
|
-
|
55
|
-
expected = '"course_id": course_id, "course_name": course_name, "from_screen": from_screen.rawValue'
|
56
|
-
expect(generator.process_arguments(properties)).to eq expected
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
82
|
+
import Foundation
|
60
83
|
|
61
|
-
|
62
|
-
subject { trim_spaces(generator.special_property_enum(enum)) }
|
63
|
-
let(:enum) { Evva::MixpanelEnum.new('CourseProfileSource', 'course_discovery,synced_courses') }
|
64
|
-
let(:expected) { <<-Swift
|
65
|
-
import Foundation
|
84
|
+
extension Analytics {
|
66
85
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
86
|
+
enum CourseProfileSource: String {
|
87
|
+
case courseDiscovery = "course_discovery"
|
88
|
+
case syncedCourses = "synced_courses"
|
89
|
+
}
|
90
|
+
|
91
|
+
enum PremiumFrom: String {
|
92
|
+
case courseProfile = "Course Profile"
|
93
|
+
case roundSetup = "Round Setup"
|
94
|
+
}
|
95
|
+
}
|
96
|
+
Swift
|
97
|
+
}
|
73
98
|
|
74
|
-
it { should eq
|
99
|
+
it { should eq expected }
|
75
100
|
end
|
76
101
|
|
77
102
|
describe "#people_properties" do
|
78
|
-
subject {
|
103
|
+
subject { generator.people_properties(people_bundle, "") }
|
104
|
+
|
79
105
|
let(:people_bundle) { ['rounds_with_wear', 'friends_from_facebook'] }
|
80
|
-
let(:expected) { <<-Swift
|
81
|
-
fileprivate enum Counter: String {
|
82
|
-
case RoundsWithWear = "rounds_with_wear"
|
83
|
-
case FriendsFromFacebook = "friends_from_facebook"
|
84
106
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
107
|
+
let(:expected) {
|
108
|
+
<<-Swift
|
109
|
+
// This file was automatically generated by evva: https://github.com/hole19/evva
|
110
|
+
|
111
|
+
import Foundation
|
112
|
+
|
113
|
+
extension Analytics {
|
114
|
+
|
115
|
+
enum Property: String {
|
116
|
+
case roundsWithWear = "rounds_with_wear"
|
117
|
+
case friendsFromFacebook = "friends_from_facebook"
|
118
|
+
}
|
119
|
+
}
|
120
|
+
Swift
|
90
121
|
}
|
91
122
|
|
92
|
-
it { should eq
|
123
|
+
it { should eq expected }
|
93
124
|
end
|
94
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evva
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RicardoTrindade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|
@@ -38,34 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.7'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: xml-simple
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.1'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.1'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: webmock
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.20'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.20'
|
69
41
|
description: Evva generates all the analytics event tracking functions for you
|
70
42
|
email: ricardo.trindade743@gmail.com
|
71
43
|
executables:
|
@@ -76,35 +48,34 @@ files:
|
|
76
48
|
- ".gitignore"
|
77
49
|
- ".rspec"
|
78
50
|
- ".rubocop_todo.yml"
|
51
|
+
- ".travis.yml"
|
79
52
|
- Gemfile
|
80
53
|
- Gemfile.lock
|
81
54
|
- README.md
|
55
|
+
- Rakefile
|
82
56
|
- bin/evva
|
83
57
|
- changelog.md
|
84
58
|
- evva.gemspec
|
85
59
|
- evva_config.yml
|
86
60
|
- lib/evva.rb
|
61
|
+
- lib/evva/analytics_enum.rb
|
62
|
+
- lib/evva/analytics_event.rb
|
87
63
|
- lib/evva/android_generator.rb
|
88
64
|
- lib/evva/config.rb
|
89
|
-
- lib/evva/data_source.rb
|
90
65
|
- lib/evva/file_reader.rb
|
91
66
|
- lib/evva/google_sheet.rb
|
92
67
|
- lib/evva/logger.rb
|
93
|
-
- lib/evva/mixpanel_enum.rb
|
94
|
-
- lib/evva/mixpanel_event.rb
|
95
68
|
- lib/evva/object_extension.rb
|
96
69
|
- lib/evva/swift_generator.rb
|
97
70
|
- lib/evva/version.rb
|
98
71
|
- rubocop.yml
|
99
72
|
- spec/evva_spec.rb
|
100
|
-
- spec/fixtures/sample_public_enums.
|
101
|
-
- spec/fixtures/
|
102
|
-
- spec/fixtures/sample_public_people_properties.
|
103
|
-
- spec/fixtures/sample_public_sheet.html
|
73
|
+
- spec/fixtures/sample_public_enums.csv
|
74
|
+
- spec/fixtures/sample_public_events.csv
|
75
|
+
- spec/fixtures/sample_public_people_properties.csv
|
104
76
|
- spec/fixtures/test.yml
|
105
77
|
- spec/lib/evva/android_generator_spec.rb
|
106
78
|
- spec/lib/evva/config_spec.rb
|
107
|
-
- spec/lib/evva/data_source_spec.rb
|
108
79
|
- spec/lib/evva/google_sheet_spec.rb
|
109
80
|
- spec/lib/evva/logger_spec.rb
|
110
81
|
- spec/lib/evva/object_extension_spec.rb
|
@@ -129,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
100
|
- !ruby/object:Gem::Version
|
130
101
|
version: '0'
|
131
102
|
requirements: []
|
132
|
-
|
133
|
-
rubygems_version: 2.6.13
|
103
|
+
rubygems_version: 3.1.6
|
134
104
|
signing_key:
|
135
105
|
specification_version: 4
|
136
106
|
summary: An event generating service
|
data/lib/evva/data_source.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
module Evva
|
2
|
-
class DataSource
|
3
|
-
def initialize(keys)
|
4
|
-
unless keys.is_a?(Hash)
|
5
|
-
raise ArgumentError, "keys: expected Hash, got #{keys.class}"
|
6
|
-
end
|
7
|
-
|
8
|
-
keys.each do |property, v|
|
9
|
-
unless v.is_a?(Hash)
|
10
|
-
raise ArgumentError, "keys['#{property}']: expected Hash, got #{v.class}"
|
11
|
-
end
|
12
|
-
|
13
|
-
v.each do |key, v|
|
14
|
-
unless v.is_a?(String) || v.nil?
|
15
|
-
raise ArgumentError, "keys['#{property}']['#{key}']: expected String, got #{v.class}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
@keys = Hash[keys.map { |k, v| [k.downcase, v] }]
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gsx='http://schemas.google.com/spreadsheets/2006/extended'><id>https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/osju1vh/public/full</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>Enums</title><link rel='alternate' type='application/atom+xml' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/pubhtml'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/osju1vh/public/full'/><link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/osju1vh/public/full'/><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/osju1vh/public/full'/><author><name>ricardo.trindade</name><email>ricardo.trindade@hole19golf.com</email></author><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><entry><id>https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/osju1vh/public/full/cokwr</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>PageViewSourceScreen</title><content type='text'>values: course_discovery,synced_courses,nearby,deal</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/osju1vh/public/full/cokwr'/><gsx:enum>PageViewSourceScreen</gsx:enum><gsx:values>course_discovery,synced_courses,nearby,deal</gsx:values></entry><entry><id>https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/osju1vh/public/full/cpzh4</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>PremiumClickBuy</title><content type='text'>values: notes,hi_res_maps,whatever</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/osju1vh/public/full/cpzh4'/><gsx:enum>PremiumClickBuy</gsx:enum><gsx:values>notes,hi_res_maps,whatever</gsx:values></entry></feed>
|
@@ -1 +0,0 @@
|
|
1
|
-
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gs='http://schemas.google.com/spreadsheets/2006'><id>https://spreadsheets.google.com/feeds/worksheets/abcdefgh/public/full</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#worksheet'/><title type='text'>TestingEvva</title><link rel='alternate' type='application/atom+xml' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/abc1234567890/pubhtml'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/worksheets/abc1234567890/public/full'/><link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/worksheets/abc1234567890/public/full'/><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/worksheets/abc1234567890/public/full'/><author><name>ricardo.trindade</name><email>ricardo.trindade@hole19golf.com</email></author><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><entry><id>https://spreadsheets.google.com/feeds/worksheets/abc1234567890/public/full/od6</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#worksheet'/><title type='text'>Events</title><content type='text'>Events</content><link rel='http://schemas.google.com/spreadsheets/2006#listfeed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><link rel='http://schemas.google.com/spreadsheets/2006#cellsfeed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/cells/abc1234567890/od6/public/full'/><link rel='http://schemas.google.com/visualization/2008#visualizationApi' type='application/atom+xml' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/abc1234567890/gviz/tq?gid=0&pub=1'/><link rel='http://schemas.google.com/spreadsheets/2006#exportcsv' type='text/csv' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/abc1234567890/export?gid=0&format=csv'/><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/worksheets/abc1234567890/public/full/od6'/><gs:colCount>26</gs:colCount><gs:rowCount>1000</gs:rowCount></entry><entry><id>https://spreadsheets.google.com/feeds/worksheets/abc1234567890/public/full/ojyi830</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#worksheet'/><title type='text'>PeopleProperties</title><content type='text'>PeopleProperties</content><link rel='http://schemas.google.com/spreadsheets/2006#listfeed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/ojyi830/public/full'/><link rel='http://schemas.google.com/spreadsheets/2006#cellsfeed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/cells/abc1234567890/ojyi830/public/full'/><link rel='http://schemas.google.com/visualization/2008#visualizationApi' type='application/atom+xml' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/abc1234567890/gviz/tq?gid=1206814390&pub=1'/><link rel='http://schemas.google.com/spreadsheets/2006#exportcsv' type='text/csv' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/abc1234567890/export?gid=1206814390&format=csv'/><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/worksheets/abc1234567890/public/full/ojyi830'/><gs:colCount>26</gs:colCount><gs:rowCount>1000</gs:rowCount></entry><entry><id>https://spreadsheets.google.com/feeds/worksheets/abc1234567890/public/full/osju1vh</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#worksheet'/><title type='text'>Enums</title><content type='text'>Enums</content><link rel='http://schemas.google.com/spreadsheets/2006#listfeed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/osju1vh/public/full'/><link rel='http://schemas.google.com/spreadsheets/2006#cellsfeed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/cells/abc1234567890/osju1vh/public/full'/><link rel='http://schemas.google.com/visualization/2008#visualizationApi' type='application/atom+xml' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/abc1234567890/gviz/tq?gid=1726367271&pub=1'/><link rel='http://schemas.google.com/spreadsheets/2006#exportcsv' type='text/csv' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/abc1234567890/export?gid=1726367271&format=csv'/><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/worksheets/abc1234567890/public/full/osju1vh'/><gs:colCount>26</gs:colCount><gs:rowCount>1000</gs:rowCount></entry></feed>
|
@@ -1 +0,0 @@
|
|
1
|
-
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gsx='http://schemas.google.com/spreadsheets/2006/extended'><id>https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/ojyi830/public/full</id><updated>2017-09-06T13:27:41.023Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>PeopleProperties</title><link rel='alternate' type='application/atom+xml' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/pubhtml'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/ojyi830/public/full'/><link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/ojyi830/public/full'/><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/ojyi830/public/full'/><author><name>ricardo.trindade</name><email>ricardo.trindade@hole19golf.com</email></author><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><entry><id>https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/ojyi830/public/full/cokwr</id><updated>2017-09-06T13:27:41.023Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>roundsWithWear</title><content type='text'>value: rounds_with_wear</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/ojyi830/public/full/cokwr'/><gsx:properties>roundsWithWear</gsx:properties><gsx:value>rounds_with_wear</gsx:value></entry><entry><id>https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/ojyi830/public/full/cpzh4</id><updated>2017-09-06T13:27:41.023Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>totalFriends</title><content type='text'>value: total_friends</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/1LaJd68os3g_GFlerogC64grNIlXb2iukMznOvdml7A4/ojyi830/public/full/cpzh4'/><gsx:properties>totalFriends</gsx:properties><gsx:value>total_friends</gsx:value></entry></feed>
|
@@ -1 +0,0 @@
|
|
1
|
-
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gsx='http://schemas.google.com/spreadsheets/2006/extended'><id>https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>Events</title><link rel='alternate' type='application/atom+xml' href='https://docs.google.com/a/hole19golf.com/spreadsheets/d/abc1234567890/pubhtml'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><author><name>ricardo.trindade</name><email>ricardo.trindade@hole19golf.com</email></author><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><entry><id>https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cokwr</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>trackCpPageView</title><content type='text'>eventname: cp_page_view, props: course_id:Long,course_name:String</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cokwr'/><gsx:functionname>trackCpPageView</gsx:functionname><gsx:eventname>cp_page_view</gsx:eventname><gsx:props>course_id:Long,course_name:String</gsx:props></entry><entry><id>https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cpzh4</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>trackNavFeedTap</title><content type='text'>eventname: nav_feed_tap</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cpzh4'/><gsx:functionname>trackNavFeedTap</gsx:functionname><gsx:eventname>nav_feed_tap</gsx:eventname><gsx:props></gsx:props></entry><entry><id>https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cre1l</id><updated>2017-08-22T10:31:52.161Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>trackCpViewScorecard</title><content type='text'>eventname: cp_view_scorecard, props: course_id:Long,course_name:String</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cre1l'/><gsx:functionname>trackCpViewScorecard</gsx:functionname><gsx:eventname>cp_view_scorecard</gsx:eventname><gsx:props>course_id:Long,course_name:String</gsx:props></entry></feed>
|
@@ -1,28 +0,0 @@
|
|
1
|
-
describe Evva::DataSource do
|
2
|
-
subject(:dict) { Evva::DataSource.new(keys) }
|
3
|
-
|
4
|
-
describe '.initialize' do
|
5
|
-
let(:keys) { { 'event' => { 'kNo1' => 'text' } } }
|
6
|
-
it { expect { subject }.not_to raise_error }
|
7
|
-
|
8
|
-
context 'when created with invalid type parameters' do
|
9
|
-
let(:keys) { 'cenas' }
|
10
|
-
it { expect { subject }.to raise_error /expected Hash/ }
|
11
|
-
end
|
12
|
-
|
13
|
-
context 'when created with an invalid json schema' do
|
14
|
-
let(:keys) { { 'event' => 'text' } }
|
15
|
-
it { expect { subject }.to raise_error /event.+expected Hash/ }
|
16
|
-
end
|
17
|
-
|
18
|
-
context 'when created with an invalid json schema' do
|
19
|
-
let(:keys) { { 'a-event' => { 'kNo1' => { 'wtvr' => 'text' } } } }
|
20
|
-
it { expect { subject }.to raise_error /a-event.+kNo1.+expected String/ }
|
21
|
-
end
|
22
|
-
|
23
|
-
context 'when given empty translations' do
|
24
|
-
let(:keys) { { 'event' => { 'kNo1' => nil } } }
|
25
|
-
it { expect { subject }.not_to raise_error }
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|