leap_salesforce 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/lib/leap_salesforce/ext/string.rb +15 -0
- data/lib/leap_salesforce/generator/soql_enums.rb +3 -1
- data/lib/leap_salesforce/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dad7a996366ea8a7e9dc3b7acfee0bd5a3c028b9cbbfcb900436af73a6974e80
|
4
|
+
data.tar.gz: 0a1b977c80d03b62d6e2e963e2a37ae1bd9e3185b4ac25f6eed68804a0291cd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fcb10612c2c13acd12ca01d67a2bb3a92739cb5ac88c321df5775a9c6d11e75640e74bfd5e00b0322988c0a096867c53661540fd009f6b5e85d676588b3cec5
|
7
|
+
data.tar.gz: daaad233034d817aa45bb7d5afe489cd61eb8a951d509437d8bba470ed84f37335f6f5893c15eeea2e6b6387a61f7c095123382957e57a711ce152fcecd2f7f2
|
data/ChangeLog
CHANGED
@@ -28,6 +28,21 @@ class String
|
|
28
28
|
to_ruby_friendly.snakecase.gsub(/__+/, '_')
|
29
29
|
end
|
30
30
|
|
31
|
+
# @return [String] Return a key name that is unique to the hash
|
32
|
+
def to_key_name_for(hash)
|
33
|
+
key_name = to_key_name
|
34
|
+
index = 0
|
35
|
+
while hash[key_name]
|
36
|
+
if ('1'..'9').cover? key_name[-1]
|
37
|
+
key_name[-1] = (key_name[-1].to_i + 1).to_s
|
38
|
+
else
|
39
|
+
key_name += '_1'
|
40
|
+
end
|
41
|
+
break if (index += 1) >= 9
|
42
|
+
end
|
43
|
+
key_name
|
44
|
+
end
|
45
|
+
|
31
46
|
# Convert string starting with number to a human string
|
32
47
|
def humanize_numbered_string
|
33
48
|
self[0] = ('0'..'9').cover?(self[0]) ? self[0].to_i.humanize : self[0]
|
@@ -35,7 +35,9 @@ module LeapSalesforce
|
|
35
35
|
picklist_name = picklist.to_key_name
|
36
36
|
values = entity.picklist_for(picklist)
|
37
37
|
@enum_values = {}
|
38
|
-
values.each
|
38
|
+
values.each do |value|
|
39
|
+
@enum_values[value.to_key_name_for(@enum_values)] = value
|
40
|
+
end
|
39
41
|
content = read_template 'picklist.rb.erb', binding
|
40
42
|
file = File.join(ENUM_FOLDER, entity.to_s.snakecase, "#{picklist_name}.rb")
|
41
43
|
generate_file file, content
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leap_salesforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IQA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-07-
|
12
|
+
date: 2019-07-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|