redbreast 1.1.2 → 1.2.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: 4333c7695d94182141a09737fe4d5c298f2c7f48ef2b0235170436cb1746f41d
4
- data.tar.gz: b2616e3e40e1958b58cae329046e25c3619903dd90b93af89c59da8242d34205
3
+ metadata.gz: 6aca71fbf8dac645718a3761e8ea63d558da0408e164f3b76719c71033a998b0
4
+ data.tar.gz: 259911278e8748361af3ca309e0b737725b059f5ea2d325b129f1ad28d039942
5
5
  SHA512:
6
- metadata.gz: ac62100673841d410911b49bb8dfa6c2d2992ecaec3b0fac8371a8af3c6f592e907809abfbc54d6673f8e450976017ec1d47f23dae352efa69011d3cac560885
7
- data.tar.gz: fdccea173c982b8969ee4d5cfcf4377ec615cf84b7137503a3120bcf2bd9a66541eb13a7925da21a1a215dc40b9ae631f287c238f01a9bc7331bdb9b6049e9dc
6
+ metadata.gz: 55b2b2c6be72a7c22caa55a307ae1b1f4cb2baf13912fccc3c66d781503938a7ea36a90402d8cf9737cf1a7ebd9fbb653088bb56bbec46a7837ce1da497bee3b
7
+ data.tar.gz: '078a5708d06c491efd4c75afcdf80c1fc3026ec5365fa1ed0955a49afb974ce32e909cc1b20d14996f7aecc39b7f8ef7c8d649779d5706096cd4fdd79a9001d3'
data/.gitignore CHANGED
@@ -10,3 +10,37 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+
14
+ # Created by https://www.toptal.com/developers/gitignore/api/macos
15
+ # Edit at https://www.toptal.com/developers/gitignore?templates=macos
16
+
17
+ ### macOS ###
18
+ # General
19
+ .DS_Store
20
+ .AppleDouble
21
+ .LSOverride
22
+
23
+ # Icon must end with two \r
24
+ Icon
25
+
26
+
27
+ # Thumbnails
28
+ ._*
29
+
30
+ # Files that might appear in the root of a volume
31
+ .DocumentRevisions-V100
32
+ .fseventsd
33
+ .Spotlight-V100
34
+ .TemporaryItems
35
+ .Trashes
36
+ .VolumeIcon.icns
37
+ .com.apple.timemachine.donotpresent
38
+
39
+ # Directories potentially created on remote AFP share
40
+ .AppleDB
41
+ .AppleDesktop
42
+ Network Trash Folder
43
+ Temporary Items
44
+ .apdisk
45
+
46
+ # End of https://www.toptal.com/developers/gitignore/api/macos
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.0
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.14.6
4
+ - 2.7.0
5
+ before_install: gem install bundler -v 2.3.4
@@ -5,6 +5,7 @@ module Redbreast
5
5
  # Used to save swift files
6
6
  class Swift < 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)
@@ -14,7 +15,7 @@ module Redbreast
14
15
  File.write(output_source_path, file)
15
16
  end
16
17
 
17
- def generate_file_swift(names:, spacing: "\t", indentation: '', variable:, bundle:)
18
+ def generate_file_swift(names:, spacing: SPACER, indentation: '', variable:, bundle:)
18
19
  return if names.empty?
19
20
 
20
21
  text = ''
@@ -22,25 +23,25 @@ module Redbreast
22
23
 
23
24
  vars, arr = generate_variables(names: names, spacing: spacing, indentation: indentation, variable: variable, bundle: bundle, text: text, array: arr)
24
25
 
25
- arr = arr.uniq
26
+ arr = arr.uniq.sort_by(&:downcase)
26
27
 
27
28
  arr.each do |enum_name|
28
29
  names_new = []
29
30
  names_new_enum = []
30
31
  new_enum_name = enum_name
31
32
 
32
- text += "\n" + spacing + 'enum ' + upper_camel_case(enum_name) + ' {'
33
+ text += "\n" + spacing + 'public enum ' + upper_camel_case(enum_name) + ' {'
33
34
  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
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
+ text = 'public extension ' + extended_class + " {\n"
53
54
 
54
55
  return text if app_name.nil? || app_name.empty?
55
56
 
