redbreast 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +34 -0
- data/.ruby-version +1 -0
- data/.travis.yml +2 -2
- data/lib/redbreast/serializers/swift_serializer.rb +8 -7
- data/lib/redbreast/version.rb +1 -1
- data/redbreast.gemspec +2 -2
- metadata +7 -10
- data/.DS_Store +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/redbreast/.DS_Store +0 -0
- data/lib/redbreast/template_generators/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9840f88046197446fc6c9eb46afd5abe82c66fb1f48aee16827fbc00541992ef
|
4
|
+
data.tar.gz: 2dd93e1ea1cce94ff8202a472a4fff651a778cdd3e802dd9cd1a641dbabc1fdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e1622222467886c0c4e84519e0bad43ac4f82c6c8efc3d0aca75e5141d422ac9e5167227f377162b714081a7f11b102d60aaa665222a7a89d43af14146b0ed5
|
7
|
+
data.tar.gz: bdb375e6d106a93874da0ed1b3567ed43386ff68c51c76be1575ed40e3355068816bff4584cb2d4bd16b699e3aa3a1d0d07bc42ae9e84d4a10b8d99621616010
|
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
@@ -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:
|
18
|
+
def generate_file_swift(names:, spacing: SPACER, indentation: '', variable:, bundle:)
|
18
19
|
return if names.empty?
|
19
20
|
|
20
21
|
text = ''
|
@@ -22,7 +23,7 @@ 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 = []
|
@@ -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"
|
@@ -53,7 +54,7 @@ module Redbreast
|
|
53
54
|
|
54
55
|
return text if app_name.nil? || app_name.empty?
|
55
56
|
|
56
|
-
text + "
|
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 +=
|
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
|
data/lib/redbreast/version.rb
CHANGED
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', '~>
|
32
|
-
spec.add_development_dependency 'rake', '~>
|
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.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maroje
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-11 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: '
|
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: '
|
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: '
|
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: '
|
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
|
data/.DS_Store
DELETED
Binary file
|
data/lib/.DS_Store
DELETED
Binary file
|
data/lib/redbreast/.DS_Store
DELETED
Binary file
|
Binary file
|