evva 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eda305fb53e24ab22bc0708758f7474d31ca0ea3
4
- data.tar.gz: 6505070c7afb5614034bf41a1678b9a7be41b30e
3
+ metadata.gz: 91e13c0040b6c7afa9b48d0913dd7b12b301ffe4
4
+ data.tar.gz: e14a7dd7e190d55d8827ab3e02c100e87374aec6
5
5
  SHA512:
6
- metadata.gz: 01ee93a2ec2073988a970ba21613bbcff4a40fc1d7cb17ab7ebb432f9a06ae619c2c2a66c6a688d35410a43f8a112d94be5f9c6d44c7808ea9c952630f810041
7
- data.tar.gz: 0e04da40cdd2417b130a01334c1bc429d3eaf2b26ccbcbd4dcf6ef0e7441b7280bef3aeb44064038897ac3559c521c94d2a55b9a75dda65f917e7fb04c997ea1
6
+ metadata.gz: c9a76ca65eb48908a0d6f94c525f5c46fb8995a4e7cfd3fdf5d7b0edaee7688c82ad4200c239a468f493f3002148c821cfeb7c8ba12d9d0545e8f7d0f431534d
7
+ data.tar.gz: 55ebd2109cb41956effa3930d7e7db558ce68910a442a04db0606e284b9e893fdb1932d249e3c38eb9b492bf969879fc727728189589ad25314d58aafbe570d2
@@ -0,0 +1,7 @@
1
+ # Change Log
2
+
3
+ ## [0.1.1] - 2017-11-07
4
+ Fixes mismatch between file name and class name generated.
5
+
6
+ ## [0.1.0] - 2017/10/26
7
+ Initial Release.
@@ -38,13 +38,13 @@ module Evva
38
38
 
39
39
  def evva_write(bundle, generator, configuration, extension)
40
40
  path = "#{configuration.out_path}/#{configuration.event_file_name}.#{extension}"
41
- write_to_file(path, generator.events(bundle[:events]))
41
+ write_to_file(path, generator.events(bundle[:events], configuration.event_file_name))
42
42
 
43
43
  path = "#{configuration.out_path}/#{configuration.event_enum_file_name}.#{extension}"
44
- write_to_file(path, generator.event_enum(bundle[:events]))
44
+ write_to_file(path, generator.event_enum(bundle[:events], configuration.event_enum_file_name))
45
45
 
46
46
  path = "#{configuration.out_path}/#{configuration.people_file_name}.#{extension}"
47
- write_to_file(path, generator.people_properties(bundle[:people]))
47
+ write_to_file(path, generator.people_properties(bundle[:people], configuration.people_file_name))
48
48
 
49
49
  bundle[:enums].each do |enum|
50
50
  path = "#{configuration.out_path}/#{enum.enum_name}.#{extension}"
@@ -4,18 +4,15 @@ module Evva
4
4
  "package com.hole19golf.hole19.analytics\n\n"\
5
5
  "import com.hole19golf.hole19.analytics.Event\n"\
6
6
  "import com.hole19golf.hole19.analytics.MixpanelAnalyticsMask\n"\
7
- "import org.json.JSONObject\n\n"\
8
- "open class MixpanelEvents(private val mixpanelMask: MixpanelAnalyticsMask) {\n".freeze
7
+ "import org.json.JSONObject\n\n".freeze
9
8
 
10
9
  KOTLIN_PEOPLE_HEADER =
11
10
  "package com.hole19golf.hole19.analytics\n"\
12
- "import com.hole19golf.hole19.analytics.Event\n\n"\
13
- "enum class MixpanelProperties(val key: String) {\n".freeze
11
+ "import com.hole19golf.hole19.analytics.Event\n\n".freeze
14
12
 
15
13
  KOTLIN_BUNDLE_HEADER =
16
14
  "package com.hole19golf.hole19.analytics\n"\
