evva 0.7.0 → 0.8.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 +4 -4
- data/changelog.md +4 -0
- data/lib/evva/config.rb +7 -1
- data/lib/evva/version.rb +2 -2
- data/lib/evva.rb +9 -0
- data/spec/evva_spec.rb +34 -0
- data/spec/lib/evva/config_spec.rb +18 -0
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 285fa85e8d2a969dadead5a4bfd94bb021a88ed3ff535feaa6b77cba9af4c9dc
|
|
4
|
+
data.tar.gz: 4da0378727c38003b4dde074b8f50e6e9bc5203632eebbe47872e88ebb47d993
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4442aea2c03bd25decf75970b860561a4efd5217c0f2fcafadf43bef1e508747ce159c178566a4ba4662f7799edeb21bbe2385788d2c05ac8a33e9d001eda3fc
|
|
7
|
+
data.tar.gz: 1a8a8bf25a185da286ca30c29c6eaf5619849cbd60e777f489ba8e33c029be783a30c17286f3c31e9f3aabde2b4efbcc6342dfc8ac708985889c5285b40f2186
|
data/Gemfile.lock
CHANGED
|
@@ -9,8 +9,8 @@ PATH
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
addressable (2.
|
|
13
|
-
public_suffix (>= 2.0.2, <
|
|
12
|
+
addressable (2.9.0)
|
|
13
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
14
14
|
ast (2.4.3)
|
|
15
15
|
bigdecimal (3.3.1)
|
|
16
16
|
colorize (1.1.0)
|
|
@@ -21,7 +21,7 @@ GEM
|
|
|
21
21
|
diff-lcs (1.6.2)
|
|
22
22
|
docile (1.4.1)
|
|
23
23
|
hashdiff (1.2.1)
|
|
24
|
-
json (2.15.1)
|
|
24
|
+
json (2.15.2.1)
|
|
25
25
|
language_server-protocol (3.17.0.5)
|
|
26
26
|
lint_roller (1.1.0)
|
|
27
27
|
parallel (1.27.0)
|
|
@@ -29,7 +29,7 @@ GEM
|
|
|
29
29
|
ast (~> 2.4.1)
|
|
30
30
|
racc
|
|
31
31
|
prism (1.5.2)
|
|
32
|
-
public_suffix (
|
|
32
|
+
public_suffix (7.0.5)
|
|
33
33
|
racc (1.8.1)
|
|
34
34
|
rainbow (3.1.1)
|
|
35
35
|
rake (13.3.0)
|
data/changelog.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## [0.8.0] - 2026-05-26
|
|
6
|
+
|
|
7
|
+
- Add `exclude_destinations` configuration to filter out specific destinations from generated code
|
|
8
|
+
|
|
5
9
|
## [0.7.0] - 2026-04-07
|
|
6
10
|
|
|
7
11
|
- Add `swift_public` configuration which modifies the accessibility of all the Swift code extensions to `public`
|
data/lib/evva/config.rb
CHANGED
|
@@ -13,6 +13,7 @@ module Evva
|
|
|
13
13
|
if @hash.key?(:swift_public) && ![true, false].include?(@hash[:swift_public])
|
|
14
14
|
raise ArgumentError, "swift_public must be true or false"
|
|
15
15
|
end
|
|
16
|
+
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def to_h
|
|
@@ -63,6 +64,10 @@ module Evva
|
|
|
63
64
|
@hash[:swift_public] == true
|
|
64
65
|
end
|
|
65
66
|
|
|
67
|
+
def exclude_destinations
|
|
68
|
+
@hash[:exclude_destinations] || []
|
|
69
|
+
end
|
|
70
|
+
|
|
66
71
|
CONFIG_STRUCT = {
|
|
67
72
|
type: Hash,
|
|
68
73
|
elements: {
|
|
@@ -77,7 +82,8 @@ module Evva
|
|
|
77
82
|
people_enum_file_name: { type: String },
|
|
78
83
|
destinations_file_name: { type: String },
|
|
79
84
|
package_name: { type: String },
|
|
80
|
-
swift_public: { type: Object, optional: true }
|
|
85
|
+
swift_public: { type: Object, optional: true },
|
|
86
|
+
exclude_destinations: { type: Array, optional: true }
|
|
81
87
|
}
|
|
82
88
|
}.freeze
|
|
83
89
|
|
data/lib/evva/version.rb
CHANGED
data/lib/evva.rb
CHANGED
|
@@ -25,6 +25,7 @@ module Evva
|
|
|
25
25
|
|
|
26
26
|
config = Evva::Config.new(hash: YAML.safe_load(config_file))
|
|
27
27
|
bundle = analytics_data(config: config.data_source)
|
|
28
|
+
filter_destinations!(bundle, config.exclude_destinations)
|
|
28
29
|
case config.type.downcase
|
|
29
30
|
when "android"
|
|
30
31
|
generator = Evva::KotlinGenerator.new(config.package_name)
|
|
@@ -93,6 +94,14 @@ module Evva
|
|
|
93
94
|
opts_hash
|
|
94
95
|
end
|
|
95
96
|
|
|
97
|
+
def filter_destinations!(bundle, excluded)
|
|
98
|
+
return if excluded.empty?
|
|
99
|
+
|
|
100
|
+
bundle[:destinations].reject! { |d| excluded.include?(d) }
|
|
101
|
+
bundle[:events].each { |e| e.destinations.reject! { |d| excluded.include?(d) } }
|
|
102
|
+
bundle[:people].each { |p| p.destinations.reject! { |d| excluded.include?(d) } }
|
|
103
|
+
end
|
|
104
|
+
|
|
96
105
|
def write_to_file(path, data)
|
|
97
106
|
file_reader = Evva::FileReader.new
|
|
98
107
|
if file = file_reader.open_file(path, "w", false)
|
data/spec/evva_spec.rb
CHANGED
|
@@ -23,6 +23,40 @@ describe Evva do
|
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
describe ".filter_destinations!" do
|
|
27
|
+
let(:bundle) do
|
|
28
|
+
{
|
|
29
|
+
destinations: ["firebase", "mixpanel"],
|
|
30
|
+
events: [Evva::AnalyticsEvent.new("test_event", {}, ["firebase", "mixpanel"])],
|
|
31
|
+
people: [Evva::AnalyticsProperty.new("test_prop", "String", ["firebase", "mixpanel"])],
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
context "when excluding a destination" do
|
|
36
|
+
before { Evva.filter_destinations!(bundle, ["firebase"]) }
|
|
37
|
+
|
|
38
|
+
it "removes it from the destinations list" do
|
|
39
|
+
expect(bundle[:destinations]).to eq(["mixpanel"])
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
it "removes it from event destinations" do
|
|
43
|
+
expect(bundle[:events].first.destinations).to eq(["mixpanel"])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "removes it from people property destinations" do
|
|
47
|
+
expect(bundle[:people].first.destinations).to eq(["mixpanel"])
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
context "when exclude list is empty" do
|
|
52
|
+
before { Evva.filter_destinations!(bundle, []) }
|
|
53
|
+
|
|
54
|
+
it "does not change anything" do
|
|
55
|
+
expect(bundle[:destinations]).to eq(["firebase", "mixpanel"])
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
26
60
|
context "when generic.yml does not exist locally" do
|
|
27
61
|
let(:error) { "Could not open yml file" }
|
|
28
62
|
before do
|
|
@@ -47,6 +47,24 @@ describe Evva::Config do
|
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
+
describe "#exclude_destinations" do
|
|
51
|
+
context "when not set" do
|
|
52
|
+
its(:exclude_destinations) { should eq([]) }
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
context "when set to an array" do
|
|
56
|
+
before { hash[:exclude_destinations] = ["firebase"] }
|
|
57
|
+
|
|
58
|
+
its(:exclude_destinations) { should eq(["firebase"]) }
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
context "when not an array" do
|
|
62
|
+
before { hash[:exclude_destinations] = "firebase" }
|
|
63
|
+
|
|
64
|
+
it { expect { config }.to raise_error(ArgumentError, /Expected Array, got String/) }
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
50
68
|
describe "#swift_public?" do
|
|
51
69
|
context "when swift_public is true" do
|
|
52
70
|
before { hash[:swift_public] = true }
|
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.
|
|
4
|
+
version: 0.8.0
|
|
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-
|
|
13
|
+
date: 2026-05-26 00:00:00.000000000 Z
|
|
13
14
|
dependencies:
|
|
14
15
|
- !ruby/object:Gem::Dependency
|
|
15
16
|
name: colorize
|
|
@@ -112,6 +113,7 @@ homepage: https://github.com/hole19/
|
|
|
112
113
|
licenses:
|
|
113
114
|
- MIT
|
|
114
115
|
metadata: {}
|
|
116
|
+
post_install_message:
|
|
115
117
|
rdoc_options: []
|
|
116
118
|
require_paths:
|
|
117
119
|
- lib
|
|
@@ -126,7 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
126
128
|
- !ruby/object:Gem::Version
|
|
127
129
|
version: '0'
|
|
128
130
|
requirements: []
|
|
129
|
-
rubygems_version: 3.
|
|
131
|
+
rubygems_version: 3.5.3
|
|
132
|
+
signing_key:
|
|
130
133
|
specification_version: 4
|
|
131
134
|
summary: An event generating service
|
|
132
135
|
test_files: []
|