redbreast 1.1.1 → 1.1.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4333c7695d94182141a09737fe4d5c298f2c7f48ef2b0235170436cb1746f41d
|
4
|
+
data.tar.gz: b2616e3e40e1958b58cae329046e25c3619903dd90b93af89c59da8242d34205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac62100673841d410911b49bb8dfa6c2d2992ecaec3b0fac8371a8af3c6f592e907809abfbc54d6673f8e450976017ec1d47f23dae352efa69011d3cac560885
|
7
|
+
data.tar.gz: fdccea173c982b8969ee4d5cfcf4377ec615cf84b7137503a3120bcf2bd9a66541eb13a7925da21a1a215dc40b9ae631f287c238f01a9bc7331bdb9b6049e9dc
|
@@ -45,6 +45,17 @@ module Redbreast
|
|
45
45
|
escape_with_underscore_if_needed(clean_name)
|
46
46
|
end
|
47
47
|
|
48
|
+
def upper_camel_case(name)
|
49
|
+
clean_name = name
|
50
|
+
.split(/[^0-9a-zA-Z]/)
|
51
|
+
.reject(&:empty?)
|
52
|
+
.each_with_index
|
53
|
+
.map { |v, i| i.zero? ? v.tap { |char| char[0] = char[0].upcase } : v.capitalize }
|
54
|
+
.join
|
55
|
+
|
56
|
+
escape_with_underscore_if_needed(clean_name)
|
57
|
+
end
|
58
|
+
|
48
59
|
def clean_case_name(name)
|
49
60
|
clean_variable_name(name)
|
50
61
|
end
|
@@ -40,7 +40,7 @@ module Redbreast
|
|
40
40
|
text = ''
|
41
41
|
|
42
42
|
names.each do |name|
|
43
|
-
temp_arr = name.split('/')
|
43
|
+
temp_arr = name.split('/').map { |folder| upper_camel_case(folder) }
|
44
44
|
|
45
45
|
variable_name = temp_arr.length == 1 ? clean_variable_name(name) : temp_arr.unshift(temp_arr.shift.downcase).join('')
|
46
46
|
text += variable_declaration % variable_name + variable_implementation % [name, bundle_name[:reference]]
|
@@ -54,7 +54,7 @@ module Redbreast
|
|
54
54
|
text = ''
|
55
55
|
|
56
56
|
names.each do |name|
|
57
|
-
temp_arr = name.split('/')
|
57
|
+
temp_arr = name.split('/').map { |folder| upper_camel_case(folder) }
|
58
58
|
variable_name = temp_arr.length == 1 ? clean_variable_name(name) : temp_arr.unshift(temp_arr.shift.downcase).join('')
|
59
59
|
text += variable % variable_name
|
60
60
|
end
|
@@ -23,13 +23,13 @@ module Redbreast
|
|
23
23
|
vars, arr = generate_variables(names: names, spacing: spacing, indentation: indentation, variable: variable, bundle: bundle, text: text, array: arr)
|
24
24
|
|
25
25
|
arr = arr.uniq
|
26
|
-
|
26
|
+
|
27
27
|
arr.each do |enum_name|
|
28
28
|
names_new = []
|
29
29
|
names_new_enum = []
|
30
30
|
new_enum_name = enum_name
|
31
31
|
|
32
|
-
text += "\n" + spacing + 'enum ' + enum_name + ' {'
|
32
|
+
text += "\n" + spacing + 'enum ' + upper_camel_case(enum_name) + ' {'
|
33
33
|
names_new, names_new_enum = separate_variables_from_folders(names: names, enum_name: enum_name, new_enum_name: new_enum_name, names_new_enum: names_new_enum, names_new: names_new)
|
34
34
|
|
35
35
|
if !names_new_enum.empty? && new_enum_name == enum_name
|
@@ -64,7 +64,8 @@ module Redbreast
|
|
64
64
|
temp_array = name.split('/')
|
65
65
|
variable = temp_array.pop
|
66
66
|
additional_text = temp_array.count.zero? ? '' : '.'
|
67
|
-
|
67
|
+
|
68
|
+
text += "\t\t" + declaration + app_name_text + temp_array.map { |enum| upper_camel_case(enum) }.join('.') + additional_text + clean_variable_name(variable)
|
68
69
|
text += name == names.last ? '' : "\n"
|
69
70
|
end
|
70
71
|
|
@@ -23,13 +23,13 @@ module Redbreast
|
|
23
23
|
vars, arr = generate_variables(names: names, spacing: spacing, indentation: indentation, variable: variable, bundle: bundle, text: text, array: arr)
|
24
24
|
|
25
25
|
arr = arr.uniq
|
26
|
-
|
26
|
+
|
27
27
|
arr.each do |enum_name|
|
28
28
|
names_new = []
|
29
29
|
names_new_enum = []
|
30
30
|
new_enum_name = enum_name
|
31
31
|
|
32
|
-
text += "\n" + spacing + 'enum ' + enum_name + ' {'
|
32
|
+
text += "\n" + spacing + 'enum ' + upper_camel_case(enum_name) + ' {'
|
33
33
|
names_new, names_new_enum = separate_variables_from_folders(names: names, enum_name: enum_name, new_enum_name: new_enum_name, names_new_enum: names_new_enum, names_new: names_new)
|
34
34
|
|
35
35
|
if !names_new_enum.empty? && new_enum_name == enum_name
|
data/lib/redbreast/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redbreast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maroje
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|