17
- "import com.hole19golf.hole19.analytics.Event\n\n"\
18
- "enum class MixpanelEvent(override val key: String) : Event {\n".freeze
15
+ "import com.hole19golf.hole19.analytics.Event\n\n".freeze
19
16
 
20
17
  KOTIN_PEOPLE_FUNCTIONS =
21
18
  "\topen fun updateProperties(property: MixpanelProperties, value: Any) {\n"\
@@ -27,8 +24,8 @@ module Evva
27
24
 
28
25
  NATIVE_TYPES = %w[Long Int String Double Float Boolean].freeze
29
26
 
30
- def events(bundle)
31
- event_file = KOTLIN_EVENT_HEADER
27
+ def events(bundle, file_name)
28
+ event_file = KOTLIN_EVENT_HEADER + "open class #{file_name}(private val mixpanelMask: MixpanelAnalyticsMask) {\n".freeze
32
29
  bundle.each do |event|
33
30
  event_file += "\n#{kotlin_function(event)}"
34
31
  end
@@ -36,14 +33,14 @@ module Evva
36
33
  event_file += "\n}"
37
34
  end
38
35
 
39
- def people_properties(people_bundle)
40
- properties = KOTLIN_PEOPLE_HEADER
36
+ def people_properties(people_bundle, file_name)
37
+ properties = KOTLIN_PEOPLE_HEADER + "enum class #{file_name}(val key: String) {\n"
41
38
  properties += people_bundle.map { |prop| "\t\t#{prop.upcase}(\"#{prop}\")" }.join(",\n")
42
39
  properties += ";\n}\n"
43
40
  end
44
41
 
45
- def event_enum(bundle)
46
- event_file = KOTLIN_BUNDLE_HEADER
42
+ def event_enum(bundle, file_name)
43
+ event_file = KOTLIN_BUNDLE_HEADER + "enum class #{file_name}(override val key: String) : Event {\n"
47
44
  event_file += bundle.map { |event| "\t\t#{event.event_name.upcase}(\"#{event.event_name}\")"}.join(", \n")
48
45
  event_file += "\n}\n"
49
46
  end
@@ -1,4 +1,4 @@
1
1
  module Evva
2
- VERSION = '0.1.0'.freeze
3
- VERSION_UPDATED_AT = '2017-10-26'.freeze
2
+ VERSION = '0.1.1'.freeze
3
+ VERSION_UPDATED_AT = '2017-11-07'.freeze
4
4
  end
@@ -99,7 +99,7 @@ describe Evva::AndroidGenerator do
99
99
  end
100
100
 
101
101
  describe '#event_enum' do
102
- subject { trim_spaces(generator.event_enum(event_bundle)) }
102
+ subject { trim_spaces(generator.event_enum(event_bundle, 'MixpanelEvent')) }
103
103
  let(:event_bundle) { [
104
104
  Evva::MixpanelEvent.new('nav_feed_tap', {}),
105
105
  Evva::MixpanelEvent.new('nav_performance_tap', {})
@@ -118,7 +118,7 @@ describe Evva::AndroidGenerator do
118
118
  end
119
119
 
120
120
  describe '#people_properties' do
121
- subject { trim_spaces(generator.people_properties(people_bundle)) }
121
+ subject { trim_spaces(generator.people_properties(people_bundle, 'MixpanelProperties')) }
122
122
  let(:people_bundle) { ['rounds_with_wear', 'friends_from_facebook'] }
123
123
  let(:expected) { <<-Kotlin
124
124
  package com.hole19golf.hole19.analytics
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - RicardoTrindade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-26 00:00:00.000000000 Z
11
+ date: 2017-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: safe_yaml
@@ -80,6 +80,7 @@ files:
80
80
  - Gemfile.lock
81
81
  - README.md
82
82
  - bin/evva
83
+ - changelog.md
83
84
  - evva.gemspec
84
85
  - evva_config.yml
85
86
  - lib/evva.rb