redbreast 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redbreast/serializers/swift_serializer.rb +3 -2
- data/lib/redbreast/serializers/swiftui_serializer.rb +7 -6
- data/lib/redbreast/template_generators/colors/swift_colors_template_generator.rb +2 -2
- data/lib/redbreast/template_generators/colors/swiftui_colors_template_generator.rb +2 -2
- data/lib/redbreast/template_generators/images/swift_images_template_generator.rb +2 -2
- data/lib/redbreast/template_generators/images/swiftui_images_template_generator.rb +2 -2
- data/lib/redbreast/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: d6ad3a4048013b2fe1674cd37e6d09798f7c444c3dbfe8b9e691031dd04a7984
|
4
|
+
data.tar.gz: b44b7e7d2512d10cdb3c26e349002cfa23410d5eb4ab1b7735352025a74cd630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c4753e2751f51aff773b9b7021bdc1cf7573367d98d4bcad7b3c02494f3e826e442dabddb6a57609ee411f3f79c36ab56766a6dd9ca27858b0869f25defde31
|
7
|
+
data.tar.gz: 164652399895ff936501f536a2fc089202efd0dbe35e1093d28d4a7a1f98a6d737233abeb3915e95dfc848c64740b57eda23dad0a918c28911da2d9d6a450bb9
|
@@ -50,11 +50,12 @@ module Redbreast
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def generate_extension(extended_class, app_name)
|
53
|
-
text = '
|
54
|
-
|
53
|
+
text = 'extension ' + extended_class + " {"
|
55
54
|
return text if app_name.nil? || app_name.empty?
|
56
55
|
|
56
|
+
text = 'public extension ' + extended_class + " {\n"
|
57
57
|
text + SPACER + "enum " + app_name + " {}\n}\n\nextension " + extended_class + '.' + app_name + " {"
|
58
|
+
|
58
59
|
end
|
59
60
|
|
60
61
|
def create_swift_test_cases(names:, declaration:, app_name:)
|
@@ -5,6 +5,7 @@ module Redbreast
|
|
5
5
|
# Used to save swift files
|
6
6
|
class SwiftUI < Base
|
7
7
|
include Helper::General
|
8
|
+
SPACER = " "
|
8
9
|
|
9
10
|
def save(output_source_path:, template_generator:, generate_colors:)
|
10
11
|
directory = File.dirname(output_source_path)
|
@@ -34,13 +35,13 @@ module Redbreast
|
|
34
35
|
|
35
36
|
if !names_new_enum.empty? && new_enum_name == enum_name
|
36
37
|
indentation += indentation.empty? || indentation[-1] == '/' ? '' : '/'
|
37
|
-
text += "\n" + generate_file_swift(names: names_new_enum, spacing: spacing +
|
38
|
+
text += "\n" + generate_file_swift(names: names_new_enum, spacing: spacing + SPACER, indentation: indentation + enum_name, variable: variable, bundle: bundle)
|
38
39
|
end
|
39
40
|
|
40
41
|
unless names_new.empty?
|
41
42
|
|
42
43
|
indentation += indentation.empty? || indentation[-1] == '/' ? '' : '/'
|
43
|
-
text += generate_file_swift(names: names_new, spacing: spacing +
|
44
|
+
text += generate_file_swift(names: names_new, spacing: spacing + SPACER, indentation: indentation + enum_name, variable: variable, bundle: bundle)
|
44
45
|
end
|
45
46
|
|
46
47
|
text += "\n" + spacing + '}' + "\n"
|
@@ -49,11 +50,11 @@ module Redbreast
|
|
49
50
|
end
|
50
51
|
|
51
52
|
def generate_extension(extended_class, app_name)
|
52
|
-
text = 'extension ' + extended_class + " {
|
53
|
-
|
53
|
+
text = 'extension ' + extended_class + " {"
|
54
54
|
return text if app_name.nil? || app_name.empty?
|
55
55
|
|
56
|
-
text
|
56
|
+
text = 'public extension ' + extended_class + " {\n"
|
57
|
+
text + SPACER + "enum " + app_name + " {}\n}\n\nextension " + extended_class + '.' + app_name + " {"
|
57
58
|
end
|
58
59
|
|
59
60
|
def create_swift_test_cases(names:, declaration:, app_name:)
|
@@ -64,7 +65,7 @@ module Redbreast
|
|
64
65
|
temp_array = name.split('/')
|
65
66
|
variable = temp_array.pop
|
66
67
|
additional_text = temp_array.count.zero? ? '' : '.'
|
67
|
-
text +=
|
68
|
+
text += SPACER + SPACER + declaration + app_name_text + temp_array.join('.') + additional_text + clean_variable_name(variable)
|
68
69
|
text += name == names.last ? '' : "\n"
|
69
70
|
end
|
70
71
|
|
@@ -11,9 +11,9 @@ module Redbreast
|
|
11
11
|
import UIKit
|
12
12
|
|
13
13
|
// THIS FILE IS AUTOGENERATED, DO NOT EDIT BY HAND
|
14
|
-
// swiftlint:disable file_length type_body_length line_length superfluous_disable_command
|
14
|
+
// swiftlint:disable file_length type_body_length line_length superfluous_disable_command extension_access_modifier
|
15
15
|
<%= generate_extension('UIColor', app_name) %>
|
16
|
-
<%= generate_file_swift(names: asset_names, variable: 'static var %s: UIColor { return UIColor(named: "%s", in: %s, compatibleWith: nil)! }', bundle: bundle) %>
|
16
|
+
<%= generate_file_swift(names: asset_names, variable: 'public static var %s: UIColor { return UIColor(named: "%s", in: %s, compatibleWith: nil)! }', bundle: bundle) %>
|
17
17
|
}
|
18
18
|
TEMPLATE
|
19
19
|
end
|
@@ -11,9 +11,9 @@ module Redbreast
|
|
11
11
|
import SwiftUI
|
12
12
|
|
13
13
|
// THIS FILE IS AUTOGENERATED, DO NOT EDIT BY HAND
|
14
|
-
// swiftlint:disable file_length type_body_length line_length superfluous_disable_command
|
14
|
+
// swiftlint:disable file_length type_body_length line_length superfluous_disable_command extension_access_modifier
|
15
15
|
<%= generate_extension('Color', app_name) %>
|
16
|
-
<%= generate_file_swift(names: asset_names, variable: 'static var %s: Color { Color("%s", bundle: %s) }', bundle: bundle) %>
|
16
|
+
<%= generate_file_swift(names: asset_names, variable: 'public static var %s: Color { Color("%s", bundle: %s) }', bundle: bundle) %>
|
17
17
|
}
|
18
18
|
TEMPLATE
|
19
19
|
end
|
@@ -12,9 +12,9 @@ module Redbreast
|
|
12
12
|
import UIKit
|
13
13
|
|
14
14
|
// THIS FILE IS AUTOGENERATED, DO NOT EDIT BY HAND
|
15
|
-
// swiftlint:disable file_length type_body_length line_length superfluous_disable_command
|
15
|
+
// swiftlint:disable file_length type_body_length line_length superfluous_disable_command extension_access_modifier
|
16
16
|
<%= generate_extension('UIImage', app_name) %>
|
17
|
-
<%= generate_file_swift(names: asset_names, variable: 'static var %s: UIImage { return UIImage(named: "%s", in: %s, compatibleWith: nil)! }', bundle: bundle) %>
|
17
|
+
<%= generate_file_swift(names: asset_names, variable: 'public static var %s: UIImage { return UIImage(named: "%s", in: %s, compatibleWith: nil)! }', bundle: bundle) %>
|
18
18
|
}
|
19
19
|
TEMPLATE
|
20
20
|
end
|
@@ -12,9 +12,9 @@ module Redbreast
|
|
12
12
|
import SwiftUI
|
13
13
|
|
14
14
|
// THIS FILE IS AUTOGENERATED, DO NOT EDIT BY HAND
|
15
|
-
// swiftlint:disable file_length type_body_length line_length
|
15
|
+
// swiftlint:disable file_length type_body_length line_length superfluous_disable_commandextension_access_modifier
|
16
16
|
<%= generate_extension('Image', app_name) %>
|
17
|
-
<%= generate_file_swift(names: asset_names, variable: 'static var %s: Image { Image("%s", bundle: %s) }', bundle: bundle) %>
|
17
|
+
<%= generate_file_swift(names: asset_names, variable: 'public static var %s: Image { Image("%s", bundle: %s) }', bundle: bundle) %>
|
18
18
|
}
|
19
19
|
TEMPLATE
|
20
20
|
end
|
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.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maroje
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|