evva 0.11.0 → 0.12.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +25 -1
- data/changelog.md +4 -0
- data/lib/evva/google_sheet.rb +16 -11
- data/lib/evva/version.rb +2 -2
- data/spec/fixtures/sample_public_events_multiline.csv +10 -0
- data/spec/fixtures/sample_public_people_properties_multiselect.csv +4 -0
- data/spec/lib/evva/google_sheet_spec.rb +71 -0
- metadata +5 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 945fb4d07c2dc210b99bf3c55d982c11d4c1c1c7307c7490d205149cc86dc831
|
|
4
|
+
data.tar.gz: '0781922206107e696a41f94cd15382af80be989c29f03f72dc6b65a5a6453645'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0e9b3fff1aec327f2444a1d6b989bc84b38d96aa0a7d691702b3cc81a2eb7b177ba059ab12aa9c620d54c4488cdf11acda28afa4779c415bc6791cf36ff8f0d4
|
|
7
|
+
data.tar.gz: 7bfb6cf627c14722c27f77339c6211116a73cc67edd28a28baef17f1f802a99c2ded603d5e4ddd6a9939c742feb77262e1445f926026eb332e7edf79f4219f6b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -48,10 +48,34 @@ Evva automatically generates code for triggering events based on a Google Sheets
|
|
|
48
48
|
| Column | Required | Meaning |
|
|
49
49
|
| --- | --- | --- |
|
|
50
50
|
| `Event Name` | yes | The event name |
|
|
51
|
-
| `Event Properties` | no |
|
|
51
|
+
| `Event Properties` | no | `name:Type` pairs, comma separated or one per line |
|
|
52
52
|
| `Event Destination` | no | Comma separated destinations |
|
|
53
53
|
| `Platform` | no | Which platforms track the event |
|
|
54
54
|
|
|
55
|
+
### Event Properties
|
|
56
|
+
|
|
57
|
+
Properties can be separated by commas, by line breaks inside the cell, or both,
|
|
58
|
+
so a long list can be kept readable with one property per line (Option+Enter
|
|
59
|
+
on Mac, Alt+Enter on Windows):
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
handicap:Double?
|
|
63
|
+
playing_handicap:Int?
|
|
64
|
+
number_of_played_holes:Int
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Blank lines, trailing commas and spaces around items or around `:` are ignored.
|
|
68
|
+
|
|
69
|
+
Multi-line cells need evva 0.12.0 or newer. Older versions read the whole cell as
|
|
70
|
+
a single broken property, so only convert rows once every app generating from
|
|
71
|
+
the sheet has been updated.
|
|
72
|
+
|
|
73
|
+
### Destinations
|
|
74
|
+
|
|
75
|
+
`Event Destination` (and `Property Destination` in the people properties sheet)
|
|
76
|
+
accepts the same separators, and spaces around each destination are ignored, so
|
|
77
|
+
the cell can be a multi-select dropdown, which writes values as `mixpanel, braze`.
|
|
78
|
+
|
|
55
79
|
### Platform
|
|
56
80
|
|
|
57
81
|
`Platform` tags an event with the platforms it belongs to. Filtering is driven
|
data/changelog.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.12.0] - 2026-11-11
|
|
6
|
+
|
|
7
|
+
- `Event Properties` can be written one property per line (and mixed with commas); `Event Destination` and `Property Destination` trim spaces around each destination, so a multi-select dropdown (`mixpanel, braze`) works
|
|
8
|
+
|
|
5
9
|
## [0.11.0] - 2026-11-09
|
|
6
10
|
|
|
7
11
|
- **Breaking:** Kotlin enum constants (events, people properties, special property enums and destinations) are now generated in PascalCase, e.g. `RoundStarted` instead of `ROUND_STARTED`. The `key` values are unchanged
|
data/lib/evva/google_sheet.rb
CHANGED
|
@@ -34,9 +34,9 @@ module Evva
|
|
|
34
34
|
@events_csv.map do |row|
|
|
35
35
|
event_name = row[EVENT_NAME]
|
|
36
36
|
properties = hash_parser(row[EVENT_PROPERTIES])
|
|
37
|
-
destinations = row[EVENT_DESTINATION]
|
|
37
|
+
destinations = list_parser(row[EVENT_DESTINATION])
|
|
38
38
|
platforms = platform_parser(platform_header && row[platform_header])
|
|
39
|
-
Evva::AnalyticsEvent.new(event_name, properties, destinations
|
|
39
|
+
Evva::AnalyticsEvent.new(event_name, properties, destinations, platforms)
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
end
|
|
@@ -50,8 +50,8 @@ module Evva
|
|
|
50
50
|
@people_properties ||= @people_properties_csv.map do |row|
|
|
51
51
|
property_name = row[PROPERTY_NAME]
|
|
52
52
|
property_type = row[PROPERTY_TYPE]
|
|
53
|
-
destinations = row[PROPERTY_DESTINATION]
|
|
54
|
-
Evva::AnalyticsProperty.new(property_name, property_type, destinations
|
|
53
|
+
destinations = list_parser(row[PROPERTY_DESTINATION])
|
|
54
|
+
Evva::AnalyticsProperty.new(property_name, property_type, destinations)
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
@@ -118,15 +118,20 @@ module Evva
|
|
|
118
118
|
tokens.map(&:downcase).uniq
|
|
119
119
|
end
|
|
120
120
|
|
|
121
|
+
# Items may be separated by commas, line breaks, or both, so a long list can
|
|
122
|
+
# be written one item per line in the cell. A multi-select dropdown joins its
|
|
123
|
+
# values with ", ", hence the strip.
|
|
124
|
+
def list_parser(list)
|
|
125
|
+
list.to_s.split(/,|\r\n|\r|\n/).map(&:strip).reject(&:empty?)
|
|
126
|
+
end
|
|
127
|
+
|
|
121
128
|
def hash_parser(property_array)
|
|
122
129
|
h = {}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
h[prop_name] = prop_type
|
|
129
|
-
end
|
|
130
|
+
list_parser(property_array).each do |prop|
|
|
131
|
+
split_prop = prop.split(":")
|
|
132
|
+
prop_name = split_prop[0].strip.to_sym
|
|
133
|
+
prop_type = split_prop[1].to_s.strip
|
|
134
|
+
h[prop_name] = prop_type
|
|
130
135
|
end
|
|
131
136
|
h
|
|
132
137
|
end
|
data/lib/evva/version.rb
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Event Name,Event Properties,Event Destination
|
|
2
|
+
cp_page_view,"course_id:Long
|
|
3
|
+
course_name:String","firebase, custom destination"
|
|
4
|
+
nav_feed_tap,,
|
|
5
|
+
cp_view_scorecard,"course_id:Long,
|
|
6
|
+
course_name:String
|
|
7
|
+
",custom destination
|
|
8
|
+
side_game_delete,"fromScreen: SideGameFromScreen
|
|
9
|
+
|
|
10
|
+
round_group_creation_token:String",firebase
|
|
@@ -31,6 +31,69 @@ describe Evva::GoogleSheet do
|
|
|
31
31
|
expect(events).to eq(expected)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
context "when list cells use line breaks, as exported by Google Sheets" do
|
|
35
|
+
let(:events_file) { File.read("spec/fixtures/sample_public_events_multiline.csv") }
|
|
36
|
+
|
|
37
|
+
it "reads each multi-line cell as one field and parses it like the comma separated sheet" do
|
|
38
|
+
comma_separated = Evva::GoogleSheet.new(events_sheet, people_sheet, enum_sheet)
|
|
39
|
+
stub_request(:get, events_sheet).to_return(status: 200, body: File.read("spec/fixtures/sample_public_events.csv"))
|
|
40
|
+
expected = comma_separated.events
|
|
41
|
+
|
|
42
|
+
stub_request(:get, events_sheet).to_return(status: 200, body: events_file)
|
|
43
|
+
expect(events).to eq(expected)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe "list cells" do
|
|
48
|
+
let(:events_file) { %(Event Name,Event Properties,Event Destination\nsome_event,"#{properties}","#{destinations}"\n) }
|
|
49
|
+
let(:properties) { "a:Int,b:String?" }
|
|
50
|
+
let(:destinations) { "mixpanel,braze" }
|
|
51
|
+
|
|
52
|
+
{
|
|
53
|
+
"comma separated" => "a:Int,b:String?",
|
|
54
|
+
"one per line" => "a:Int\nb:String?",
|
|
55
|
+
"one per line with CRLF" => "a:Int\r\nb:String?",
|
|
56
|
+
"one per line with CR" => "a:Int\rb:String?",
|
|
57
|
+
"mixed commas and line breaks" => "a:Int,\nb:String?",
|
|
58
|
+
"a trailing comma" => "a:Int,b:String?,",
|
|
59
|
+
"a trailing line break" => "a:Int\nb:String?\n",
|
|
60
|
+
"blank lines between items" => "a:Int\n\n\nb:String?",
|
|
61
|
+
"spaces around separators and colons" => " a : Int ,\n b: String? ",
|
|
62
|
+
}.each do |description, cell|
|
|
63
|
+
context "with event properties written with #{description}" do
|
|
64
|
+
let(:properties) { cell }
|
|
65
|
+
|
|
66
|
+
it "parses the same properties" do
|
|
67
|
+
expect(events.first.properties).to eq(a: "Int", b: "String?")
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
{
|
|
73
|
+
"comma separated" => "mixpanel,braze",
|
|
74
|
+
"as a multi-select dropdown (comma and space)" => "mixpanel, braze",
|
|
75
|
+
"one per line" => "mixpanel\nbraze",
|
|
76
|
+
"a trailing comma" => "mixpanel,braze,",
|
|
77
|
+
}.each do |description, cell|
|
|
78
|
+
context "with event destinations written #{description}" do
|
|
79
|
+
let(:destinations) { cell }
|
|
80
|
+
|
|
81
|
+
it "parses the same destinations" do
|
|
82
|
+
expect(events.first.destinations).to eq(["mixpanel", "braze"])
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
context "with empty cells" do
|
|
88
|
+
let(:events_file) { "Event Name,Event Properties,Event Destination\nsome_event,,\n" }
|
|
89
|
+
|
|
90
|
+
it "has no properties and no destinations" do
|
|
91
|
+
expect(events.first.properties).to eq({})
|
|
92
|
+
expect(events.first.destinations).to eq([])
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
34
97
|
context "when the sheet has no Platform column" do
|
|
35
98
|
it "leaves platforms as nil (unrestricted)" do
|
|
36
99
|
expect(events.map(&:platforms)).to all(be_nil)
|
|
@@ -170,6 +233,14 @@ describe Evva::GoogleSheet do
|
|
|
170
233
|
end
|
|
171
234
|
end
|
|
172
235
|
|
|
236
|
+
describe "#people_properties with a multi-select destination dropdown" do
|
|
237
|
+
let(:people_file) { File.read("spec/fixtures/sample_public_people_properties_multiselect.csv") }
|
|
238
|
+
|
|
239
|
+
it "trims the space the dropdown puts after each comma" do
|
|
240
|
+
expect(sheet.people_properties.first.destinations).to eq(["firebase", "custom destination"])
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
|
|
173
244
|
describe "#enum_classes" do
|
|
174
245
|
subject(:enum_classes) { sheet.enum_classes }
|
|
175
246
|
|
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: evva
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- André Andrade
|
|
8
8
|
- João Costa
|
|
9
9
|
- Ricardo Trindade
|
|
10
|
-
autorequire:
|
|
11
10
|
bindir: bin
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date: 2026-11-
|
|
12
|
+
date: 2026-11-11 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: colorize
|
|
@@ -101,8 +100,10 @@ files:
|
|
|
101
100
|
- spec/fixtures/sample_public_enums.csv
|
|
102
101
|
- spec/fixtures/sample_public_enums_with_platform.csv
|
|
103
102
|
- spec/fixtures/sample_public_events.csv
|
|
103
|
+
- spec/fixtures/sample_public_events_multiline.csv
|
|
104
104
|
- spec/fixtures/sample_public_events_with_platform.csv
|
|
105
105
|
- spec/fixtures/sample_public_people_properties.csv
|
|
106
|
+
- spec/fixtures/sample_public_people_properties_multiselect.csv
|
|
106
107
|
- spec/fixtures/test.yml
|
|
107
108
|
- spec/lib/evva/config_spec.rb
|
|
108
109
|
- spec/lib/evva/google_sheet_spec.rb
|
|
@@ -116,7 +117,6 @@ homepage: https://github.com/hole19/
|
|
|
116
117
|
licenses:
|
|
117
118
|
- MIT
|
|
118
119
|
metadata: {}
|
|
119
|
-
post_install_message:
|
|
120
120
|
rdoc_options: []
|
|
121
121
|
require_paths:
|
|
122
122
|
- lib
|
|
@@ -131,8 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
131
131
|
- !ruby/object:Gem::Version
|
|
132
132
|
version: '0'
|
|
133
133
|
requirements: []
|
|
134
|
-
rubygems_version:
|
|
135
|
-
signing_key:
|
|
134
|
+
rubygems_version: 4.0.10
|
|
136
135
|
specification_version: 4
|
|
137
136
|
summary: An event generating service
|
|
138
137
|
test_files: []
|