redbreast 1.2.4 → 1.3.0

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: 345104526de4e2d5a6b0d8bf70a2afb23ddc42b3305f05c31045aec5f661435b
4
- data.tar.gz: 0b711b3ebe9df7d1f27edc471d895d71b9766d6d3b3f7ad13fbb3abee108acd2
3
+ metadata.gz: f7a8875e2b36cd094a3d8dc5c74c7c1acf9d29de22c1d1efcbd9b545dfd469a8
4
+ data.tar.gz: 67e244c0e183fc8d03d8edf45dc271a2f7e8dc40fd1efe7a732779ff618d83c3
5
5
  SHA512:
6
- metadata.gz: 9a35c633ac705ddf2afaffcb15d91ae6649def315e84c7e71e29a82a21783d952cddec01ea603e7b57f787ee1a7fcba5ae4b3e8bd9d13c33f26fcddbb3fa897b
7
- data.tar.gz: 8c3a3d5ea38141551eff53ce852c9262f51a295c5ec96379c2d3800a504a293db07d7bb6308e36782f75faf2c92adee4dcc85bd3017c774dc1e2b8c74351bbad
6
+ metadata.gz: 3a01ac2f7e449861ce5697bf5f79a69a801d5e02b87804a7d88f704b10f3412da8636e8d0a7b06c7939759fbe37552a7bac3f5569b88dc6d94db7d9daab75d64
7
+ data.tar.gz: c4fa84840d2fce0395367b503971327cdab83c2e997d8a7a28d0c48c26d246074072e395411a90476ff3268f2d943406d1672c39c69bee2153005f9c550d1a8c
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.0
1
+ 3.1.0
@@ -22,7 +22,7 @@ module Redbreast
22
22
  end
23
23
 
24
24
  def write(output_source_path, template, file_name)
25
- file = ERB.new(template, nil, '-').result(binding)
25
+ file = ERB.new(template, trim_mode: '-').result(binding)
26
26
  File.write(File.join(output_source_path, file_name), file)
27
27
  end
28
28
 
@@ -11,7 +11,7 @@ module Redbreast
11
11
  directory = File.dirname(output_source_path)
12
12
  FileUtils.mkdir_p directory unless File.exist? directory
13
13
 
14
- file = ERB.new(template_generator.template, nil, '-').result(binding)
14
+ file = ERB.new(template_generator.template, trim_mode: '-').result(binding)
15
15
  File.write(output_source_path, file)
16
16
  end
17
17
 
@@ -50,11 +50,12 @@ module Redbreast
50
50
  end
51
51
 
52
52
  def generate_extension(extended_class, app_name)
53
- text = 'public extension ' + extended_class + " {\n"
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,12 +5,13 @@ 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)
11
12
  FileUtils.mkdir_p directory unless File.exist? directory
12
13
 
13
- file = ERB.new(template_generator.template, nil, '-').result(binding)
14
+ file = ERB.new(template_generator.template, trim_mode: '-').result(binding)
14
15
  File.write(output_source_path, file)
15
16
  end
16
17
 
@@ -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 + "\t", indentation: indentation + enum_name, variable: variable, bundle: bundle)
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 + "\t", indentation: indentation + enum_name, variable: variable, bundle: bundle)
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 + " {\n"
53
-
53
+ text = 'extension ' + extended_class + " {"
54
54
  return text if app_name.nil? || app_name.empty?
55
55
 
56
- text + "\tenum " + app_name + " {}\n}\n\nextension " + extended_class + '.' + app_name + " {"
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 += "\t\t" + declaration + app_name_text + temp_array.join('.') + additional_text + clean_variable_name(variable)
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 superfluous_disable_command
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
@@ -1,3 +1,3 @@
1
1
  module Redbreast
2
- VERSION = '1.2.4'
2
+ VERSION = '1.3.0'
3
3
  end
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
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maroje
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2023-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  - !ruby/object:Gem::Version
199
199
  version: '0'
200
200
  requirements: []
201
- rubygems_version: 3.2.3
201
+ rubygems_version: 3.3.3
202
202
  signing_key:
203
203
  specification_version: 4
204
204
  summary: A CLI for safe and strongly typed resources