evva 0.12.0 → 0.12.1
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 +2 -2
- data/README.md +10 -6
- data/changelog.md +5 -1
- data/lib/evva/google_sheet.rb +5 -3
- data/lib/evva/version.rb +2 -2
- data/spec/fixtures/sample_public_enums_multiline.csv +10 -0
- data/spec/lib/evva/google_sheet_spec.rb +56 -4
- metadata +8 -4
- /data/spec/fixtures/{sample_public_people_properties_multiselect.csv → sample_public_people_properties_spaced.csv} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d4b045c978a7b25e6d70bb351b98ca386b64562f370109568e08bff047998d81
|
|
4
|
+
data.tar.gz: 7929eb9fd1cae326d1f2d04d734ab4bb4bb6a37ff0ceede20b11f9d3ae35a7fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b230e781a153d3375a7d64b44a9e6e7f0804a25a78159dbb3e8f6e6e8e6e7b2dd36740c2c541fc5b3c34da87ec891d8cc026e6b49b79c958646799c5014ab75
|
|
7
|
+
data.tar.gz: ecd25a86c5374539dbd6fb2b6c1f7b3b0e94633260a3afb809bbf1d2261f8bab97e1fde29f530f0c31e587b61e31573cf62c17b21938a199af37cf4a9b629983
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
evva (0.12.
|
|
4
|
+
evva (0.12.1)
|
|
5
5
|
colorize (~> 1.0)
|
|
6
6
|
csv (~> 3.0)
|
|
7
7
|
safe_yaml (~> 1.0)
|
|
@@ -9,7 +9,7 @@ PATH
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
addressable (2.9.
|
|
12
|
+
addressable (2.9.1)
|
|
13
13
|
public_suffix (>= 2.0.2, < 8.0)
|
|
14
14
|
ast (2.4.3)
|
|
15
15
|
bigdecimal (3.3.1)
|
data/README.md
CHANGED
|
@@ -66,15 +66,19 @@ Evva automatically generates code for triggering events based on a Google Sheets
|
|
|
66
66
|
|
|
67
67
|
Blank lines, trailing commas and spaces around items or around `:` are ignored.
|
|
68
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
69
|
### Destinations
|
|
74
70
|
|
|
75
71
|
`Event Destination` (and `Property Destination` in the people properties sheet)
|
|
76
|
-
accepts the same separators, and spaces around each destination are ignored
|
|
77
|
-
|
|
72
|
+
accepts the same separators, and spaces around each destination are ignored.
|
|
73
|
+
A multi-select dropdown works too: Google's CSV export joins its values with a
|
|
74
|
+
plain comma (`mixpanel,braze`).
|
|
75
|
+
|
|
76
|
+
### Enum values
|
|
77
|
+
|
|
78
|
+
`Possible Values` in the enum classes sheet accepts the same separators: commas,
|
|
79
|
+
one value per line, or both. Spaces around each value are ignored, spaces inside a
|
|
80
|
+
value (`main app`) are kept. Each value is the exact string sent to analytics.
|
|
81
|
+
An enum with no values stops the run with an error naming it.
|
|
78
82
|
|
|
79
83
|
### Platform
|
|
80
84
|
|
data/changelog.md
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.12.1] - 2026-11-17
|
|
6
|
+
|
|
7
|
+
- Enum `Possible Values` accept the same separators as `Event Properties` (commas and/or one value per line) and trim spaces around each value; an enum with no values stops the run with an error naming it
|
|
8
|
+
|
|
5
9
|
## [0.12.0] - 2026-11-11
|
|
6
10
|
|
|
7
|
-
- `Event Properties` can be written one property per line (and mixed with commas); `Event Destination` and `Property Destination` trim spaces around each destination
|
|
11
|
+
- `Event Properties` can be written one property per line (and mixed with commas); `Event Destination` and `Property Destination` accept the same separators and trim spaces around each destination
|
|
8
12
|
|
|
9
13
|
## [0.11.0] - 2026-11-09
|
|
10
14
|
|
data/lib/evva/google_sheet.rb
CHANGED
|
@@ -63,7 +63,10 @@ module Evva
|
|
|
63
63
|
|
|
64
64
|
@enum_classes ||= @enum_classes_csv.map do |row|
|
|
65
65
|
enum_name = row[ENUM_NAME]
|
|
66
|
-
values = row[ENUM_VALUES]
|
|
66
|
+
values = list_parser(row[ENUM_VALUES])
|
|
67
|
+
# An enum with no cases is not valid Swift with a String raw type.
|
|
68
|
+
raise "Enum #{enum_name} has no #{ENUM_VALUES}" if values.empty?
|
|
69
|
+
|
|
67
70
|
Evva::AnalyticsEnum.new(enum_name, values)
|
|
68
71
|
end
|
|
69
72
|
end
|
|
@@ -119,8 +122,7 @@ module Evva
|
|
|
119
122
|
end
|
|
120
123
|
|
|
121
124
|
# 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.
|
|
123
|
-
# values with ", ", hence the strip.
|
|
125
|
+
# be written one item per line in the cell.
|
|
124
126
|
def list_parser(list)
|
|
125
127
|
list.to_s.split(/,|\r\n|\r|\n/).map(&:strip).reject(&:empty?)
|
|
126
128
|
end
|
data/lib/evva/version.rb
CHANGED
|
@@ -71,7 +71,7 @@ describe Evva::GoogleSheet do
|
|
|
71
71
|
|
|
72
72
|
{
|
|
73
73
|
"comma separated" => "mixpanel,braze",
|
|
74
|
-
"
|
|
74
|
+
"with a space after each comma" => "mixpanel, braze",
|
|
75
75
|
"one per line" => "mixpanel\nbraze",
|
|
76
76
|
"a trailing comma" => "mixpanel,braze,",
|
|
77
77
|
}.each do |description, cell|
|
|
@@ -233,10 +233,10 @@ describe Evva::GoogleSheet do
|
|
|
233
233
|
end
|
|
234
234
|
end
|
|
235
235
|
|
|
236
|
-
describe "#people_properties with
|
|
237
|
-
let(:people_file) { File.read("spec/fixtures/
|
|
236
|
+
describe "#people_properties with spaces in the destination cell" do
|
|
237
|
+
let(:people_file) { File.read("spec/fixtures/sample_public_people_properties_spaced.csv") }
|
|
238
238
|
|
|
239
|
-
it "trims the space
|
|
239
|
+
it "trims the space after each comma" do
|
|
240
240
|
expect(sheet.people_properties.first.destinations).to eq(["firebase", "custom destination"])
|
|
241
241
|
end
|
|
242
242
|
end
|
|
@@ -254,6 +254,58 @@ describe Evva::GoogleSheet do
|
|
|
254
254
|
Evva::AnalyticsEnum.new("PremiumClickBuy", ["notes","hi_res_maps","whatever"])
|
|
255
255
|
]
|
|
256
256
|
end
|
|
257
|
+
|
|
258
|
+
context "when values are written one per line, as exported by Google Sheets" do
|
|
259
|
+
let(:enum_file) { File.read("spec/fixtures/sample_public_enums_multiline.csv") }
|
|
260
|
+
|
|
261
|
+
it "parses the same values as the comma separated sheet" do
|
|
262
|
+
expect(enum_classes.map(&:values)).to eq [
|
|
263
|
+
["course_discovery", "synced_courses", "nearby", "deal"],
|
|
264
|
+
["notes", "hi_res_maps", "whatever"],
|
|
265
|
+
]
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
describe "a Possible Values cell" do
|
|
270
|
+
let(:enum_file) { %(Enum Name,Possible Values\nSomeEnum,"#{values}"\n) }
|
|
271
|
+
|
|
272
|
+
{
|
|
273
|
+
"comma separated" => "a,b",
|
|
274
|
+
"one per line" => "a\nb",
|
|
275
|
+
"one per line with CRLF" => "a\r\nb",
|
|
276
|
+
"mixed commas and line breaks" => "a,\nb",
|
|
277
|
+
"a trailing comma" => "a,b,",
|
|
278
|
+
"a trailing line break" => "a\nb\n",
|
|
279
|
+
"blank lines between values" => "a\n\nb",
|
|
280
|
+
"spaces around separators" => " a ,\n b ",
|
|
281
|
+
}.each do |description, cell|
|
|
282
|
+
context "written #{description}" do
|
|
283
|
+
let(:values) { cell }
|
|
284
|
+
|
|
285
|
+
it "parses the same values" do
|
|
286
|
+
expect(enum_classes.first.values).to eq(["a", "b"])
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
context "with spaces inside a value" do
|
|
292
|
+
let(:values) { "main app,No Scoring" }
|
|
293
|
+
|
|
294
|
+
it "keeps them" do
|
|
295
|
+
expect(enum_classes.first.values).to eq(["main app", "No Scoring"])
|
|
296
|
+
end
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
["", ",", "\n\n", " , "].each do |cell|
|
|
300
|
+
context "with no values (#{cell.inspect})" do
|
|
301
|
+
let(:values) { cell }
|
|
302
|
+
|
|
303
|
+
it "stops with an error naming the enum, instead of generating an enum Swift cannot compile" do
|
|
304
|
+
expect { enum_classes }.to raise_error("Enum SomeEnum has no Possible Values")
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
end
|
|
308
|
+
end
|
|
257
309
|
end
|
|
258
310
|
|
|
259
311
|
describe "#destinations" do
|
metadata
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: evva
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.12.
|
|
4
|
+
version: 0.12.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- André Andrade
|
|
8
8
|
- João Costa
|
|
9
9
|
- Ricardo Trindade
|
|
10
|
+
autorequire:
|
|
10
11
|
bindir: bin
|
|
11
12
|
cert_chain: []
|
|
12
|
-
date: 2026-11-
|
|
13
|
+
date: 2026-11-17 00:00:00.000000000 Z
|
|
13
14
|
dependencies:
|
|
14
15
|
- !ruby/object:Gem::Dependency
|
|
15
16
|
name: colorize
|
|
@@ -98,12 +99,13 @@ files:
|
|
|
98
99
|
- lib/evva/version.rb
|
|
99
100
|
- spec/evva_spec.rb
|
|
100
101
|
- spec/fixtures/sample_public_enums.csv
|
|
102
|
+
- spec/fixtures/sample_public_enums_multiline.csv
|
|
101
103
|
- spec/fixtures/sample_public_enums_with_platform.csv
|
|
102
104
|
- spec/fixtures/sample_public_events.csv
|
|
103
105
|
- spec/fixtures/sample_public_events_multiline.csv
|
|
104
106
|
- spec/fixtures/sample_public_events_with_platform.csv
|
|
105
107
|
- spec/fixtures/sample_public_people_properties.csv
|
|
106
|
-
- spec/fixtures/
|
|
108
|
+
- spec/fixtures/sample_public_people_properties_spaced.csv
|
|
107
109
|
- spec/fixtures/test.yml
|
|
108
110
|
- spec/lib/evva/config_spec.rb
|
|
109
111
|
- spec/lib/evva/google_sheet_spec.rb
|
|
@@ -117,6 +119,7 @@ homepage: https://github.com/hole19/
|
|
|
117
119
|
licenses:
|
|
118
120
|
- MIT
|
|
119
121
|
metadata: {}
|
|
122
|
+
post_install_message:
|
|
120
123
|
rdoc_options: []
|
|
121
124
|
require_paths:
|
|
122
125
|
- lib
|
|
@@ -131,7 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
131
134
|
- !ruby/object:Gem::Version
|
|
132
135
|
version: '0'
|
|
133
136
|
requirements: []
|
|
134
|
-
rubygems_version:
|
|
137
|
+
rubygems_version: 3.5.3
|
|
138
|
+
signing_key:
|
|
135
139
|
specification_version: 4
|
|
136
140
|
summary: An event generating service
|
|
137
141
|
test_files: []
|
|
File without changes
|