evva 0.1.4.3 → 0.1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +4 -0
- data/evva_config.yml +2 -1
- data/lib/evva.rb +1 -1
- data/lib/evva/android_generator.rb +14 -8
- data/lib/evva/config.rb +6 -1
- data/lib/evva/version.rb +2 -2
- data/spec/fixtures/test.yml +2 -1
- data/spec/lib/evva/android_generator_spec.rb +1 -1
- data/spec/lib/evva/config_spec.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f29745f30be02ffd8aaeaabc97bb6f7aa78e336a
|
4
|
+
data.tar.gz: 7997447508877d82eea4904e50c43a71a15b9ddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 287b552754e902b50d228fc4813375a88083f79dc11a3cf8475bf29b15842f850036ccc69dcc5ec407735c9263458446f1b23dcdd8f98afccd9ae966f44b8f48
|
7
|
+
data.tar.gz: 9606d7647b418445d8417063e2dba6652be7c5252c9395b62ec65a1bc35e1f1f21fba68f173fa13f72fc4db4b6c4c44a477d1ae3547558e5b7465035c48dc31d
|
data/changelog.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# Change Log
|
2
|
+
## [0.1.4.4] - 2019-02-04
|
3
|
+
- Adds support for dynamic android package name
|
4
|
+
|
2
5
|
## [0.1.4.3] - 2018-10-12
|
3
6
|
- Fixes swift and kotlin tabs, indentation and property names
|
4
7
|
- Merges all special enums in a single file
|
@@ -25,3 +28,4 @@
|
|
25
28
|
|
26
29
|
## [0.1.0] - 2017/10/26
|
27
30
|
- Initial Release.
|
31
|
+
|
data/evva_config.yml
CHANGED
data/lib/evva.rb
CHANGED
@@ -26,7 +26,7 @@ module Evva
|
|
26
26
|
bundle = analytics_data(config: config.data_source)
|
27
27
|
case config.type.downcase
|
28
28
|
when 'android'
|
29
|
-
generator = Evva::AndroidGenerator.new
|
29
|
+
generator = Evva::AndroidGenerator.new(config.package_name)
|
30
30
|
evva_write(bundle, generator, config, 'kt')
|
31
31
|
when 'ios'
|
32
32
|
generator = Evva::SwiftGenerator.new
|
@@ -1,5 +1,16 @@
|
|
1
1
|
module Evva
|
2
2
|
class AndroidGenerator
|
3
|
+
attr_accessor :package_name
|
4
|
+
|
5
|
+
def initialize(package_name)
|
6
|
+
@package_name = package_name
|
7
|
+
end
|
8
|
+
|
9
|
+
IMPORT_EVENT = "import packagename.Event".freeze
|
10
|
+
IMPORT_MASK = "import packagename.MixpanelAnalyticsMask".freeze
|
11
|
+
IMPORT_JSON = "import org.json.JSONObject".freeze
|
12
|
+
|
13
|
+
NATIVE_TYPES = %w[Long Int String Double Float Boolean].freeze
|
3
14
|
|
4
15
|
def events(bundle, file_name)
|
5
16
|
header_footer_wrapper([IMPORT_EVENT, IMPORT_MASK, IMPORT_JSON]) do
|
@@ -44,22 +55,17 @@ module Evva
|
|
44
55
|
end
|
45
56
|
end
|
46
57
|
|
47
|
-
IMPORT_EVENT = "import com.hole19golf.hole19.analytics.Event".freeze
|
48
|
-
IMPORT_MASK = "import com.hole19golf.hole19.analytics.MixpanelAnalyticsMask".freeze
|
49
|
-
IMPORT_JSON = "import org.json.JSONObject".freeze
|
50
|
-
|
51
|
-
NATIVE_TYPES = %w[Long Int String Double Float Boolean].freeze
|
52
|
-
|
53
58
|
private
|
54
59
|
|
55
60
|
def imports_header(imports = [])
|
56
61
|
return unless imports.length > 0
|
57
|
-
imports.
|
62
|
+
imports.map { |ev| ev. gsub("packagename", @package_name) }
|
63
|
+
.join("\n") + "\n\n"
|
58
64
|
end
|
59
65
|
|
60
66
|
def header_footer_wrapper(imports = [])
|
61
67
|
<<-Kotlin
|
62
|
-
package
|
68
|
+
package #{@package_name}
|
63
69
|
|
64
70
|
#{imports_header(imports)}/**
|
65
71
|
* This file was automatically generated by evva: https://github.com/hole19/evva
|
data/lib/evva/config.rb
CHANGED
@@ -43,6 +43,10 @@ module Evva
|
|
43
43
|
@hash[:special_enum_file_name]
|
44
44
|
end
|
45
45
|
|
46
|
+
def package_name
|
47
|
+
@hash[:package_name]
|
48
|
+
end
|
49
|
+
|
46
50
|
CONFIG_STRUCT = {
|
47
51
|
type: Hash,
|
48
52
|
elements: {
|
@@ -53,7 +57,8 @@ module Evva
|
|
53
57
|
out_path: { type: String },
|
54
58
|
event_file_name: { type: String },
|
55
59
|
event_enum_file_name: { type: String },
|
56
|
-
people_file_name: { type: String }
|
60
|
+
people_file_name: { type: String },
|
61
|
+
package_name: { type: String }
|
57
62
|
}
|
58
63
|
}.freeze
|
59
64
|
|
data/lib/evva/version.rb
CHANGED
data/spec/fixtures/test.yml
CHANGED
@@ -11,7 +11,8 @@ describe Evva::Config do
|
|
11
11
|
out_path: 'clear/path/to/event',
|
12
12
|
event_file_name: 'event/file/name',
|
13
13
|
people_file_name: 'people/file/name',
|
14
|
-
event_enum_file_name: 'event/enum/file'
|
14
|
+
event_enum_file_name: 'event/enum/file',
|
15
|
+
package_name: 'com.package.name.analytics'
|
15
16
|
}
|
16
17
|
end
|
17
18
|
|
@@ -26,6 +27,7 @@ describe Evva::Config do
|
|
26
27
|
its(:event_file_name) { should eq('event/file/name') }
|
27
28
|
its(:people_file_name) { should eq('people/file/name') }
|
28
29
|
its(:event_enum_file_name) { should eq 'event/enum/file' }
|
30
|
+
its(:package_name) { should eq 'com.package.name.analytics' }
|
29
31
|
|
30
32
|
describe '#data_source' do
|
31
33
|
subject(:data_source) { config.data_source }
|
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.1.4.
|
4
|
+
version: 0.1.4.4
|
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: 2019-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|