56
- text + "\tenum " + app_name + " {}\n}\n\nextension " + extended_class + '.' + app_name + " {"
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:)
@@ -65,7 +66,7 @@ module Redbreast
65
66
  variable = temp_array.pop
66
67
  additional_text = temp_array.count.zero? ? '' : '.'
67
68
 
68
- text += "\t\t" + declaration + app_name_text + temp_array.map { |enum| upper_camel_case(enum) }.join('.') + additional_text + clean_variable_name(variable)
69
+ text += SPACER + SPACER + declaration + app_name_text + temp_array.map { |enum| upper_camel_case(enum) }.join('.') + additional_text + clean_variable_name(variable)
69
70
  text += name == names.last ? '' : "\n"
70
71
  end
71
72
 
@@ -73,7 +74,7 @@ module Redbreast
73
74
  end
74
75
 
75
76
  def generate_variables(names:, spacing:, indentation:, bundle:, variable:, text:, array:)
76
- names.each do |name|
77
+ names.sort_by(&:downcase).each do |name|
77
78
  temp_arr = name.split('/')
78
79
 
79
80
  if temp_arr.length != 1
@@ -13,7 +13,7 @@ module Redbreast
13
13
  // THIS FILE IS AUTOGENERATED, DO NOT EDIT BY HAND
14
14
  // swiftlint:disable file_length type_body_length line_length superfluous_disable_command
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
@@ -14,7 +14,7 @@ module Redbreast
14
14
  // THIS FILE IS AUTOGENERATED, DO NOT EDIT BY HAND
15
15
  // swiftlint:disable file_length type_body_length line_length superfluous_disable_command
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.1.2'
2
+ VERSION = '1.2.2'
3
3
  end
data/redbreast.gemspec CHANGED
@@ -28,8 +28,8 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
30
 
31
- spec.add_development_dependency 'bundler', '~> 1.14'
32
- spec.add_development_dependency 'rake', '~> 10.0'
31
+ spec.add_development_dependency 'bundler', '~> 2.3'
32
+ spec.add_development_dependency 'rake', '~> 13.0'
33
33
  spec.add_development_dependency 'rspec', '~> 3.0'
34
34
  spec.add_development_dependency 'rubocop', '~> 0.77'
35
35
 
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.2
4
+ version: 1.2.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-08-26 00:00:00.000000000 Z
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
19
+ version: '2.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.14'
26
+ version: '2.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -130,10 +130,10 @@ executables:
130
130
  extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
- - ".DS_Store"
134
133
  - ".gitignore"
135
134
  - ".rspec"
136
135
  - ".rubocop.yml"
136
+ - ".ruby-version"
137
137
  - ".travis.yml"
138
138
  - CODE_OF_CONDUCT.md
139
139
  - Gemfile
@@ -143,9 +143,7 @@ files:
143
143
  - bin/console
144
144
  - bin/setup
145
145
  - exe/redbreast
146
- - lib/.DS_Store
147
146
  - lib/redbreast.rb
148
- - lib/redbreast/.DS_Store
149
147
  - lib/redbreast/commands/color_generator.rb
150
148
  - lib/redbreast/commands/color_test_generator.rb
151
149
  - lib/redbreast/commands/configuration_installer.rb
@@ -163,7 +161,6 @@ files:
163
161
  - lib/redbreast/serializers/serializer.rb
164
162
  - lib/redbreast/serializers/swift_serializer.rb
165
163
  - lib/redbreast/serializers/swiftui_serializer.rb
166
- - lib/redbreast/template_generators/.DS_Store
167
164
  - lib/redbreast/template_generators/colors/objc_colors_template_generator.rb
168
165
  - lib/redbreast/template_generators/colors/swift_colors_template_generator.rb
169
166
  - lib/redbreast/template_generators/colors/swiftui_colors_template_generator.rb
@@ -201,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
198
  - !ruby/object:Gem::Version
202
199
  version: '0'
203
200
  requirements: []
204
- rubygems_version: 3.0.6
201
+ rubygems_version: 3.1.2
205
202
  signing_key:
206
203
  specification_version: 4
207
204
  summary: A CLI for safe and strongly typed resources
data/.DS_Store DELETED
Binary file
data/lib/.DS_Store DELETED
Binary file
Binary file